Rich99
June 28th, 2007, 01:29 PM
I'm using fail2ban under 6.06 LTS, and wanted to check whether I'm doing this right. Here's the relevent section of fail2ban.conf:
[proftpd]
enabled = true
#port = ftp,ftp-data,ftps,ftps-data
port = ftp
logfile = /var/log/proftpd/proftpd.log
timeregex = \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}
timepattern = %%b %%d %%H:%%M:%%S
failregex = USER \S+: no such user found from \S* ?\[<HOST>\] to \S+\s*$
My lines in /var/log/proftpd/proftpd.log look like this for a failed login:
Jun 28 18:17:51 rich-server proftpd[643] rich-server (rich.xxx.xxx.com[::ffff:193.6.x.x]): USER dave: no such user found from rich.xxx.xxx.com [::ffff:193.6.x.x] to ::ffff:193.6.x.x:21
Now I got the above regex from the fail2ban site, and the 'time' patterns & regexes from the ssh example in the config file. However my failed log lines are slightly different to the ones given in fail2bans example. Thus I suspect the regex won't match. However I don't really understand regex's!! I know there is a fail2ban regex testing tool but I don't seem to have it installed, and can't find it in the 6.06 repositories. I assume it's only in the newer fail2bans as in feisty. Can anyone help me sort out the regex's based on the above line?
[proftpd]
enabled = true
#port = ftp,ftp-data,ftps,ftps-data
port = ftp
logfile = /var/log/proftpd/proftpd.log
timeregex = \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}
timepattern = %%b %%d %%H:%%M:%%S
failregex = USER \S+: no such user found from \S* ?\[<HOST>\] to \S+\s*$
My lines in /var/log/proftpd/proftpd.log look like this for a failed login:
Jun 28 18:17:51 rich-server proftpd[643] rich-server (rich.xxx.xxx.com[::ffff:193.6.x.x]): USER dave: no such user found from rich.xxx.xxx.com [::ffff:193.6.x.x] to ::ffff:193.6.x.x:21
Now I got the above regex from the fail2ban site, and the 'time' patterns & regexes from the ssh example in the config file. However my failed log lines are slightly different to the ones given in fail2bans example. Thus I suspect the regex won't match. However I don't really understand regex's!! I know there is a fail2ban regex testing tool but I don't seem to have it installed, and can't find it in the 6.06 repositories. I assume it's only in the newer fail2bans as in feisty. Can anyone help me sort out the regex's based on the above line?