Skip to content

Commit 8afb774

Browse files
committed
Land rapid7#8822, optional DOPU check for smb_ms17_010
2 parents be926e1 + ecfe3d0 commit 8afb774

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

modules/auxiliary/scanner/smb/smb_ms17_010.rb

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ def initialize(info = {})
4747
],
4848
'License' => MSF_LICENSE
4949
))
50+
51+
register_options(
52+
[
53+
OptBool.new('CHECK_DOPU', [true, 'Check for DOUBLEPULSAR on vulnerable hosts', true])
54+
])
5055
end
5156

5257
# algorithm to calculate the XOR Key for DoublePulsar knocks
@@ -80,18 +85,20 @@ def run_host(ip)
8085
)
8186

8287
# vulnerable to MS17-010, check for DoublePulsar infection
83-
code, signature1, signature2 = do_smb_doublepulsar_probe(tree_id)
84-
85-
if code == 0x51
86-
xor_key = calculate_doublepulsar_xor_key(signature1).to_s(16).upcase
87-
arch = calculate_doublepulsar_arch(signature2)
88-
print_warning("Host is likely INFECTED with DoublePulsar! - Arch: #{arch}, XOR Key: 0x#{xor_key}")
89-
report_vuln(
90-
host: ip,
91-
name: "MS17-010 DoublePulsar Infection",
92-
refs: self.references,
93-
info: "MultiPlexID += 0x10 on Trans2 request - Arch: #{arch}, XOR Key: 0x#{xor_key}"
94-
)
88+
if datastore['CHECK_DOPU']
89+
code, signature1, signature2 = do_smb_doublepulsar_probe(tree_id)
90+
91+
if code == 0x51
92+
xor_key = calculate_doublepulsar_xor_key(signature1).to_s(16).upcase
93+
arch = calculate_doublepulsar_arch(signature2)
94+
print_warning("Host is likely INFECTED with DoublePulsar! - Arch: #{arch}, XOR Key: 0x#{xor_key}")
95+
report_vuln(
96+
host: ip,
97+
name: "MS17-010 DoublePulsar Infection",
98+
refs: self.references,
99+
info: "MultiPlexID += 0x10 on Trans2 request - Arch: #{arch}, XOR Key: 0x#{xor_key}"
100+
)
101+
end
95102
end
96103
elsif status == "STATUS_ACCESS_DENIED" or status == "STATUS_INVALID_HANDLE"
97104
# STATUS_ACCESS_DENIED (Windows 10) and STATUS_INVALID_HANDLE (others)

0 commit comments

Comments
 (0)