Example script function used by many here:
Code: Select all
Sub OnClientConnect(oClient)
If SpamRatsAuthHacker(oClient.IPAddress) Then
Set oShell = CreateObject("WScript.Shell")
'oShell.Run """C:\Program Files (x86)\hMailServer\Bin\ProxyAuth.exe"" -secret Mangos -ban " & oClient.IPAddress & " -bandays 180"
oShell.Run """C:\Program Files (x86)\hMailServer\Bin\ProxyAuth.exe"" -secret Mangos -ban " & oClient.IPAddress & " -bandays 180", 0, True
Result.Value = 1
EventLog.Write("Message from: " & oClient.IPAddress & " Blocked as authentication hacker - SpamRatsAuthHacker")
Exit Sub
End If
End Sub
Code: Select all
Function SpamRatsAuthHacker(strIP)
SpamRatsAuthHacker = false
Dim a : a = Split(strIP, ".")
On Error Resume Next
With CreateObject("DNSLibrary.DNSResolver")
strIP = .DNSLookup(a(3) & "." & a(2) & "." & a(1) & "." & a(0) & ".auth.spamrats.com")
End With
On Error Goto 0
Dim strRegEx : strRegEx = "^(127\.0\.0\.43)$"
SpamRatsAuthHacker = Lookup(strRegEx, strIP)
End Function
Apologies to moderators. I just realized that I posted this in the wrong place :/