Skip to content

Commit afef194

Browse files
author
zerosum0x0
committed
catch exception for patched Vista
1 parent 469209a commit afef194

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/msf/core/exploit/smb/client/psexec_ms17_010.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def exploit_matched_pairs(pipe_handle)
358358
begin
359359
leak_frag_size(pipe_handle.file_id)
360360
rescue TypeError => e
361-
raise MS17_010_Error 'TypeError leaking initial Frag size, is the target patched?'
361+
raise MS17_010_Error, 'TypeError leaking initial Frag size, is the target patched?'
362362
end
363363

364364
# we have all info for offsets now
@@ -604,7 +604,11 @@ def exploit_fish_barrel(pipe_handle)
604604

605605
if @ctx['os'] == 'WIN7' and !(@ctx.key? 'arch')
606606
# leak_frag_size() can be used against Windows Vista/2008 to determine target architecture
607-
leak_frag_size(pipe_handle.file_id)
607+
begin
608+
leak_frag_size(pipe_handle.file_id)
609+
rescue Timeout::Error
610+
raise MS17_010_Error, 'Timeout::Error leaking initial Frag size, is the target patched?'
611+
end
608612
end
609613

610614
attempt_list = []

0 commit comments

Comments
 (0)