Fix warning placement to be more helpful

bug/bundler_fix
William Vu 2017-05-30 12:16:14 -05:00
parent beb1cef835
commit 890d35cc30
1 changed files with 14 additions and 25 deletions

View File

@ -153,11 +153,22 @@ class MetasploitModule < Msf::Exploit::Remote
client, tree, sock, os = smb1_anonymous_connect_ipc()
print_good("Connection established for exploitation.")
if !verify_target(os)
if verify_target(os)
print_good('Target OS selected valid for OS indicated by SMB reply')
else
print_warning('Target OS selected not valid for OS indicated by SMB reply')
print_warning('Disable VerifyTarget option to proceed manually...')
raise EternalBlueError, 'Unable to continue with improper OS Target.'
end
if !verify_arch
# cool buffer print no matter what, will be helpful when people post debug issues
print_core_buffer(os)
if verify_arch
print_good('Target arch selected valid for OS indicated by DCE/RPC reply')
else
print_warning('Target arch selected not valid for OS indicated by DCE/RPC reply')
print_warning('Disable VerifyArch option to proceed manually...')
raise EternalBlueError, 'Unable to continue with improper OS Arch.'
end
@ -234,18 +245,8 @@ class MetasploitModule < Msf::Exploit::Remote
break
end
end
if ret
print_good('Target OS selected valid for OS indicated by SMB reply')
else
print_warning('Target OS selected not valid for OS indicated by SMB reply')
print_warning('Disable VerifyTarget option to proceed manually...')
end
end
# cool buffer print no matter what, will be helpful when people post debug issues
print_core_buffer(os)
return ret
end
@ -268,13 +269,8 @@ class MetasploitModule < Msf::Exploit::Remote
'RHOST' => rhost,
'RPORT' => 135
)
rescue ::Errno::ECONNRESET,
::Rex::HostUnreachable,
::Rex::ConnectionTimeout,
::Rex::ConnectionRefused => e
rescue Rex::ConnectionError => e
print_error(e.to_s)
print_warning('Target arch not detected for target OS')
print_warning('Disable VerifyArch option to proceed manually...')
return false
end
@ -310,13 +306,6 @@ class MetasploitModule < Msf::Exploit::Remote
end
end
if ret
print_good('Target arch selected valid for OS indicated by DCE/RPC reply')
else
print_warning('Target arch selected not valid for OS indicated by DCE/RPC reply')
print_warning('Disable VerifyArch option to proceed manually...')
end
ret
end