2010-08-06 17:37:28 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
2010-08-14 04:58:27 +00:00
|
|
|
add_socket(@dhcp.socket)
|
2010-08-06 17:37:28 +00:00
|
|
|
@dhcp
|
|
|
|
end
|
|
|
|
|
|
|
|
def stop_service
|
|
|
|
print_status("Stopping DHCP server") if datastore['VERBOSE']
|
|
|
|
@dhcp.stop
|
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor :dhcp
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|