Skip to content

Commit 7e05ff3

Browse files
committed
Fix smbdirect
Also some whitespace and a typo in output message
1 parent a21752b commit 7e05ff3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/auxiliary/scanner/smb/smb_version.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def initialize
3434
)
3535

3636
deregister_options('RPORT')
37+
deregister_options('SMBDIRECT')
3738
@smb_port = 445
3839
end
3940

@@ -42,7 +43,7 @@ def rport
4243
end
4344

4445
def smb_direct
45-
@smbdirect || datastore['SMBDirect']
46+
(@smb_port == 445)
4647
end
4748

4849
# Fingerprint a single host
@@ -55,10 +56,10 @@ def run_host(ip)
5556

5657
begin
5758
res = smb_fingerprint()
58-
59+
5960
#
6061
# Create the note hash for smb.fingerprint
61-
#
62+
#
6263
conf = {
6364
:native_os => res['native_os'],
6465
:native_lm => res['native_lm']
@@ -82,7 +83,7 @@ def run_host(ip)
8283
match_conf['os.edition'] = res['edition']
8384
end
8485

85-
if res['sp'].to_s.length > 0
86+
if res['sp'].to_s.length > 0
8687
desc << " #{res['sp'].downcase.gsub('service pack ', 'SP')}"
8788
conf[:os_sp] = res['sp']
8889
match_conf['os.version'] = res['sp']
@@ -95,7 +96,7 @@ def run_host(ip)
9596
end
9697

9798
if res['lang'].to_s.length > 0 and res['lang'] != 'Unknown'
98-
desc << " (language:#{res['lang']}"
99+
desc << " (language:#{res['lang']})"
99100
conf[:os_lang] = res['lang']
100101
match_conf['os.language'] = conf[:os_lang]
101102
end
@@ -130,7 +131,7 @@ def run_host(ip)
130131
:port => rport,
131132
:proto => 'tcp',
132133
:ntype => 'fingerprint.match',
133-
:data => match_conf
134+
:data => match_conf
134135
)
135136
else
136137
desc = "#{res['native_os']} (#{res['native_lm']})"

0 commit comments

Comments
 (0)