I am trying to block brute force attack to my FTP and I am not able to get it working.
Example on RDP
First time you tries to login on FTP, you are allowed to go to login page, but you IP is stored in access liste 1_level_rdp for 10 minutes
Second time log in, and since it is within 10 minutes of previous attempt, you are in access liste 1_level_rdp, this time you are moved to access list 2_level_rdp for 10 min.
Third time login. If its within 10 minutes of last login, you are in access list 2_level_rdp and this time your IP is saved in block_rdp for 1 day.
At the top of rules I have a rules that block all that are in block_rdp
This works fine for RDP since when I connect my self, it will stay connected for all the time (1 session)
But for FTP, if if you are connected, it times out and you reconnect many times, so I block my self out using the RDP solution.
What I would like is for the IP to be stored in an access liste for one hour. Then if there are new attempt within 1 hour, do not do nothing.
But if there are new connection in hour 2, go up one level (same as RDP). And then again same for 3 hour, put to block list. So do not count number of its, but number of hours.
RDP example
add action=drop chain=forward comment="Drop RDP brute forcers" dst-port=8080 log=yes log-prefix=\
FW_Block_Bruteforce_RDP protocol=tcp src-address-list=block_rdp
add action=add-src-to-address-list address-list=block_rdp address-list-timeout=1d chain=forward \
connection-state=new dst-port=3389 protocol=tcp src-address-list=2_level_rdp
add action=add-src-to-address-list address-list=2_level_rdp address-list-timeout=10m chain=forward \
connection-state=new dst-port=3389 protocol=tcp src-address-list=1_level_rdp
add action=add-src-to-address-list address-list=1_level_rdp address-list-timeout=10m chain=forward \
connection-state=new dst-port=3389 protocol=tcp