diff --git a/modules/exploits/windows/smb/ms17_010_eternalblue.rb b/modules/exploits/windows/smb/ms17_010_eternalblue.rb index 0244d3f272..f788d8ae6d 100644 --- a/modules/exploits/windows/smb/ms17_010_eternalblue.rb +++ b/modules/exploits/windows/smb/ms17_010_eternalblue.rb @@ -263,10 +263,20 @@ class MetasploitModule < Msf::Exploit::Remote '71710533-beba-4937-8319-b5dbef9ccc36', '1.0' ).first - sock = connect(false, - 'RHOST' => rhost, - 'RPORT' => 135 - ) + begin + sock = connect(false, + 'RHOST' => rhost, + 'RPORT' => 135 + ) + rescue ::Errno::ECONNRESET, + ::Rex::HostUnreachable, + ::Rex::ConnectionTimeout, + ::Rex::ConnectionRefused => 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 sock.put(pkt)