Skip to content

Instantly share code, notes, and snippets.

@ingmarioalberto
Last active August 25, 2023 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ingmarioalberto/d52c7f4e42ffc8ca4d58f08faf6c9b66 to your computer and use it in GitHub Desktop.
Save ingmarioalberto/d52c7f4e42ffc8ca4d58f08faf6c9b66 to your computer and use it in GitHub Desktop.
Netstat show remote IPs connected to host
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