BFD Config that works

I used the link that you provided and it’s the current version of bfd not 1.5.1.


This is what you told me to do and I did it.

Hi

Please download this file

wget http://iworx8.doc2disk.co.uk/bfd/bfd-current.tar.gz (this donwload link will be removed in 24 Hours)

save it into a different folder, called whatever you want and aftr fully removing in full BFD ver 1.5-2, extract and install ver 1.5-1.

I personally would leave the cron at 3 minutes, certainly leave all settings at default until your happy vpopmail is working, and please do not forget to add your IP to ignore.hosts

Hope that helps

Many thanks

John

Hello,

John has changed the download file back to 1.5-1 you may need to re-download it. So it is 1.5-1

Steve

[QUOTE=stevetoza;26257]Hello,

John has changed the download file back to 1.5-1 you may need to re-download it. So it is 1.5-1

Steve[/QUOTE]

I have already tried both versions 1.5.1 and 1.5.2 and I am having the same issue and its not writting to the log file /var/log directory.

Hello,

Does it write anything to /var/log/bfd_log? Have you double checked that the Firewall is running inside the IW Control panel?

Hi ptaylor1984

I’m sorry I did not know you tried both versions.

I would consider that the issues are directly with your system as it works for everyone else, and it’s not an IW issue, as bfd is not part of IW.

I would suggest if you cannot resolve the issue, you may want to consider employing the services of another company to resolve directly on your system.

Direct access to resolve issues is not anything I would do sorry.

I’m sorry we were not able to resolve in this instance.

Many thanks

John

Its still not working

[QUOTE=stevetoza;26225]Hello,

I created a custom rule to block vchkpw-smtp attacks

If you use your normal text editor ie nano /usr/local/bfd/rules/vsmtpmail

Copy the below into that file

failed logins from a single address before ban

uncomment to override conf.bfd trig value

TRIG=“10”

file must exist for rule to be active

REQ="/var/qmail/bin/qmail-smtpd"

if [ -f “$REQ” ]; then
LP="/var/log/maillog"
TLOG_TF=“vsmtpmail”

vpopmail [qmail]

ARG_VAL=$TLOG_PATH $LP $TLOG_TF | sed -e 's/::ffff://' | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sed -n -e '/vchkpw-smtp: password fail/s/.*password fail \([^ ]*\)\(.*\):\([^ ]*\).*/\3:\1/p' -e '/vchkpw-smtp: system user not found/s/.*system user not found \([^ ]*\)\(.*\):\([^ ]*\).*/\3:\1/p' -e '/vchkpw-smtp: vpopmail user not found/s/.*vpopmail user not found \([^ ]*\)\(.*\):\([^ ]*\).*/\3:\1/p'
fi

Save and exit then run bfd -s

Should start blocking those

Steve[/QUOTE]

I removed the newer version and re-installed bfd -1.5.2 and add the file above and its not resolving the issue.

Its not writting anything to the /var/log/bfd_log file. And should apf be running all the time.

dir /etc/init.d
abrt-ccpp certmonger functions ipvsadm messagebus numad restorecond single ypbind
abrtd cgconfig haldaemon irqbalance mysqld oddjobd rngd smartd
abrt-oops cgred halt iworx netconsole pop3 rpcbind smtp
acpid clamd htcacheclean killall netfs pop3-ssl rpcgssd spamassassin
apf cpuspeed httpd ldirectord network portreserve rpcidmapd sshd
atd crond imap4 lvm2-lvmetad nfs proftpd rpcsvcgssd sssd
auditd cups imap4-ssl lvm2-monitor nfslock psacct rsyslog sysstat
autofs djbdns ip6tables mcelogd ntpd quota_nld sandbox udev-post
blk-availability freshclam iptables mdmonitor ntpdate rdisc saslauthd winbind
[root@fwh bfd]# /etc/init.d/apf restart
Stopping APF: [ OK ]
Starting APF: [ OK ]
[root@fwh bfd]# ps waux |grep apf
root 12293 0.0 0.0 103252 848 pts/0 S+ 20:58 0:00 grep apf
[root@fwh bfd]#

