I would like to prevent bruteforce attacks on mail server which is behind mikrotik router/firewall.
I used FTP bruteforce example http://wiki.mikrotik.com/wiki/Bruteforce_login_prevention_(FTP
and I changed chains, ports, content (-ERR [AUTH] Invalid login ).
My question is regarding dst-limit. It allways triggers that rule, and rule below that is never triggered (the one which will add address to address list)
my setup:
/ip firewall filter
add action=tarpit chain=forward comment="drop pop brute force - block all from list" dst-port=110 \
protocol=tcp src-address-list=pop_blacklist src-port=""
add chain=forward comment="drop pop brute force - accept 5 failed logins per minute" content=\
"ERR [AUTH] Invalid login" dst-limit=1/1m,5,src-address/1m protocol=tcp src-port=110
add action=add-dst-to-address-list address-list=pop_blacklist address-list-timeout=10m chain=forward comment=\
"drop pop brute force - add everything else to address list" content="ERR [AUTH] Invalid login" \
protocol=tcp src-port=110
It seems that I got a similar problem when trying to block ftp bruteforce. I had to alter the rules as the ftp server is not on the mikrotik itself but in the network behind and there is a nat rule existing. So i changed the chain to forward instead of input/ouput:
The problem is the 2nd rule… it is triggered during a bruteforce attempt but it does not “expire” after 5 trials in order to let the 3rd rule add the adress list.
Any clever hints are highly appreciated
OK I got it solved after upgrading from old 5.26 to 6.19! In the forum there were several hints that version below 5.5 had several bugs regarding that functionality!
but any success. I use the MikroTik RouterBoard’s FTP service.
It takse my IP address into the BlackList at the first incorrent login. FYI: I use the TotalCommander for the FTP. I never store the name/pswd in the TCM, only x/x (because they are not encrypted). So the first connection always false/incorrect. As a result my IP address added to the list. But the first time?
I misunderstand something?