File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
lib/metasploit/framework/login_scanner
spec/support/shared/examples/metasploit/framework/login_scanner Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,15 @@ def each_cred_adjusted_for_realm(credential)
101
101
yield credential
102
102
elsif credential . realm . present? && self . class ::REALM_KEY . blank?
103
103
second_cred = credential . dup
104
+ # Strip the realm off here, as we don't want it
105
+ credential . realm = nil
106
+ credential . realm_key = nil
104
107
yield credential
105
108
# Some services can take a domain in the username like this even though
106
109
# they do not explicitly take a domain as part of the protocol.
107
110
second_cred . public = "#{ second_cred . realm } \\ #{ second_cred . public } "
111
+ second_cred . realm = nil
112
+ second_cred . realm_key = nil
108
113
yield second_cred
109
114
else
110
115
yield credential
Original file line number Diff line number Diff line change 325
325
context 'when login_scanner has no REALM_KEY' do
326
326
context 'when the credential has a realm' do
327
327
it 'yields the original credential as well as one with the realm in the public' do
328
- second_cred = ad_cred . dup
328
+ first_cred = ad_cred . dup
329
+ first_cred . realm = nil
330
+ first_cred . realm_key = nil
331
+ second_cred = first_cred . dup
329
332
second_cred . public = "#{ realm } \\ #{ public } "
330
333
expect { |b | login_scanner . each_cred_adjusted_for_realm ( ad_cred , &b ) } . to yield_successive_args ( ad_cred , second_cred )
331
334
end
You can’t perform that action at this time.
0 commit comments