Skip to content

Commit cd858a1

Browse files
committed
Add DETECT_ANY_AUTH to make bogus login optional
1 parent 03e14ec commit cd858a1

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

modules/auxiliary/scanner/smb/smb_login.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def initialize
5656
[
5757
Opt::Proxies,
5858
OptBool.new('PRESERVE_DOMAINS', [ false, "Respect a username that contains a domain name.", true ]),
59-
OptBool.new('RECORD_GUEST', [ false, "Record guest-privileged random logins to the database", false ])
59+
OptBool.new('RECORD_GUEST', [ false, "Record guest-privileged random logins to the database", false ]),
60+
OptBool.new('DETECT_ANY_AUTH', [false, 'Enable detection of systems accepting any authentication', true])
6061
], self.class)
6162

6263
end
@@ -87,13 +88,17 @@ def run_host(ip)
8788
send_spn: datastore['NTLM::SendSPN'],
8889
)
8990

90-
bogus_result = @scanner.attempt_bogus_login(domain)
91-
if bogus_result.success?
92-
if bogus_result.access_level == Metasploit::Framework::LoginScanner::SMB::AccessLevels::GUEST
93-
print_status("This system allows guest sessions with any credentials")
91+
if datastore['DETECT_ANY_AUTH']
92+
bogus_result = @scanner.attempt_bogus_login(domain)
93+
if bogus_result.success?
94+
if bogus_result.access_level == Metasploit::Framework::LoginScanner::SMB::AccessLevels::GUEST
95+
print_status("This system allows guest sessions with any credentials")
96+
else
97+
print_error("This system accepts authentication with any credentials, brute force is ineffective.")
98+
return
99+
end
94100
else
95-
print_error("This system accepts authentication with any credentials, brute force is ineffective.")
96-
return
101+
vprint_status('This system does not accept authentication with any credentials, proceeding with brute force')
97102
end
98103
end
99104

0 commit comments

Comments
 (0)