-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix .rex_getaddrinfo inconsistencies #67
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zeroSteiner
force-pushed
the
fix/rex-getaddresses
branch
from
November 19, 2024 21:07
aa89d90
to
bb78db2
Compare
adfoster-r7
approved these changes
Nov 20, 2024
adfoster-r7
reviewed
Nov 20, 2024
Rebasing on master should fix the hanging builds, fixed by #68 |
Remove ::Net::DNS because it can be replaced by Dnsruby instead since we just need the constants. Use Dnsruby because it's a public gem whereas ::Net::DNS is currently a vendored hack used by Metasploit. One DNS library to rule them all.
This makes the implementation more consistent with Addrinfo.getaddrinfo.
zeroSteiner
force-pushed
the
fix/rex-getaddresses
branch
from
November 20, 2024 14:54
d85caca
to
0d649c2
Compare
I just noticed that
|
Alright this should be ready to go now. I added normal IP address support in the last commit along with tests for it. |
adfoster-r7
approved these changes
Nov 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
.rex_getaddrinfo
method behaves inconsistently withAddrinfo.getaddrinfo
, which makes.getaddresses
inconsistent depending on if a resolver is present or not. When no resolver is present, a numeric address (either decimal or hex, not binary or octal) is specified, it's converted to an IPv4 address:But when a resolver is present,
.getaddresses
will call.rex_getaddrinfo
and it falls with a resolution error because the address is not a valid hostname:This came up as an issue that prevents Metasploit's route command from working when invoked as
route add 0 0 -1
to add a default route for all IPv4 addresses through the most recent session when the DNS feature is enabled. This also removes references to::Net::DNS
in favor of using the constants fromDnsruby::Types
instead, which was already referenced but not defined as a requirement. Adding Dnsruby as a requirement was needed to make the tests work.