To install netstat on Ubuntu/Debian, run
apt install net-tools
To see all connections, run
netstat -antp
To see all listening connections, run
netstat -lntp
To see routing table
netstat -r
To monitor connections to port 80 and 443
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
netstat -aon