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 unknown command handling #18806

Merged

Conversation

cgranleese-r7
Copy link
Contributor

@cgranleese-r7 cgranleese-r7 commented Feb 8, 2024

This PR improves the handling of unknown commands within console. Additionally this works for Meterpreter and the new session types - MySQL/PostgreSQL/MSSQL/SMB.

Currently when users get a command wrong, they are given the following error:

Unknown command: reloa

We now tell users to use the help command, and also suggest a potentially close match if one exists.

Scenario when we have a suggestion:

Unknown command: reloa. Did you mean reload? Run the help command for more details.

Scenario when we do not have a suggestion:

Unknown command: foo. Run the help command for more details.

Example:
Console top level:
image

Meterpreter:
image

SMB session type:
image

Verification

  • Start msfconsole
  • Run the help command.
  • Verify that commands listed in the help command work with the new command handling
  • Verify that the expected output is returned when there is a suggestion present as well as not
  • Verify this also works within Meterpreter and the new session types. Use the help command to see what commands can be ran

@cgranleese-r7 cgranleese-r7 added enhancement rn-enhancement release notes enhancement labels Feb 8, 2024
@cgranleese-r7 cgranleese-r7 changed the title Improves unknown command handling <DRAFT> Improves unknown command handling Feb 9, 2024
@cgranleese-r7 cgranleese-r7 added the blocked Blocked by one or more additional tasks label Feb 9, 2024
@cgranleese-r7 cgranleese-r7 marked this pull request as draft February 9, 2024 11:01
@cgranleese-r7 cgranleese-r7 changed the title <DRAFT> Improves unknown command handling Improves unknown command handling Feb 12, 2024
@cgranleese-r7 cgranleese-r7 removed the blocked Blocked by one or more additional tasks label Feb 12, 2024
@cgranleese-r7 cgranleese-r7 marked this pull request as ready for review February 12, 2024 11:48
@dwelch-r7 dwelch-r7 self-assigned this Feb 12, 2024
@dwelch-r7 dwelch-r7 merged commit 8106dbe into rapid7:master Feb 12, 2024
34 of 35 checks passed
@dwelch-r7
Copy link
Contributor

Release Notes

Improves unknown command handling by suggesting similar valid commands

@cgranleese-r7 cgranleese-r7 deleted the improve-unknown-command-handling branch February 12, 2024 17:01
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

3 participants