Automatically send email to hackers from fail2ban


by: Brooks Swinnerton on March 16, 2010

| Posted in: Blog > Technology



Okay, so this is step one of a program that I hope to design in the coming months. If you're familiar with fail2ban, then you know that it can constantly be banning and unbanning ip addresses. If you're like me and send an email to the abuse handler of that ip address range, this program will eventually send out an email to that account with a summary of what happened and the attached log file.

Of course there will be quite a bit of improvements down the road, but here is the first part of the code to grep the ip address from the file:

cat /var/log/fail2ban.log | egrep -o 'Ban [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'



I'll be updating it more as time passes.




Keywords: Automated E-Mail, Fail2Ban, Linux, Ubuntu, cat



Posted by blocklist on September 11, 2010


or you can use our Fail2Ban-Reporting-Service:
http://www.blocklist.de/en/
so you have Statistics and other Tools for your Account and Server.

regards Martin


Posted by bswinnerton on October 19, 2010


Awesome, I'll check that out Martin


Comment on this article:

Username:   You must login/register to post