-
-
Save scriptzteam/7894864725c9dbc3ac7f613ba57aa31d to your computer and use it in GitHub Desktop.
Revisions
-
flowolf revised this gist
Jan 6, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,4 @@ for i in `sudo cat /var/log/fail2ban.log | sed 's/.*[Bb]an \(.*\)/\1/' | sort | do echo $i; whois $i | grep country\: |head -n 1 >> fail2ban_ctry.log ; done cat fail2ban_ctry.log | sed 's/country: //g' |sort | uniq -c | sort -nr -
flowolf renamed this gist
Sep 11, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
flowolf revised this gist
Sep 11, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,4 @@ for i in `sudo cat /var/log/fail2ban.log | sed 's/.*[Bb]an \(.*\)/\1/' | sort | do echo $i; whois $i | grep country\: |head -n 1 >> fail2ban_ctry.log ; done cat fail2ban_ctry.log fail2bancry2.log | sed 's/country: //g' |sort | uniq -c | sort -nr -
flowolf created this gist
Sep 11, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ #!/bin/bash # get a country statistic for Fail2Ban blocks: # this just accounts for IPs once. Multiple failed attempts by one IP just show up once for a country. for i in `sudo cat /var/log/fail2ban.log | sed 's/.*[Bb]an \(.*\)/\1/' | sort | uniq | cut -d ' ' -f 1 | grep "\."`; do echo $i; whois $i | grep country\: |head -n 1 >> fail2ban_ctry.log ; done cat fail2ban_ctry.log fail2bancry2.log | sed 's/country: //g' |sort | uniq -c