-
Notifications
You must be signed in to change notification settings - Fork 14.4k
RHOSTS implementation in external exploit modules inconsistent with other modules #13061
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
Comments
does this effectively break the setg option when doing an aux scan followed by exploit against multiple hosts? |
While looking into the question posed by @Stefan-mcp, I noticed an error in my submission. If you define your option in the exploit metadata as an In an auxiliary module, if you define your rhost option as
You get an option of
in the console. In an exploit module, if you define your rhost option the same way your results differ:
This behavior should be consistent across module types. If you use Using the global datastore, with the space-delimited format and the RHOSTS option type being
Adding to the issue with the inconsistency of RHOSTS in an aux module vs. an external one, if your exploit does not explicitly define the RHOSTS option (as in the To sum up:
Potential Fixes:
|
Hi! This issue has been left open with no activity for a while now. We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. |
Hi again! It’s been 60 days since anything happened on this issue, so we are going to close it. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. |
Uh oh!
There was an error while loading. Please reload this page.
Problem
MSF5 added the use of RHOSTS functionality to exploit modules, expanding upon its use in auxiliary modules.
The implementation of RHOSTS in an external exploit module is inconsistent with the way it is implemented in other modules, including external auxiliary modules, leading to confusion in module development and broken functionality within MSF.
RHOSTS in Auxiliary modules:
Implementation in module code (example taken from an external python module):
Option definition as metadata, note type and name:
'rhost': {'type': 'address', 'description': 'Target address', 'required': True, 'default': None}
Use of the rhost argument in code:
session = function_here(username, password, args['rhost'])
When multiple IPs (space-delimited or CIDR or a range) are supplied to the module within MSF as the RHOSTS option, the module processes them individually. (This behavior has been in MSF for a while)
You are also able to populate RHOSTS within MSF using the database with the -R flag. This puts the results of your database search in RHOSTS as a space-delimited list.
RHOSTS in External Exploit Modules:
Implementation in module code (example taken from an external python module):
Option definition as metadata (again note name and type):
'RHOSTS': {'type': 'AddressRange', 'description': 'Target address', 'required': True, 'default': None}'
Use of the RHOST argument in code to access just one member of the list of RHOSTS:
system = args['RHOST']
MSF requires multiple IPs in RHOSTS within an external exploit to be supplied as a comma-space-delimited list:
Anything else causes errors:
You are also unable to populate RHOSTS via the database:
Expected Behavior:
The text was updated successfully, but these errors were encountered: