Oct 16, 2014

Testing open ports on firewall (LAN to WAN)

 What

If the customer blocks traffic from inside to outside, using netcat we can check them all.

 Problem

I was looking for a good tool to check open ports from inside to outside.

 Solution

We could use nmap to scan an known public sever, but the server has to accept connections on each port. I don't have such server and I'll not set this up..

We could use netcat for this. The following script does the work perfectly (to test my router open ports from inside my network):
#!/bin/bash

for i in {0..65535}
do
TEST=`nc -zv 192.168.2.1 "$i" 2>&1 `
logger -t "scan-ports" "$TEST"
done

# EOF

No comments:

Post a Comment