A curious thing that I'd like to understand. Blacklistd enabled in sshd config. Connecting from another external IP to ssh and issuing two wrong logins/passwords results in immediate lockout, as expected and defined in the config file. A new entry gets added to blacklistd table in pf as evidenced by
37.99.46.143 never gets in the blocklist, those attempts just continue forever.
Looking further in auth.log reveals slight differences for IPs that did get the block:
Apart from the obvious question of what's going on there exactly, i.e. why some IPs got blocked yet others don't, I'm curious why 209.141.56.75 specifically didn't get blocked after the second
pfctl -a blacklistd/22 -t port22 -T show
. However every night I get snippets from auth.log that look like this:
Code:
Oct 18 19:10:56 mybox sshd[4141]: reverse mapping checking getaddrinfo for client.fttb.2day.kz [37.99.46.143] failed.
Oct 18 19:10:57 mybox sshd[4141]: Invalid user web from 37.99.46.143 port 11670
Oct 18 19:10:57 mybox sshd[4141]: Connection closed by invalid user web 37.99.46.143 port 11670 [preauth]
Oct 18 19:11:02 mybox sshd[4150]: reverse mapping checking getaddrinfo for client.fttb.2day.kz [37.99.46.143] failed.
Oct 18 19:11:02 mybox sshd[4150]: Invalid user web from 37.99.46.143 port 1704
Oct 18 19:11:02 mybox sshd[4150]: Connection closed by invalid user web 37.99.46.143 port 1704 [preauth]
Oct 18 19:11:08 mybox sshd[4154]: reverse mapping checking getaddrinfo for client.fttb.2day.kz [37.99.46.143] failed.
Oct 18 19:11:08 mybox sshd[4154]: Invalid user web from 37.99.46.143 port 13790
Oct 18 19:11:08 mybox sshd[4154]: Connection closed by invalid user web 37.99.46.143 port 13790 [preauth]
Oct 18 19:11:14 mybox sshd[4156]: reverse mapping checking getaddrinfo for client.fttb.2day.kz [37.99.46.143] failed.
Oct 18 19:11:15 mybox sshd[4156]: Invalid user web from 37.99.46.143 port 53966
Oct 18 19:11:15 mybox sshd[4156]: Connection closed by invalid user web 37.99.46.143 port 53966 [preauth]
Oct 18 19:11:21 mybox sshd[4158]: reverse mapping checking getaddrinfo for client.fttb.2day.kz [37.99.46.143] failed.
Oct 18 19:11:21 mybox sshd[4158]: Invalid user web from 37.99.46.143 port 28126
Oct 18 19:11:21 mybox sshd[4158]: Connection closed by invalid user web 37.99.46.143 port 28126 [preauth]
Oct 18 19:11:27 mybox sshd[4161]: reverse mapping checking getaddrinfo for client.fttb.2day.kz [37.99.46.143] failed.
Oct 18 19:11:27 mybox sshd[4161]: Invalid user web from 37.99.46.143 port 20549
Oct 18 19:11:27 mybox sshd[4161]: Connection closed by invalid user web 37.99.46.143 port 20549 [preauth]
37.99.46.143 never gets in the blocklist, those attempts just continue forever.
Looking further in auth.log reveals slight differences for IPs that did get the block:
Code:
Oct 20 09:58:45 mybox sshd[10097]: Address 209.141.56.75 maps to eubackup.wemineltc.com, but this does not map back to the address.
Oct 20 09:58:45 mybox sshd[10097]: Did not receive identification string from 209.141.56.75 port 56648
Oct 20 09:59:46 mybox sshd[10098]: Address 209.141.56.75 maps to eubackup.wemineltc.com, but this does not map back to the address.
Oct 20 09:59:59 mybox sshd[10098]: Received disconnect from 209.141.56.75 port 52446:11: Normal Shutdown, Thank you for playing [preauth]
Oct 20 09:59:59 mybox sshd[10098]: Disconnected from authenticating user root 209.141.56.75 port 52446 [preauth]
Oct 20 10:00:56 mybox sshd[10117]: Address 209.141.56.75 maps to eubackup.wemineltc.com, but this does not map back to the address.
Oct 20 10:01:03 mybox sshd[10117]: Received disconnect from 209.141.56.75 port 60352:11: Normal Shutdown, Thank you for playing [preauth]
Oct 20 10:01:03 mybox sshd[10117]: Disconnected from authenticating user root 209.141.56.75 port 60352 [preauth]
Oct 20 10:02:04 mybox sshd[10125]: Address 209.141.56.75 maps to eubackup.wemineltc.com, but this does not map back to the address.
Oct 20 10:02:15 mybox sshd[10125]: Invalid user ossuser from 209.141.56.75 port 40110
Apart from the obvious question of what's going on there exactly, i.e. why some IPs got blocked yet others don't, I'm curious why 209.141.56.75 specifically didn't get blocked after the second
Disconnected from authenticating user root
but got blocked after Invalid user ossuser
- the same line that didn't trigger the block with 37.99.46.143.