Skip to content

Commit d07fe2f

Browse files
committed
Added reporting back, removed wfw dialect
1 parent 6f5eb5a commit d07fe2f

File tree

1 file changed

+15
-4
lines changed
  • modules/auxiliary/scanner/smb

1 file changed

+15
-4
lines changed

modules/auxiliary/scanner/smb/smb1.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class MetasploitModule < Msf::Auxiliary
99

1010
# Scanner mixin should be near last
1111
include Msf::Auxiliary::Scanner
12+
include Msf::Auxiliary::Report
1213

1314
# Aliases for common classes
1415
SIMPLE = Rex::Proto::SMB::SimpleClient
@@ -33,13 +34,13 @@ def run_host(ip)
3334
connect
3435

3536
# Only accept NT LM 0.12 dialect and WfW3.0
36-
dialects = ['Windows for Workgroups 3.0a', 'NT LM 0.12']
37+
dialects = ['NT LM 0.12']
3738
data = dialects.collect { |dialect| "\x02" + dialect + "\x00" }.join('')
3839

3940
pkt = Rex::Proto::SMB::Constants::SMB_NEG_PKT.make_struct
4041
pkt['Payload']['SMB'].v['Command'] = Rex::Proto::SMB::Constants::SMB_COM_NEGOTIATE
41-
pkt['Payload']['SMB'].v['Flags1'] = 0x98
42-
pkt['Payload']['SMB'].v['Flags2'] = 0xc807
42+
pkt['Payload']['SMB'].v['Flags1'] = 0x08
43+
pkt['Payload']['SMB'].v['Flags2'] = 0xc801
4344
pkt['Payload'].v['Payload'] = data
4445

4546
pkt['Payload']['SMB'].v['ProcessID'] = rand(0x10000)
@@ -48,8 +49,18 @@ def run_host(ip)
4849
sock.put(pkt.to_s)
4950
res = sock.get_once
5051
# expecting \xff instead of \xfe
51-
print_good("#{ip} supports SMBv1") if res && res.index("\xffSMB")
52+
if res && res.index("\xffSMB")
53+
print_good("#{ip} supports SMBv1 dialect.")
54+
report_note(
55+
host: ip,
56+
proto: 'tcp',
57+
sname: 'smb1',
58+
port: rport,
59+
type: "supports SMB 1"
60+
)
61+
end
5262
rescue ::Rex::ConnectionError
63+
rescue EOFError
5364
rescue Errno::ECONNRESET
5465
rescue ::Exception => e
5566
print_error("#{rhost}: #{e.class} #{e} #{e.backtrace}")

0 commit comments

Comments
 (0)