2012-06-29 05:18:28 +00:00
|
|
|
# -*- coding: binary -*-
|
2010-08-06 17:37:28 +00:00
|
|
|
|
2011-05-12 20:03:55 +00:00
|
|
|
require 'rex/proto/dhcp'
|
2010-08-06 17:37:28 +00:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# This mixin provides a DHCPServer
|
|
|
|
#
|
|
|
|
###
|
|
|
|
module Exploit::DHCPServer
|
|
|
|
|
2013-08-30 21:28:33 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super
|
|
|
|
|
|
|
|
@dhcp = nil
|
|
|
|
end
|
|
|
|
|
|
|
|
def start_service(hash = {}, context = {})
|
|
|
|
@dhcp = Rex::Proto::DHCP::Server.new(hash, context)
|
|
|
|
print_status("Starting DHCP server") if datastore['VERBOSE']
|
|
|
|
@dhcp.start
|
|
|
|
add_socket(@dhcp.socket)
|
|
|
|
@dhcp
|
|
|
|
end
|
|
|
|
|
|
|
|
def stop_service
|
|
|
|
print_status("Stopping DHCP server") if datastore['VERBOSE']
|
|
|
|
@dhcp.stop
|
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor :dhcp
|
2010-08-06 17:37:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|