Skip to content

Instantly share code, notes, and snippets.

@brokendish
Created January 19, 2012 12:29
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 brokendish/1639814 to your computer and use it in GitHub Desktop.
Save brokendish/1639814 to your computer and use it in GitHub Desktop.
IPアドレスの国を判別する(コマンド)
grep 'Invalid user' /var/log/auth.log|awk 'BEGIN{FS=":"}{print $4}'|awk 'BEGIN{FS=" "}{print $5}'|sort|uniq|xargs -I{} whois {}|grep -i country|sed 's/ //g'|sort|uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment