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

Allows use of type:aux in search #12998

Merged
merged 1 commit into from Mar 2, 2020
Merged

Conversation

@adamgalway-r7
Copy link
Contributor

adamgalway-r7 commented Feb 26, 2020

Small change to allow users to use type:aux in place of type:auxiliary. String comparison and substitution are performed once when search is called then passed to modules/metadata/search.rb as normal.

Verification

List the steps needed to make sure this thing works

  • Start msfconsole
  • search type:aux
  • Verify error is not returned and all auxiliary modules are displayed
@@ -470,6 +477,11 @@ def parse_search_string(search_string)
next if search_term.length == 0
keyword.downcase!
search_term.downcase!

if keyword == "type"
search_term = MODULE_TYPE_SHORTHANDS[search_term] if MODULE_TYPE_SHORTHANDS.key?(search_term)

This comment has been minimized.

Copy link
@adfoster-r7

adfoster-r7 Feb 26, 2020

Contributor

This might be cleaner, or harder to read:

search_term = MODULE_TYPE_SHORTHANDS.fetch(search_term, search_term)

Docs for fetch: https://apidock.com/ruby/Hash/fetch

This comment has been minimized.

Copy link
@adamgalway-r7

adamgalway-r7 Feb 26, 2020

Author Contributor

It's not immediately clear with fetch what's happening, .key? may be wordier but it's easier to understand IMO

@wvu-r7 wvu-r7 assigned wvu-r7 and unassigned wvu-r7 Feb 26, 2020
@dwelch-r7 dwelch-r7 self-assigned this Mar 2, 2020
@dwelch-r7 dwelch-r7 merged commit 26c529b into rapid7:master Mar 2, 2020
3 checks passed
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
@dwelch-r7

This comment has been minimized.

Copy link
Contributor

dwelch-r7 commented Mar 2, 2020

Release Notes

Allows users to say either type:aux or type:auxiliary when searching for auxiliary modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.