netstat
To install netstat on Ubuntu/Debian, run
1 |
apt install net-tools |
To see all connections, run
1 |
netstat -antp |
To see all listening connections, run
1 |
netstat -lntp |
To see routing table
1 |
netstat -r |
To monitor connections to port 80 and 443
1 2 |
netstat -ctupne | grep ESTABLISHED | cut -c45-1000 | grep -E ':443|:80' > connections.txt cat connections.txt | cut -c1-50 | sort | uniq -c | sort -n > uniq.txt |
To see open ports on Windows
1 |
netstat -aon |