diff --git a/modules/exploits/windows/smb/ms17_010_eternalblue.rb b/modules/exploits/windows/smb/ms17_010_eternalblue.rb index f7d3c7bf96..31e4970250 100644 --- a/modules/exploits/windows/smb/ms17_010_eternalblue.rb +++ b/modules/exploits/windows/smb/ms17_010_eternalblue.rb @@ -164,6 +164,10 @@ class MetasploitModule < Msf::Exploit::Remote # Step 1: Connect to IPC$ share print_status("Connecting to target for exploitation.") client, tree, sock, os = smb1_anonymous_connect_ipc() + rescue RubySMB::Error::CommunicationError + # Error handler in case SMBv1 disabled on target + raise EternalBlueError, 'Could not make SMBv1 connection' + else print_good("Connection established for exploitation.") if verify_target(os)