Skip to content

Instantly share code, notes, and snippets.

@wikrie
Created June 1, 2018 13:52
Show Gist options
  • Save wikrie/60c3be8edcc300032bea50a15dd46a9c to your computer and use it in GitHub Desktop.
Save wikrie/60c3be8edcc300032bea50a15dd46a9c to your computer and use it in GitHub Desktop.
#!/bin/bash
## all Fail2Ban Log should be logged into /var/log/fail2ban.log then this will work
## you need geoiplookup to get it runningyou can install it with sudo apt install geoip-bin
cat /var/log/fail2ban.log* | grep Ban | sed 's/.*[Bb]an \(.*\)/\1/' | uniq | while read line; do geoiplookup $line; done | sort | uniq -c | sort -nr
@abfahr
Copy link

abfahr commented Jun 21, 2020

needs geoiplookup
sudo apt-get install geoip-bin

@wikrie
Copy link
Author

wikrie commented Jun 22, 2020

needs geoiplookup
sudo apt-get install geoip-bin

I already point to that with my 2nd comment, I do not see a reason to tell it once more
Check out line 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment