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

Adds support for searching by session types #18887

Conversation

cgranleese-r7
Copy link
Contributor

This PR adds support to the existing search command functionality to now also search by session type.

The idea is to allow users to search by a specific session type and then a list of modules that support that session type will be output.

image

Tests were also updated for the new search functionality.

Note

This PR also adds support to the help command within sessions (MySQL, MSSQL, PostgreSQL and SMB) to now return a list off modules the current session type is compatible with.
Meterpreter was excluded from this, as it's list would be much too long for this to work.

image

Verification

List the steps needed to make sure this thing works

  • Start msfconsole
  • Test the new search functionality - search session_type:MySQL
  • Repeat for each session type - MSSQL/SMB/PostgreSQL/Meterpreter/shell
  • Get a session for each session type and verify that the help command now returns a list of compatible modules for MSSQL/SMB/PostgreSQL/MySQL
  • Verify that Meterpreter and shell session still function as expected and don't return a list of compatible modules

@cgranleese-r7 cgranleese-r7 added the rn-enhancement release notes enhancement label Feb 26, 2024
lib/rex/ui/text/dispatcher_shell.rb Outdated Show resolved Hide resolved
lib/rex/ui/text/dispatcher_shell.rb Outdated Show resolved Hide resolved
@@ -399,6 +399,7 @@ def cmd_search_help
'rank' => 'Modules with a matching rank (Can be descriptive (ex: \'good\') or numeric with comparison operators (ex: \'gte400\'))',
'ref' => 'Modules with a matching ref',
'reference' => 'Modules with a matching reference',
'session_type' => 'Modules with a matching session type (SMB, MySQL, Meterpreter, etc)',
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; SMB, MySQL, PostgresQL probably should be behind a feature flag in the help message here

lib/rex/ui/text/dispatcher_shell.rb Outdated Show resolved Hide resolved
@cgranleese-r7 cgranleese-r7 force-pushed the add-support-for-searching-by-session-type branch 3 times, most recently from d16a308 to 8be0a27 Compare February 27, 2024 15:33
@cgranleese-r7 cgranleese-r7 force-pushed the add-support-for-searching-by-session-type branch 3 times, most recently from 71a65df to b1d7110 Compare February 28, 2024 13:02
@cgranleese-r7 cgranleese-r7 force-pushed the add-support-for-searching-by-session-type branch 4 times, most recently from e7ef814 to 7e0ce35 Compare February 29, 2024 09:40
@cgranleese-r7 cgranleese-r7 force-pushed the add-support-for-searching-by-session-type branch 2 times, most recently from 007d314 to da17cf1 Compare February 29, 2024 11:49
@cgranleese-r7 cgranleese-r7 force-pushed the add-support-for-searching-by-session-type branch from da17cf1 to 0c1bcbf Compare February 29, 2024 15:15
@adfoster-r7 adfoster-r7 merged commit d10909c into rapid7:master Feb 29, 2024
48 checks passed
@adfoster-r7
Copy link
Contributor

adfoster-r7 commented Feb 29, 2024

Release Notes

Updates the search command to now search modules that are compatible with a specified session type, for instance: search session_type:meterpreter or search session_type:smb

@cgranleese-r7 cgranleese-r7 deleted the add-support-for-searching-by-session-type branch March 1, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-enhancement release notes enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants