Compare with ACK scan in Xfce terminal
In this step, we will perform an ACK scan and compare its results with the Window scan we performed earlier. This comparison will help us understand the differences between these two scan types and how they can be used to gather different types of information about a target system.
An ACK scan (-sA
) sends TCP ACK packets to the target host. Unlike a SYN scan, an ACK scan does not attempt to establish a connection. Instead, it is used to determine whether a firewall is present and how it handles unsolicited ACK packets.
If a firewall is present and configured to block unsolicited ACK packets, the ACK scan will report all ports as filtered
. If a firewall is not present or is configured to allow unsolicited ACK packets, the ACK scan will report ports as either unfiltered
or closed
.
Now, let's perform an ACK scan on the loopback address (127.0.0.1
) and save the results to a file named ack.txt
.
Open your Xfce terminal.
In the terminal, type the following command and press Enter:
nmap -sA -oN ack.txt 127.0.0.1
You should see output similar to the following:
Starting Nmap 7.80 ( https://nmap.org ) at 2023-10-27 10:20 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000070s latency).
Other addresses for localhost (alias(es)): localhost
PORT STATE SERVICE
22/tcp unfiltered ssh
25/tcp unfiltered smtp
80/tcp unfiltered http
Nmap done: 1 IP address (1 host up) scanned in 2.35 seconds
Now, let's compare the results of the ACK scan with the Window scan.
Recall the output of the Window scan (from window.txt
):
## Nmap 7.80 scan initiated Fri Oct 27 10:15:00 2023
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000070s latency).
Other addresses for localhost (alias(es)): localhost
PORT STATE SERVICE
22/tcp closed ssh
25/tcp closed smtp
80/tcp closed http
## Nmap done: 1 IP address (1 host up) scanned in 2.35 seconds
In the Window scan, the ports were reported as closed
. In the ACK scan, the ports are reported as unfiltered
. This difference is due to the way these two scan types work. The Window scan attempts to establish a connection, while the ACK scan only sends ACK packets.
The unfiltered
state in the ACK scan means that Nmap cannot determine whether the port is open or closed because the ACK packets are not being filtered. This could indicate that there is no firewall present, or that the firewall is configured to allow unsolicited ACK packets.
You can also use cat
command to display the contents of the ack.txt
file:
cat ack.txt
You should see the Nmap scan report in the output.
## Nmap 7.80 scan initiated Fri Oct 27 10:20:00 2023
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000070s latency).
Other addresses for localhost (alias(es)): localhost
PORT STATE SERVICE
22/tcp unfiltered ssh
25/tcp unfiltered smtp
80/tcp unfiltered http
## Nmap done: 1 IP address (1 host up) scanned in 2.35 seconds