In this final step, you will evaluate the effectiveness of your scanning evasion techniques by analyzing firewall logs and comparing scan results from different methods. This helps you understand which techniques successfully bypassed firewall detection and which were flagged as suspicious activity.
-
First, check the current firewall logs to see detected scanning attempts. This gives you a baseline of what normal firewall activity looks like before testing evasion methods:
sudo iptables -L -n -v | grep -E "DROP|REJECT"
This command shows how many packets were blocked by your firewall rules, with the counters indicating detection attempts.
-
Now create two scan reports for comparison - one using basic scanning and another with evasion techniques. The difference between these will show the effectiveness of your evasion:
nmap -sS 127.0.0.1 -oN basic_scan.txt
nmap -f -D RND:3 127.0.0.1 -oN evasion_scan.txt
The first command performs a standard SYN scan, while the second uses fragmentation (-f) and decoy IPs (-D RND:3).
-
Analyze the differences between scan results to see which ports were filtered in each case:
diff basic_scan.txt evasion_scan.txt
Pay special attention to the number of "filtered" ports in each report - fewer filtered ports in the evasion scan indicates successful bypass.
-
To specifically check for successful evasion, reset firewall counters and run an evasion scan while monitoring detection:
sudo iptables -Z && sudo nmap -f -D RND:3 127.0.0.1 && sudo iptables -L -n -v
The counter values show how many packets were detected by the firewall during your evasion attempt.
-
For comprehensive testing, combine multiple evasion techniques to maximize your chances of bypassing security:
sudo nmap -f -D RND:5 -T2 --data-length 24 127.0.0.1 -oN final_scan.txt
This uses fragmentation, 5 decoy IPs, slower timing (-T2), and random data padding (--data-length 24).
-
Finally, generate a summary report comparing filtered ports between basic and evasion scans:
echo "Basic scan filtered ports:" && grep filtered basic_scan.txt | wc -l
echo "Evasion scan filtered ports:" && grep filtered evasion_scan.txt | wc -l
A significant reduction in filtered ports between the two scans demonstrates successful firewall evasion.