Add a test login scanner and fix ANONYMOUS_LOGIN #20535
Open
+73
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes two changes, one in each commit.
New Module: auxiliary/test/login
This is a new testing module that can be used to see how the datastore options adjust the login scanner behavior. It's effectively a dummy module. I forget why I originally wrote it but it came in handy again while testing #19653 so it seemed helpful to share it for future testing. The credential collection logic can be a bit complicated and this makes it easy to see exactly what's happening. Which leads to the second change...
Fixed The ANONYMOUS_LOGIN option
The
ANONYMOUS_LOGIN
datastore option was not being passed to the credential collection from theAuthBrute
mixin, meaning that users could set the option but then it wouldn't do anything. This bug has now been fixed and is a great use case for the new testing module because you can simply toggle it and see the differences.Verification
List the steps needed to make sure this thing works
msfconsole
loadpath test/modules
use auxiliary/test/login
ANONYMOUS_LOGIN
to true, see that it starts with an attempt to login with a blank username and passwordANONYMOUS_LOGIN
to false, see that it does not start with an attempt to login with a blank username and passwordDemo Output