My Server has one 'big' client and is under a sustained attack from a botnet, as an example:
Code: Select all
"SMTPD" 3832 40146 "2020-08-19 20:27:08.662" "182.160.104.22" "SENT: 220 inetc930.inetc.net"
"SMTPD" 3856 40146 "2020-08-19 20:27:08.870" "182.160.104.22" "RECEIVED: HELO [116.212.109.195]"
"SMTPD" 3856 40146 "2020-08-19 20:27:08.871" "182.160.104.22" "SENT: 250 Hello."
"SMTPD" 3832 40146 "2020-08-19 20:27:09.078" "182.160.104.22" "RECEIVED: AUTH LOGIN"
"SMTPD" 3832 40146 "2020-08-19 20:27:09.079" "182.160.104.22" "SENT: 334 VXNlcm5hbWU6"
"SMTPD" 3856 40146 "2020-08-19 20:27:09.691" "182.160.104.22" "RECEIVED: ZGF2aWRmaXNoZXJAZ2VvcmdlYnJvd25zLmNvLnVr"
"SMTPD" 3856 40146 "2020-08-19 20:27:09.691" "182.160.104.22" "SENT: 334 UGFzc3dvcmQ6"
"SMTPD" 3856 40146 "2020-08-19 20:27:10.301" "182.160.104.22" "RECEIVED: ***"
"SMTPD" 3856 40146 "2020-08-19 20:27:10.310" "182.160.104.22" "SENT: 535 Authentication failed. Too many invalid logon attempts."
I've looked at blanket blocking countries at the firewall but the server is old, so Powershell is not useful, to use this : https://www.gregsitservices.com/blog/20 ... -firewall/ and, to be honest, the IPs are coming from all around the world so 'by region' firewalling is not useful here and my client has many overseas clients, so the risk of cutting off their clients is not acceptable.
Most of these attempted logins are not providing a scriptable EHLO ("RECEIVED: HELO [116.212.109.195]"), this seems the same as an email client (Desktop Outlook etc.).
I have used this to test for the HELO as, from the log, there isn't a proper EHLO but the 'SMTPD' RECEIVED: HELO [116.212.109.195].
I can't get this string from oCLient or other VBS means, have tried this as a test :
Code: Select all
Sub OnClientConnect(oClient)
EventLog.Write( "CONNECT" )
EventLog.Write( oClient.IPAddress )
End Sub
Sub OnSMTPData(oClient, oMessage)
EventLog.Write( "SMTP START" )
EventLog.Write( oClient.HELO )
EventLog.Write( oClient.IPAddress )
End Sub
Code: Select all
3952 "2020-08-19 21:15:41.178" "CONNECT"
3952 "2020-08-19 21:15:41.179" "82.31.168.38"
3856 "2020-08-19 21:15:41.184" "CONNECT"
3856 "2020-08-19 21:15:41.184" "82.31.168.38"
3952 "2020-08-19 21:15:58.405" "CONNECT"
3952 "2020-08-19 21:15:58.408" "177.22.86.79"
3952 "2020-08-19 21:16:02.726" "CONNECT"
3952 "2020-08-19 21:16:02.727" "62.193.129.232"
3952 "2020-08-19 21:16:25.765" "CONNECT"
3952 "2020-08-19 21:16:25.765" "192.35.168.193"
3856 "2020-08-19 21:16:36.711" "CONNECT"
3856 "2020-08-19 21:16:36.712" "86.13.173.48"
3856 "2020-08-19 21:16:40.687" "CONNECT"
3856 "2020-08-19 21:16:40.687" "86.13.173.48"
3952 "2020-08-19 21:16:40.886" "CONNECT"
3952 "2020-08-19 21:16:40.886" "192.35.168.193"
3952 "2020-08-19 21:16:42.000" "CONNECT"
3952 "2020-08-19 21:16:42.001" "192.35.168.193"
3952 "2020-08-19 21:16:42.657" "CONNECT"
3952 "2020-08-19 21:16:42.657" "192.35.168.193"
3952 "2020-08-19 21:17:03.827" "CONNECT"
3952 "2020-08-19 21:17:03.827" "90.197.184.250"
3952 "2020-08-19 21:17:07.527" "CONNECT"
3952 "2020-08-19 21:17:07.528" "86.13.173.48"
3832 "2020-08-19 21:17:58.706" "CONNECT"
3832 "2020-08-19 21:17:58.706" "109.151.246.143"
3712 "2020-08-19 21:18:01.402" "CONNECT"
3712 "2020-08-19 21:18:01.403" "38.89.254.163"
3952 "2020-08-19 21:18:06.843" "CONNECT"
3952 "2020-08-19 21:18:06.843" "38.89.254.163"
3952 "2020-08-19 21:18:06.935" "CONNECT"
3952 "2020-08-19 21:18:06.935" "86.13.173.48"
3952 "2020-08-19 21:18:07.920" "SMTP START"
3952 "2020-08-19 21:18:07.921" "mx127.antispamcloud.com"
3952 "2020-08-19 21:18:07.921" "38.89.254.163"
3952 "2020-08-19 21:18:29.805" "CONNECT"
3952 "2020-08-19 21:18:29.805" "37.120.198.229"
3952 "2020-08-19 21:18:42.191" "CONNECT"
3952 "2020-08-19 21:18:42.192" "86.13.173.48"
3952 "2020-08-19 21:18:59.324" "CONNECT"
3952 "2020-08-19 21:18:59.324" "46.165.223.16"
3632 "2020-08-19 21:18:59.877" "SMTP START"
3632 "2020-08-19 21:18:59.878" "out8.antispamcloud.com"
3632 "2020-08-19 21:18:59.878" "46.165.223.16"
3632 "2020-08-19 21:19:53.554" "CONNECT"
3632 "2020-08-19 21:19:53.554" "190.147.133.202"
3856 "2020-08-19 21:20:01.922" "CONNECT"
3856 "2020-08-19 21:20:01.923" "82.8.194.220"
3856 "2020-08-19 21:20:06.400" "CONNECT"
3856 "2020-08-19 21:20:06.400" "82.8.194.220"
3632 "2020-08-19 21:20:06.641" "CONNECT"
3632 "2020-08-19 21:20:06.641" "196.216.92.79"
3632 "2020-08-19 21:20:06.709" "CONNECT"
3632 "2020-08-19 21:20:06.710" "82.8.194.220"
3632 "2020-08-19 21:20:06.757" "CONNECT"
3632 "2020-08-19 21:20:06.758" "82.8.194.220"
3632 "2020-08-19 21:20:07.675" "CONNECT"
3632 "2020-08-19 21:20:07.675" "82.8.194.220"
3632 "2020-08-19 21:20:07.953" "CONNECT"
3632 "2020-08-19 21:20:07.953" "82.8.194.220"
3856 "2020-08-19 21:20:08.236" "CONNECT"
3856 "2020-08-19 21:20:08.236" "82.8.194.220"
3856 "2020-08-19 21:20:08.270" "CONNECT"
3856 "2020-08-19 21:20:08.270" "82.8.194.220"
3952 "2020-08-19 21:20:10.043" "SMTP START"
3952 "2020-08-19 21:20:10.043" "217.21.124.194.liquidtelecom.net"
3952 "2020-08-19 21:20:10.044" "196.216.92.79"
3632 "2020-08-19 21:20:10.746" "CONNECT"
3632 "2020-08-19 21:20:10.747" "77.37.208.119"
3856 "2020-08-19 21:20:14.759" "CONNECT"
3856 "2020-08-19 21:20:14.759" "82.8.194.220"
The domain has behind a Spam Wall service for over two years but, due to it's age, the historical MX records are clearly still out there and I still get direct SMTP spammers, bypassing the now official MX records of the spamwall. I can't restrict the 'incoming relays', to the spamwall only, as there are other clients and services being provided, e.g. an invoicing system, scanners / printers etc. and a couple of other smaller clients.
Am up to nearly 5000 banned IPs and have spent the last two days trying to fathom a way to block these dickheads.
Is there a limit in HMS for the banned IP list ? Am currently only showing a medium critical status on the number in Status -> Server.
If it is ok I'll just let the list grow and see if HMS can handle more banned IPs than they can afford botnet IPs..?
Am really looking for ideas on how to identify between a spammer and a legit client SMTP connection in code. The API is great but doesn't go into enough detail.