-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
SOCKS Proxy is not used for rhost's set to hostnames #19641
Comments
I know this is a draft PR but I went ahead and tested it out as I'm hitting this condition this week. The DNS resolution does in fact get skipped during the validation of the options provided. I do not see the DNS query at the proxy level at all so it seems like its getting skipped entirely and not deferred to the proxy. I'm using a SSH tunnel(unknown if full SOCKS5 was implemented) so I checked with the socks server linked above and I don't see the DNS request with that either. I also tried wrapping proxychains around msfconsole since that worked prior to the DNS resolution system for getting module traffic through a SOCKS proxy but that failed as well. I looped over all the hosts I needed to connect to and then add static-entries for the hosts in the meantime. |
@blurbdust What are the exact replication steps for the scenario(s) that you're running through? What is currently happening, and what would you expect to have happen 👀 |
Thanks! I'm not at a computer to verify things at the minute - but does running the code from this branch #19683 work for you? If setting the global datastore |
Thanks! I'm think we'd probably want to update Metasploit to support having support differentiating between Test SetupRun locally - create socks proxy:
Run on remote host - set up remote dns entry and server:
Examples
This would align with curl's behavior
|
I just wanted to chime in regarding:
That's correct, there's two ways to use the DNS through proxychains like it used to work since Metasploit 6.4 was released.
proxychains uses a hook on the libc function calls that handle the resolution. Metasploit 6.4 doesn't use those when the DNS feature is available since it handles it itself but using the "system" resolver will force it back to the libc function call, relying on the host OS's support which proxychains will have hooked. |
Steps to reproduce
How'd you do it?
use ldap_query
set rhosts hostname.local
setg proxies socks5:127.0.0.1:1080
set rhosts 8.8.8.8
Were you following a specific guide/tutorial or reading documentation?
No
Expected behavior
We should see a request to the SOCKS5 proxy with the address type set to
3
.For example here's rhost set to
8.8.8.8
Current behavior
We see no request to the SOCKS5 proxy.
Metasploit version
The text was updated successfully, but these errors were encountered: