nmap says 0 hosts up even though I can ping

8

3

I'm running Metasploit from Win 7 x64, and I've set up my Metasploitable 2 virtual machine on VMware Player. I can ping Metasploitable's IP address from the Metasploit console, however if I use nmap it says:

Note: Host seems down. If it is really up, but blocking our ping probles, try -Pn

I try it with the -Pn switch, it says

Nmap done: 1 IP address (0 hosts up) scanned in 0.64 seconds

I've disabled my Windows firewall and I'm running Metasploit as admin. Why can't I nmap my virtual machine?

Pickle

Posted 2012-08-26T05:45:35.270

Reputation: 223

see also http://superuser.com/q/737431/4227

– AShelly – 2014-09-29T21:34:13.390

Can you add the output (sanitized if you like) of nmap --iflist and nmap --route-dst $TARGET where $TARGET is the IP of the Metasploitable VM? – bonsaiviking – 2012-08-27T02:25:08.130

I don't know what the problem was, but it's definitely an issue with Windows. I installed Metasploit on a Backtrack VM and it works fine. – Pickle – 2012-08-28T00:51:34.470

Answers

10

Using sudo often fixes it: sudo nmap [options]

Nmap needs root to construct raw packets since it doesn't rely on the system's ping binary. When Nmap is allowed this capability, a ping scan works as expected.

Protip: sudo !! repeats the last command as root (the !! stands for "last command").

Luc

Posted 2012-08-26T05:45:35.270

Reputation: 2 013

It's odd to me because without using sudo nmap can discover other systems (well ... my router, and my current laptop computer) but not my windows 10 sbc (lattepanda). – user391339 – 2018-02-09T23:00:40.693

unfortunately that did not work.... sudo nmap can't see what ping can (sierra macbook pinging a win10 lattepanda connected to same wifi router) – user391339 – 2018-02-09T23:02:59.600

1Being sudo also works on my system, however, it's problematic because I execute nmap through a PHP script which by default does not have elevated rights :-( – Eugene van der Merwe – 2013-11-17T09:34:53.760

3

If you are using an older (version 6.00 or 6.01) version of Nmap, this may be related to a known bug. Try running with --unprivileged, which will break some features of Nmap, but ought to work for port scanning. Alternatively, use the output of nmap --iflist to identify the interface name (e.g. eth1) that should be used for the scan, and pass it to Nmap with the -e flag, like so: nmap -e eth1 --other --args targets

Of course the best solution is to upgrade to an unaffected version of Nmap with the latest improvements.

bonsaiviking

Posted 2012-08-26T05:45:35.270

Reputation: 1 563

Your solution works on windows with nmap 7.70, which is much later than the buggy versions you listed. It might be a good idea to test -e no matter which version you are using. – Pianosaurus – 2019-04-03T22:33:09.113

2

I had the exact same problem in my Windows 7 Enterprise x86.

When I added the -e option as bonsaiviking explained, it works well, though too slow. Additionally, I found it happens when your PC has multiple network adapters such as VM network (VMware Network Adapter VMnet8).

After disabling the vm8 adapter it works well without the -e option.

user1664748

Posted 2012-08-26T05:45:35.270

Reputation: 21