redhat27
Very Senior Member
I have enabled SSH brute force protection on the web UI, but am not very clear how to determine whether it is working or not.
This is in my iptables-save filter section:
Yet these appear in the syslog (fw logging enabled):
I have x'ed out the router MAC and my external IP
Why do I have so many login attempts from 41.103.215.126?
I thought the SSHBFP would limit 4 connects in a 60 second period from the same IP to my SSH port.
BTW, my sshd is running on port 22, but only an only a higher (more obscure) port is opened externally that forwards to port 22
Also, FYI here is parts of my iptables -nvL:
This is in my iptables-save filter section:
admin@RT-AC66R-D700:/tmp/home/root# iptables-save | grep -i ssh
:SSHBFP - [0:0]
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -j SSHBFP
-A SSHBFP -m recent --set --name SSH --rsource
-A SSHBFP -m recent --update --seconds 60 --hitcount 4 --name SSH --rsource -j logdrop
-A SSHBFP -j logaccept
:SSHBFP - [0:0]
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -j SSHBFP
-A SSHBFP -m recent --set --name SSH --rsource
-A SSHBFP -m recent --update --seconds 60 --hitcount 4 --name SSH --rsource -j logdrop
-A SSHBFP -j logaccept
Yet these appear in the syslog (fw logging enabled):
Apr 6 16:44:20 kernel: ACCEPT <4>ACCEPT IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=40 TOS=0x00 PREC=0x20 TTL=48 ID=40639 PROTO=TCP <1>SPT=29513 DPT=22 SEQ=1203836498 ACK=0 WINDOW=21357 RES=0x00 SYN URGP=0
Apr 6 16:44:24 kernel: ACCEPT <4>ACCEPT IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=47 ID=61106 DF PROTO=TCP <1>SPT=46709 DPT=22 SEQ=2849169839 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A00200F1D00000000)
Apr 6 16:44:26 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:26 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:27 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:27 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:28 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:29 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:29 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:30 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:30 kernel: ACCEPT <4>ACCEPT IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=61883 DF PROTO=TCP <1>SPT=46737 DPT=22 SEQ=2938101967 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A0020117400000000)
Apr 6 16:44:30 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:31 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:32 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:32 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:33 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:33 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:34 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:34 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:35 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:36 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:36 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:37 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:42 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34164 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A0020162500000000)
Apr 6 16:44:45 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34165 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A0020175100000000)
Apr 6 16:44:51 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34166 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A002019A900000000)
Apr 6 16:45:03 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34167 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A00201E5900000000)
Apr 6 16:45:27 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34168 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A002027B900000000)
Apr 6 16:44:24 kernel: ACCEPT <4>ACCEPT IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=47 ID=61106 DF PROTO=TCP <1>SPT=46709 DPT=22 SEQ=2849169839 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A00200F1D00000000)
Apr 6 16:44:26 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:26 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:27 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:27 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:28 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:29 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:29 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:30 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:30 kernel: ACCEPT <4>ACCEPT IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=61883 DF PROTO=TCP <1>SPT=46737 DPT=22 SEQ=2938101967 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A0020117400000000)
Apr 6 16:44:30 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:31 dropbear[6199]: Login attempt for nonexistent user from 41.103.215.126:46709
Apr 6 16:44:32 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:32 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:33 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:33 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:34 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:34 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:35 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:36 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:36 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:37 dropbear[6200]: Login attempt for nonexistent user from 41.103.215.126:46737
Apr 6 16:44:42 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34164 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A0020162500000000)
Apr 6 16:44:45 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34165 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A0020175100000000)
Apr 6 16:44:51 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34166 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A002019A900000000)
Apr 6 16:45:03 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34167 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A00201E5900000000)
Apr 6 16:45:27 kernel: DROP <4>DROP IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <1>SRC=41.103.215.126 DST=x.x.x.x <1>LEN=56 TOS=0x00 PREC=0x20 TTL=48 ID=34168 DF PROTO=TCP <1>SPT=46778 DPT=22 SEQ=3126301521 ACK=0 WINDOW=5440 RES=0x00 SYN URGP=0 OPT (020405500402080A002027B900000000)
Why do I have so many login attempts from 41.103.215.126?
I thought the SSHBFP would limit 4 connects in a 60 second period from the same IP to my SSH port.
BTW, my sshd is running on port 22, but only an only a higher (more obscure) port is opened externally that forwards to port 22
Also, FYI here is parts of my iptables -nvL:
Code:
admin@RT-AC66R-D700:/tmp/home/root# iptables -nvL | grep SSH
116 5768 SSHBFP tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 state NEW
Chain SSHBFP (1 references)
116 5768 all -- * * 0.0.0.0/0 0.0.0.0/0 recent: SET name: SSH side: source
30 1624 logdrop all -- * * 0.0.0.0/0 0.0.0.0/0 recent: UPDATE seconds: 60 hit_count: 4 name: SSH side: source