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 deregistering an option by alias #11393

Merged
merged 1 commit into from Feb 20, 2019

Conversation

busterb
Copy link
Member

@busterb busterb commented Feb 13, 2019

Rather than having to 'unregister' both 'RHOST' and 'RHOSTS' for modules using a network-connecting mixin, but that only target a fixed resource, this allows just unregistering one option by exposing the alias key lookup to the module options library and allowing it to remove the datastore options for the module from validation.

Noted while testing #11108 that the module's unregister options were incomplete, and there were a few more like it. This allows modules operating in this style to work without modifications.

Verification

List the steps needed to make sure this thing works

  • Start msfconsole
  • use auxiliary/gather/shodan_search
  • run
  • Verify the module works, or at least only complains about relevant options:
msf5 auxiliary(gather/shodan_search) > run
[-] Auxiliary failed: Msf::OptionValidateError The following options failed to validate: SHODAN_APIKEY, QUERY.

Rather than having to 'unregister' both 'RHOST' and 'RHOSTS' for modules using a network-connecting mixin, this allows just unregistering one option by exposing the alias key lookup to the module options library and allowing it to remove the datastore options for the module from validation.

Noted while testing rapid7#11108 that the module's unregister options were incomplete, and there were a few more like it. This allows modules operating in this style to work without modifications.
@busterb busterb self-assigned this Feb 19, 2019
@busterb busterb merged commit 16e800a into rapid7:master Feb 20, 2019
busterb added a commit that referenced this pull request Feb 20, 2019
@busterb
Copy link
Member Author

busterb commented Feb 20, 2019

Release Notes

This updates module option deregistration to work with both newer and older option names, namely allowing for backward compatibility with a module that wants to unregister 'RHOST' or 'RHOSTS'.

msjenkins-r7 pushed a commit that referenced this pull request Feb 20, 2019
@gdavidson-r7 gdavidson-r7 added the rn-enhancement release notes enhancement label Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants