Skip to content

Instantly share code, notes, and snippets.

@hoangdh
Last active October 30, 2018 09:59
Show Gist options
  • Save hoangdh/efae37bc983f06c513ee04603cf3d28a to your computer and use it in GitHub Desktop.
Save hoangdh/efae37bc983f06c513ee04603cf3d28a to your computer and use it in GitHub Desktop.
Trace IP SYN Flood to country
#!/bin/bash
####
#
# Count IP send SYN's flag
#
####
list=`netstat -npt | grep SYN_RECV | awk {'print $5'} | cut -d':' -f1`;
for x in $list;
do
country=`curl -s ipinfo.io/$x| grep -w 'country'`;
echo "$x - $country";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment