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

Implement module use by previous search index #11819

Merged
merged 5 commits into from May 14, 2019

Conversation

Projects
None yet
3 participants
@wvu-r7
Copy link
Contributor

commented May 7, 2019

I got tired of typing, copying, or tab-completing a module name I wanted to use.

I know we discussed the possibility of tutorials copying an index without context, but I feel like the convenience of this enhancement outweighs that PEBKAC. I've tailored the new help output to be considerate of that.

Thoughts?

msf5 > help use
Usage: use <name|term|index>

Interact with a module by name or search term/index.
If a module name is not found, it will be treated as a search term.
An index from the previous search results can be selected if desired.

Examples:
  use exploit/windows/smb/ms17_010_eternalblue

  use eternalblue
  use <name|index>

  search eternalblue
  use <name|index>

msf5 > use eternalblue

Matching Modules
================

   #  Name                                           Disclosure Date  Rank     Check  Description
   -  ----                                           ---------------  ----     -----  -----------
   0  auxiliary/admin/smb/ms17_010_command           2017-03-14       normal   Yes    MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Command Execution
   1  auxiliary/scanner/smb/smb_ms17_010                              normal   Yes    MS17-010 SMB RCE Detection
   2  exploit/windows/smb/ms17_010_eternalblue       2017-03-14       average  No     MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
   3  exploit/windows/smb/ms17_010_eternalblue_win8  2017-03-14       average  No     MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+
   4  exploit/windows/smb/ms17_010_psexec            2017-03-14       normal   No     MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution


msf5 > use 2
msf5 exploit(windows/smb/ms17_010_eternalblue) >

#11652, #11724

@h00die

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

I won't be available to look at this for 2 weeks, so don't let me hold this up!

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

@msjenkins-r7 test this please.

@jmartin-r7
Copy link
Contributor

left a comment

More strict error checking preferred, can deal with as is too.

Show resolved Hide resolved lib/msf/ui/console/command_dispatcher/modules.rb Outdated

wvu-r7 added some commits May 13, 2019

@wvu-r7 wvu-r7 force-pushed the wvu-r7:feature/use branch 3 times, most recently from c74c1c8 to db53d00 May 13, 2019

@wvu-r7 wvu-r7 force-pushed the wvu-r7:feature/use branch from db53d00 to 6ea1e7a May 13, 2019

@jmartin-r7 jmartin-r7 self-assigned this May 13, 2019

@jmartin-r7 jmartin-r7 merged commit 7aed55b into rapid7:master May 14, 2019

3 checks passed

Metasploit Automation - Sanity Test Execution Successfully completed all tests.
Details
Metasploit Automation - Test Execution Successfully completed all tests.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jmartin-r7 added a commit that referenced this pull request May 14, 2019

@wvu-r7

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

Thank you, @jmartin-r7!

@wvu-r7 wvu-r7 deleted the wvu-r7:feature/use branch May 14, 2019

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

commented May 14, 2019

Release Notes

Result index for a module in the most recent search can be referenced when calling use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.