What firewall are you refering to in the /etc/init.d please?

This is not working

[QUOTE=stevetoza;26225]Hello,

I created a custom rule to block vchkpw-smtp attacks

If you use your normal text editor ie nano /usr/local/bfd/rules/vsmtpmail

Copy the below into that file

failed logins from a single address before ban

uncomment to override conf.bfd trig value

TRIG=“10”

file must exist for rule to be active

REQ="/var/qmail/bin/qmail-smtpd"

if [ -f “$REQ” ]; then
LP="/var/log/maillog"
TLOG_TF=“vsmtpmail”

vpopmail [qmail]

ARG_VAL=$TLOG_PATH $LP $TLOG_TF | sed -e 's/::ffff://' | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sed -n -e '/vchkpw-smtp: password fail/s/.*password fail \([^ ]*\)\(.*\):\([^ ]*\).*/\3:\1/p' -e '/vchkpw-smtp: system user not found/s/.*system user not found \([^ ]*\)\(.*\):\([^ ]*\).*/\3:\1/p' -e '/vchkpw-smtp: vpopmail user not found/s/.*vpopmail user not found \([^ ]*\)\(.*\):\([^ ]*\).*/\3:\1/p'
fi

Save and exit then run bfd -s

Should start blocking those

Steve[/QUOTE]

I removed the new version of bfd and installed 1.5.2 using this rule and it’s still not detecting the brute force attempts after I changed the trig to 5. Now I hope that Interworx will consider adding fail2ban plugin to Interworx and it makes life a lot easer… I had it up and running in less then 15 minutes and it works and takes very little resource.

I am not sure what else I can do to try and fix this issue. It’s writting to the log file in the /var/log directory.

Ver is not working

[QUOTE=stevetoza;26230]Hello John,

Downloaded your BFD file, extracted and shows

[root@srv ~]# ls
bfd-1.5-2 - Current version

Also installed it to check the version for you

[root@srv bfd-1.5-2]# bfd -v
Brute Force Detection v1.5-2 <bfd@r-fx.org>

Hope thats what you wanted ;)[/QUOTE]

-v does not work so are we using a different version of the program??

./bfd -v
Brute Force Detection v1.5-2 <bfd@r-fx.org>
© 1999-2014, R-fx Networks <proj@r-fx.org>
© 2014, Ryan MacDonald <ryan@r-fx.org>
This program may be freely redistributed under the terms of the GNU GPL

usage: ./bfd [OPTION]
-s|–standard … run standard with output
-q|–quiet … run quiet with output hidden
-a|–attackpool [STRING] … list addresses that have attacked this host
[root@fwh bfd]#

Hello,

I have BFD installed on around 10 servers and works with no issues with my rule. If you’re happy using Fail2Ban I would continue to use it, If you want BFD, I would suggest maybe hiring a system admin to check out your system to see why it is not happy.

STeve

Hello Steve,

Excuse me for the late reply, thank you very much the edited rule, it works now!

Hi anybody …

I have installed BFD but it doesnt work … I have many popmail attackers and smtp attackers in interworx but nothing is found … BFD log file is empty …

Can help somebody ??

Thanks

Hi jpa_sk

Welcome to Iw forums

What distro are you using and Iw-CP version

Did you start bfd

Many thanks

John

Hi John

I have installed BFD with these steps …

cd /opt
wget http://www.rfxnetworks.com/downloads/bfd-current.tar.gz
tar -xpf bfd-current.tar.gz
ls -l
cd bfd-1.5-2
./install.sh
vi /usr/local/bfd/ignore.hosts
vi /usr/local/bfd/conf.bfd
/usr/local/sbin/bfd -s

The same steps on all IWX servers (4)
On all servers are cron jobs created …

