Skip to content

Commit 52b81f3

Browse files
committed
Land rapid7#7238, Add DETECT_ANY_AUTH to smb_login
2 parents 5c447a6 + 1a22ac0 commit 52b81f3

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

documentation/modules/auxiliary/scanner/smb/smb_login.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,12 @@ set SMBPass [password]
115115

116116
Note: If an account has been successfully brute-forced, that account will not be tried again.
117117

118+
Additionally, if you wish to disable automatic detection of all-access systems, you can change the following option:
119+
120+
**The DETECT_ANY_AUTH option**
121+
122+
This option enables detection of systems accepting any authentication. A bogus login will be attempted.
123+
124+
```
125+
set DETECT_ANY_AUTH false
126+
```

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)