On 04/08/2021 13.42, Anton Aylward wrote:
On 2021-08-03 8:47 p.m., Carlos E. R. wrote:
On 04/08/2021 02.21, Douglas McGarrett wrote:
This doesn't make sense:
localhost:~ # nmap -sP 192.168.1.* Starting Nmap 7.70 ( https://nmap.org ) at 2021-08-03 20:11 EDT Nmap done: 256 IP addresses (0 hosts up) scanned in 206.30 seconds
It should have at least found the Epson printer and the router. I was hoping it would find the old HP printer, so I would know what its IP is.
Not really. With the options you used, it will only find them if they respond to ping.
That's true and there's reasons why not. My printer powers down and it takes a bit more than a ping to wake it up.
The thing is, the nmap manual says this about -sP (emphasis mine): -sn (No port scan) *This option tells Nmap not to do a port scan after host discovery, and only print out the available hosts that responded to the host discovery probes.* This is often known as a “ping scan”, but you can also request that traceroute and NSE host scripts be run. This is by default one step more intrusive than the list scan, and can often be used for the same purposes. It allows light reconnaissance of a target network without attracting much attention. Knowing how many hosts are up is more valuable to attackers than the list provided by list scan of every single IP and host name. Systems administrators often find this option valuable as well. It can easily be used to count available machines on a network or monitor server availability. This is often called a ping sweep, and is more reliable than pinging the broadcast address because many hosts do not reply to broadcast queries. The default host discovery done with -sn consists of an ICMP echo request, TCP SYN to port 443, TCP ACK to port 80, and an ICMP timestamp request by default. When executed by an unprivileged user, only SYN packets are sent (using a connect call) to ports 80 and 443 on the target. When a privileged user tries to scan targets on a local ethernet network, ARP requests are used unless --send-ip was specified. The -sn option can be combined with any of the discovery probe types (the -P* options, excluding -Pn) for greater flexibility. If any of those probe type and port number options are used, the default probes are overridden. When strict firewalls are in place between the source host running Nmap and the target network, using those advanced techniques is recommended. Otherwise hosts could be missed when the firewall drops probes or their responses. *In previous releases of Nmap, -sn was known as -sP*. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))