Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves UX for scanner/login modules #19199

Merged

Conversation

cgranleese-r7
Copy link
Contributor

@cgranleese-r7 cgranleese-r7 commented May 23, 2024

This PR adds support for a summarised output to the end of login/scanner modules within Framework. The idea was that some scanners are either way to quite or way too noisy. So this implementation aims to add a module option that will be enabled by default but is configurable by the user, which will dictate if the table will be output or not.

Example output

image

When targeting a single host, the scanner is too quiet. Logic was added to check for when a single user is passed and change to verbose mode.

Verification

  • Start msfconsole
  • Use a login module
  • Test against a single host
  • Test against multiple hosts
  • Verify the table is output by default
  • Verify the table is not output when ShowSuccessLogins is set to false
  • Verify the module outputs the verbose output when ran against a single host

@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch from 962c015 to 6dd306e Compare May 23, 2024 15:17
@cgranleese-r7 cgranleese-r7 added enhancement rn-enhancement release notes enhancement labels May 23, 2024
@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch 2 times, most recently from a067770 to 7eb4ca6 Compare May 31, 2024 10:21
@cgranleese-r7 cgranleese-r7 changed the title Improves UX for scanner/login modules <DRAFT> Improves UX for scanner/login modules May 31, 2024
@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch 2 times, most recently from 724f388 to c50d559 Compare May 31, 2024 10:56
@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch 3 times, most recently from fbe5f90 to ede2d6b Compare May 31, 2024 11:38
@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch from ede2d6b to 0853965 Compare May 31, 2024 12:16
@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch 2 times, most recently from a44091c to d733f9d Compare May 31, 2024 15:04
@report = {}
@report.extend(::Rex::Ref)
rhost_walker = Msf::RhostsWalker.new(datastore['RHOSTS'], datastore).to_enum
conditional_verbose_output(rhost_walker.count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker; This might still need opt out functionality, were folk do want a quiet scanner still for 1 target

@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch from d733f9d to 97bfdc4 Compare May 31, 2024 15:46
logins = report.flat_map { |_k, v| v[:successful_logins] }.compact
sessions = report.flat_map { |_k, v| v[:successful_sessions] }.compact

print_status("Bruteforce completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be used in contexts that aren't related to bruteforcing anything; so maybe we need to use different terminology here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went with scan, let me know if that works, or if you had something else in mind.

Suggested change
print_status("Bruteforce completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.")
print_status("Scan completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.")

@adfoster-r7
Copy link
Contributor

Just to make testing easier, can we grab in this commit into this PR? #19220

@cgranleese-r7 cgranleese-r7 force-pushed the improves-ux-for-scanner-modules branch from 97bfdc4 to 48f89a2 Compare June 3, 2024 09:57
@cgranleese-r7 cgranleese-r7 changed the title <DRAFT> Improves UX for scanner/login modules Improves UX for scanner/login modules Jun 3, 2024
@cgranleese-r7 cgranleese-r7 marked this pull request as ready for review June 3, 2024 10:02
@adfoster-r7 adfoster-r7 merged commit bf17764 into rapid7:master Jun 6, 2024
54 checks passed
@adfoster-r7
Copy link
Contributor

Release Notes

Updates brute force modules to output a summary of the credential discovered. This functionality is currently opt-in with the feature set show_successful_logins true msfconsole command

@cgranleese-r7 cgranleese-r7 deleted the improves-ux-for-scanner-modules branch June 6, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement rn-enhancement release notes enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants