Hello Everyone,
I am new working with Mikrotik and in this forum. I have a Mikrotik Administering the network as a firewall, QoS, NAT, DHCP, etc. and I need to prevent bruteforce attacks for MySQL and MSSQL servers. I tried something like this:
/ip firewall filter
add chain=forward protocol=tcp dst-port=3306 connection-state=new action=add-dst-to-address-list address-list=MySQL-stage1
add chain=forward protocol=tcp dst-port=3306 connection-state=new src-address-list=MySQL-stage1 action=add-dst-to-address-list address-list=MySQL-stage2
add chain=forward protocol=tcp dst-port=3306 connection-state=new src-address-list=MySQL-stage2 action=add-dst-to-address-list address-list=MySQL-stage3
add chain=forward protocol=tcp dst-port=3306 connection-state=new src-address-list=MySQL-stage3 action=add-dst-to-address-list address-list=MySQL-Blacklist
add chain=forward protocol=tcp dst-port=3306 connection-state=new src-address-list=MySQL-Blacklist action=drop
It works passing connections through stages but, even if I put the correct user and password my IP gets blacklisted. I think there must be a way to verify invalid login adding a characteristic to the rules, but I do not know what could it be.
I have done similar rules for SSH bruteforce attacks and RDP attacks and it works fine.
Thanks for your help.