Adds mixin to support resolving IPs across different session types #18500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR builds on a previous PR, specifically this comment thread.
This new mixin allows for DNS resolution for modules with multiple session types. E.g.
modules/post/windows/gather/enum_computers.rb
supports multiple sessions:However the resolution across these session requires different logic. Meterpreter will now make use of the new Meterpreter API changes that will NEED to be landed before this PR can land.
metasploit-payloads PR - rapid7/metasploit-payloads#681
metasploit-framework PR - #18499
The mixin will check if we have a Meterpreter session with access to the
net
library and use the new Meterpreter API if so, otherwise fallback tonslookup
if not.Note
A rescue was added to the
enum_computers
module to allow for instances when the DNS isn't able to be resolved via the meterpreter API. This is due to inconsistent resolving methods in the runtime languages.With no errors
With every entry returning an error
Mixed results
Verification
List the steps needed to make sure this thing works
msfconsole
use post/windows/gather/enum_computers.rb
Example: