1

How to use nmap and dns resolution of nmap over proxy?

I tried proxychains, but for dns resolution it doesn't work, it's known bug as I read on some forums. It works well without dns_proxy feature in proxychains config. But I need to proxy dns resolution requests.

sudo proxychains nmap -T4 -sV -Pn -A --reason -v scanme.nmap.org

I tried proxychains4 (or proxychains-ng), but with nmap it does scanning and send all the packets synchronously, so for example for scan of one host it's needed to wait for 30 min or ever longer. So it's not the option, but it works well.

sudo proxychains4 nmap -T4 -sV -Pn -A --reason -v scanme.nmap.org

I tried just like this with inside nmap proxy function:

sudo nmap --proxy socks4://127.0.0.1:9050 -T4 -sV -Pn -A --reason -v scanme.nmap.org

But does it dns resolution requests over the tor proxy 127.0.0.1:9050 or only scan? It seems it doesn't.

What is the solution?

0

Try:

sudo nmap --proxy socks4://127.0.0.1:9050 --dns-servers 8.8.8.8 -T4 -sV -Pn -A --reason -v scanme.nmap.org

You can specify the domain name to use by nmap using the option --dns-servers. The problem here is that the default DNS server is your router which will have a private address , so your DNS server is hidden from the internet . By using --dns-servers I just tell the command nmap to use the Google's public domain name. (private addresses like 192.168.1.0/24 are not routable.)

  • You can specify the domain name to use by nmap using the option --dns-servers . The probleme here is that the default DNS server is your router witch will have a private address , so your DNS server is hidden from the internet . by using --dsn-servers I just tell the commande nmap to use the google's public domain name. (private address like 192.168.1.0/24 are not routable) – Salaheddine Oct 10 '17 at 23:25
  • I've copied your comment back in to the Answer so it's easy for people to read. Now we can both delete our comments and the Answer stands tall by itself. – roaima Oct 11 '17 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.