I have started bfd -s
and started cron jobs …

This output was after start …:

[root@slave3 /]# /usr/local/sbin/bfd -s
Brute Force Detection v1.5-2 <bfd@r-fx.org>
© 1999-2014, R-fx Networks <proj@r-fx.org>
© 2014, Ryan MacDonald <ryan@r-fx.org>
This program may be freely redistributed under the terms of the GNU GPL

Nov 24 15:26:04 slave3 bfd(417819): processing rule file asterisk_badauth
Nov 24 15:26:04 slave3 bfd(417819): processing rule file asterisk_iax
Nov 24 15:26:04 slave3 bfd(417819): processing rule file asterisk_nopeer
Nov 24 15:26:04 slave3 bfd(417819): processing rule file courier
Nov 24 15:26:04 slave3 bfd(417819): processing rule file cpanel
Nov 24 15:26:04 slave3 bfd(417819): processing rule file dovecot
Nov 24 15:26:04 slave3 bfd(417819): processing rule file exim_authfail
Nov 24 15:26:04 slave3 bfd(417819): processing rule file exim_nxuser
Nov 24 15:26:04 slave3 bfd(417819): processing rule file modsec
Nov 24 15:26:04 slave3 bfd(417819): processing rule file openvpnas
Nov 24 15:26:04 slave3 bfd(417819): processing rule file postfix
Nov 24 15:26:04 slave3 bfd(417819): processing rule file proftpd
Nov 24 15:26:04 slave3 bfd(417819): processing rule file pure-ftpd
Nov 24 15:26:04 slave3 bfd(417819): processing rule file rh_imapd
Nov 24 15:26:04 slave3 bfd(417819): processing rule file rh_ipop3d
Nov 24 15:26:04 slave3 bfd(417819): processing rule file sendmail
Nov 24 15:26:04 slave3 bfd(417819): processing rule file sshd
Nov 24 15:26:04 slave3 bfd(417819): processing rule file vpopmail
Nov 24 15:26:04 slave3 bfd(417819): processing rule file vsftpd
Nov 24 15:26:04 slave3 bfd(417819): processing rule file vsftpd2
Nov 24 15:26:04 slave3 bfd(417819): processing rule file vsmtpmail
[root@slave3 /]#

But nothing happened… bfd log file is 0 size …

latest iwx ersion, CentOS V6.8

Juraj

Hi jpa_sk

Many thanks

Please could I ask what is shown in /use/local/bfd/stats

Also, are your logs in default locations, as bfd looks at the logs

Many thanks

John

Hi

John…

In /usr/local/bfd/stats is one file, attack.pool and is empty 0 file size.

All log files are in /var/log …

Thanks

Juraj

Hi jurai

Many thanks

Please could I ask what permission is set on /use/local/bfd

Should be root:root drwxr-x—

Also, slave 3, please could look at master, and confirm the stats folder, along with permission

Many thanks

John

Hi,

Master is Cluster master
Slave1, Slave2, Slave3 are cluster nodes …

On all of them is BFD installed on the same way …

permissions are:
/use/local/bfd root:root drwxr-x—
file bfd root:root 755

that is on all of servers

stats - there is empty file on all servers

Juraj

Hi jurai

All looks well for bfd, permission, your startup posted etc…

The only thing I can think of right now is if your logs do not contain any data

Could you confirm if they do or not

Bfd looks at these logs for there detail

Many thanks

John

Hi John…

Now something hapened

One os man many addresses was logged in …

Please can you describe from which date/time it starts to search / filter the pop3/smtp failures or errors ??

Because I have plenty of bad logins, and others …
-password fails …
-user not found …

but it was fount only one address …

I can send you maillog file :slight_smile:

How it is possible to force BFD to go through the entire maillog file at first time :slight_smile:

I don’t understand the algorithm of searching or filtering the failures …

where is some docunetation to BFD …T

hanks

JURAJ