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

Makes some adjustments to the favorites command #18262

Merged

Conversation

cgranleese-r7
Copy link
Contributor

@cgranleese-r7 cgranleese-r7 commented Aug 4, 2023

Closes #18219.

This PR implements some feedback gave on #18231.

It tidies up some code duplication and adds error handling for the scenario of a module is ever delete whilst in a users favorites file.

Verification

  • Start msfconsole
  • Favorite some modules - run favorite when using a module
  • Then run favorites to see the list of favorites
  • Use the index selection method to jump between modules - use 2
  • Review code changes

@sjanusz-r7
Copy link
Contributor

Works as expected 👍

msf6 payload(windows/x64/meterpreter_reverse_tcp) > favorites
[!] /Users/sjanusz/.msf4/fav_modules contains a module that can not be found - payloads/module/does/not/exist.

Favorites
=========

   #  Name                                         Disclosure Date  Rank    Check  Description
   -  ----                                         ---------------  ----    -----  -----------
   0  payload/windows/meterpreter/reverse_tcp                       normal  No     Windows Meterpreter (Reflective Injection), Reverse TCP Stager
   1  payload/windows/x64/meterpreter_reverse_tcp                   normal  No     Windows Meterpreter Shell, Reverse TCP Inline x64

Interact with a module by name or index. For example info 1, use 1 or use payload/windows/x64/meterpreter_reverse_tcp

msf6 payload(windows/x64/meterpreter_reverse_tcp) > use 0
msf6 payload(windows/meterpreter/reverse_tcp) > options

Module options (payload/windows/meterpreter/reverse_tcp):

...

View the full module info with the info, or info -d command.

msf6 payload(windows/meterpreter/reverse_tcp) > use 1
msf6 payload(windows/x64/meterpreter_reverse_tcp) > options

Module options (payload/windows/x64/meterpreter_reverse_tcp):

...

View the full module info with the info, or info -d command.

msf6 payload(windows/x64/meterpreter_reverse_tcp) > use 2
[-] Invalid module index: 2

@sjanusz-r7 sjanusz-r7 self-assigned this Sep 6, 2023
@sjanusz-r7 sjanusz-r7 merged commit fb4a718 into rapid7:master Sep 8, 2023
34 checks passed
@sjanusz-r7 sjanusz-r7 added the rn-enhancement release notes enhancement label Sep 8, 2023
@sjanusz-r7
Copy link
Contributor

Release Notes

Adds ability to select favorite modules with the use command after running show favorites, similar to the search command.

@cgranleese-r7 cgranleese-r7 deleted the adjustments-to-favorites-cmd branch September 8, 2023 10:49
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.

favorite populates use #
2 participants