Last active
August 25, 2023 18:26
-
-
Save ingmarioalberto/d52c7f4e42ffc8ca4d58f08faf6c9b66 to your computer and use it in GitHub Desktop.
Netstat show remote IPs connected to host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netstat -tpn | tail -n+3 | grep -v '::' | tr ':' ' ' | tr '/' ' ' | awk '{print $4" "$5" "$6" "$7" "$10}' | grep -v '127.0.0.1' | awk '$1!=$3 {print $1" "$3}' | tr ' ' '\n' | sort | uniq -c | sort -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment