Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Log watching and scripted actions

Status
Not open for further replies.

thedaver

IS-IT--Management
Jul 12, 2001
2,741
US
I am weary of dictionary attacks against my qmail and I'm willing to ban IP addresses of the zombies trying to send to neaten my logs.

I use the CHKUSER patch to block unknown recipients, so in "/var/log/qmail/smtp/current" I have log entries that look like this:

Code:
CHKUSER rejected rcpt: from <toonah@email.msn.com::> remote <84-120-133-100.onocable.ono.com:unknown:84.120.133.100> rcpt <nevagju@mydomain.tld> : not existing recipient

Clearly that's a very parsable string and I can ban the sending IP. Problem is that the message is part of a continuous log of these pricks and I can't just process a file. I need to grab these entries as they arrive and have them set aside for handling.

What I really want to do is stuff every one of these IPs into a MySQL database and when the number of hits from an IP to an unknown recipient on my end reaches a threashold, then I want to ban them by an entry into /etc/tcp.smtp

Anybody done anything similar? I looked at "logwatch" and it wasn't immediately obvious if it could handle this.



D.E.R. Management - IT Project Management Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top