Module: Msf::Exploit::DHCPServer

Defined in:
lib/msf/core/exploit/dhcp.rb

Overview

This mixin provides a DHCPServer

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dhcpObject

Returns the value of attribute dhcp


33
34
35
# File 'lib/msf/core/exploit/dhcp.rb', line 33

def dhcp
  @dhcp
end

Instance Method Details

#initialize(info = {}) ⇒ Object


14
15
16
17
18
# File 'lib/msf/core/exploit/dhcp.rb', line 14

def initialize(info = {})
  super

  @dhcp = nil
end

#start_service(hash = {}, context = {}) ⇒ Object


20
21
22
23
24
25
26
# File 'lib/msf/core/exploit/dhcp.rb', line 20

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

#stop_serviceObject


28
29
30
31
# File 'lib/msf/core/exploit/dhcp.rb', line 28

def stop_service
  print_status("Stopping DHCP server") if datastore['VERBOSE']
  @dhcp.stop
end