LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-22-2007, 07:40 AM   #1
antis
Member
 
Registered: Nov 2004
Location: sweden
Distribution: Arch
Posts: 67

Rep: Reputation: 15
Detecting multiple failed login attempts and banning ip?


Hi,

On my personal server I sometimes see people trying to sort of bruteforce their way into my ftp server (vsftp by the way). I see ~15 lines in auth.log where the same ip tries to log in with user name "Administrator" before they leave.

This isn't all that bad but what if they keep on trying without me stopping them...?

Is there a way to catch this behaviour and limit the number of failed log in attempts within a certain time span?

I have been thinking about writing a script of my own to poll auth.log for these events and put suspious ip's in hosts.deny but I don't know if it would be a good idea as the script would need to check the file quite often, say every 5 seconds or so.

But most important, before I try this I want to be sure that I'm not re-inventing the wheel

So, is there a way to monitor failed log in attempts and banning ip's?
 
Old 09-22-2007, 09:22 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
check out fail2ban, should be exactly what you're after. http://www.fail2ban.org/wiki/index.php/Vsftpd

Last edited by acid_kewpie; 09-22-2007 at 09:24 AM.
 
Old 09-23-2007, 09:18 AM   #3
antis
Member
 
Registered: Nov 2004
Location: sweden
Distribution: Arch
Posts: 67

Original Poster
Rep: Reputation: 15
Thanks, that is indeed exactly what I am looking for. In fact it's almost too exact really, beacuse it looks like the idea behind it is the same that I had in mind.

I'm going to remember fail2ban in case I fail to do this on my own. I think it can be a fun little project to work on and hopfully I'll learn a few new things.
 
Old 09-23-2007, 09:59 AM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
also check out DenyHosts
 
Old 09-25-2007, 11:25 AM   #5
mlnutt
Member
 
Registered: May 2006
Posts: 34

Rep: Reputation: 15
Also, check out "daemonshield."
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple failed attempts with mysql install the-yikes Slackware 13 05-28-2007 01:02 PM
Constant failed login attempts... seanferd Linux - Security 8 11-09-2006 08:42 AM
Timeout between failed login attempts wuicci Linux - Security 3 06-01-2006 04:40 AM
Failed SSH login attempts Capt_Caveman Linux - Security 38 01-03-2006 03:22 PM
Multiple installation attempts in a laptop failed miserably KLG Ubuntu 1 07-08-2005 06:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration