Skip to content

Instantly share code, notes, and snippets.

@aamsur-mkt
Created March 6, 2020 14:47
Show Gist options
  • Select an option

  • Save aamsur-mkt/0b47a41897b9b005028db6bedb7125f8 to your computer and use it in GitHub Desktop.

Select an option

Save aamsur-mkt/0b47a41897b9b005028db6bedb7125f8 to your computer and use it in GitHub Desktop.
Show incoming connection and port via
netstat -ntu|awk '{print $5" "$4}'|cut -d ":" -f1,3 -s|sort|uniq -c|sort -nk1 -r
# example output :
3 140.213.45.65:22 # 3 connection income to this server from ip 140.213.45.65 via port 22
1 222.186.42.7:22 # 1 connection income to this server from ip 222.186.42.7 via port 22
1 222.186.30.145:22
1 172.19.0.3:9200
1 172.19.0.2:51952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment