Skip to content

Commit cda102f

Browse files
committed
Land rapid7#5977, Ignore SMB exceptions during fingerprinting
2 parents 8ffcdbb + 713ded7 commit cda102f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,14 @@ def smb_fingerprint
327327
# Connect to the server if needed
328328
if not self.simple
329329
connect()
330-
smb_login()
330+
# The login method can throw any number of exceptions, we don't
331+
# care since we still get the native_lm/native_os.
332+
begin
333+
smb_login()
334+
rescue ::Rex::Proto::SMB::Exceptions::NoReply,
335+
::Rex::Proto::SMB::Exceptions::ErrorCode,
336+
::Rex::Proto::SMB::Exceptions::LoginError
337+
end
331338
end
332339

333340
fprint['native_os'] = smb_peer_os()

0 commit comments

Comments
 (0)