Skip to content

Commit a781480

Browse files
committed
Add error handling to get_once
And check for specific ack result/reason for 32-bit.
1 parent 6e253a5 commit a781480

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

modules/exploits/windows/smb/ms17_010_eternalblue.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,14 @@ def verify_arch
269269
)
270270

271271
sock.put(pkt)
272-
res = sock.get_once
272+
273+
begin
274+
res = sock.get_once(60)
275+
rescue EOFError
276+
print_error('DCE/RPC socket returned EOFError')
277+
return false
278+
end
279+
273280
disconnect(sock)
274281

275282
begin
@@ -287,7 +294,8 @@ def verify_arch
287294
end
288295
when ARCH_X86
289296
# Ack result: Provider rejection (2)
290-
if resp.ack_result.first != 0
297+
# Ack reason: Proposed transfer syntaxes not supported (2)
298+
if resp.ack_result.first == 2 && resp.ack_reason.first == 2
291299
ret = true
292300
end
293301
end

0 commit comments

Comments
 (0)