I am using nmap to scan open ports of a device (Android smartphone), and nmap returns me that all 1000 scanned ports are closed. Right.

But in the same time I can ping the device. I thought that pinging a device would send a ICMP "echo" message to it, which is using port 7 if I am good.

So, two questions : Why does nmap say that all ports are closed (meaning that the remote computer rejected my connection attempt with a RST packet Filtered), if I can ping on port 7 ? Why does nmap only scan 1000 ports and not 65K ?

Thank you

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 11, 2017 at 19:31

2 Answers 2


TCP port 7 ('echo') and ICMP echo request messages are two very different things. Ping uses ICMP echo messages, which (since it's ICMP) do not use TCP. So this has nothing to do with TCP ports being open or closed, you can't "ping" TCP ports using the ping utility.

My guess would be that nmap scans 1000 ports by default because those are most of the well known ports, and to reduce runtime. You can always specify all ports using -p 0-65535.


You will notice in your NMap scan results that it states that ping was successful, and yet still that all ports it scanned are closed. This is because they are two very different things, in fact ICMP is in a diferent OSI layer than TCP/UDP. So it follows that two different layers are checked in two different ways.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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