In this step, you will use Nmap to perform TCP SYN and ACK ping scans. These techniques are often more reliable than ICMP ping because many firewalls block ICMP traffic but allow TCP traffic.
First, let's try a TCP SYN ping scan on 192.168.1.1 to demonstrate what happens when a host is not reachable. A TCP SYN ping sends a TCP SYN packet to the target host. If the host is up and listening on the specified port (or any port by default), it will respond with a SYN/ACK packet. Nmap then resets the connection by sending an RST packet.
The -PS option in Nmap specifies that you want to use a TCP SYN ping. By default, Nmap sends the SYN packet to port 80.
To perform a TCP SYN ping scan on 192.168.1.1, execute the following command in your terminal:
sudo nmap -PS 192.168.1.1
This command tells Nmap to send a TCP SYN packet to port 80 of the host 192.168.1.1. sudo is required because Nmap needs elevated privileges to craft and send raw TCP packets.
Since 192.168.1.1 is not reachable in this lab environment, you'll see output like this:
Starting Nmap 7.80 ( https://nmap.org ) at 2025-06-03 09:49 CST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 2.10 seconds
This output shows that Nmap could not reach 192.168.1.1. The message suggests using -Pn if you suspect the host is up but blocking ping probes.
Now, let's perform a TCP SYN ping scan on localhost (127.0.0.1) to see how it works when the host is reachable:
sudo nmap -PS 127.0.0.1
This will show output similar to:
Starting Nmap 7.80 ( https://nmap.org ) at 2025-06-03 09:50 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000070s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
2121/tcp open ccproxy-ftp
2222/tcp open EtherNetIP-1
3001/tcp open nessus
8080/tcp open http-proxy
Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds
This output shows that Nmap successfully detected localhost as up and also performed a port scan, showing the open ports on the system.
Next, you will perform an ACK ping scan. An ACK ping sends a TCP ACK packet to the target host. Unlike SYN ping, which attempts to establish a connection, ACK ping sends a packet that appears to be part of an already established connection. Firewalls often have rules to handle incoming ACK packets differently than SYN packets, making ACK ping useful for bypassing some firewall configurations.
The -PA option in Nmap specifies that you want to use a TCP ACK ping. By default, Nmap sends the ACK packet to port 80.
First, let's try the ACK ping on 192.168.1.1:
sudo nmap -PA 192.168.1.1
As expected, this will show that the host is down:
Starting Nmap 7.80 ( https://nmap.org ) at 2025-06-03 09:50 CST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 2.11 seconds
Now, let's perform a TCP ACK ping scan on localhost to see the successful case:
sudo nmap -PA 127.0.0.1
This will produce output similar to:
Starting Nmap 7.80 ( https://nmap.org ) at 2025-06-03 09:50 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000040s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
2121/tcp open ccproxy-ftp
2222/tcp open EtherNetIP-1
3001/tcp open nessus
8080/tcp open http-proxy
Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
This output shows that Nmap sent a TCP ACK packet to localhost and received a response, indicating that the host is up. The scan also shows the open ports on the system.