I found the problem. Its in \functions\functions_common.asp
Private Function bannedIP()
'Declare variables
Dim rsIPAddr
Dim strCheckIPAddress
Dim strUserIPAddress
Dim blnIPMatched
'Intilise variable
blnIPMatched = False
'Get the users IP
strUserIPAddress = getIP()
'Intialise the ADO recordset object
Set rsIPAddr = Server.CreateObject("ADODB.Recordset")
'Get any banned IP address from the database
'Initalise the strSQL variable with an SQL statement to query the database to count the
number of topics in the forums
If strDatabaseType = "SQLServer" Then
strSQL = "EXECUTE " & strDbProc & "BannedIPs"
Else
strSQL = "SELECT " & strDbTable & "BanList.IP FROM " & strDbTable & "BanList
WHERE " & strDbTable & "BanList.IP Is Not Null;"
End If
'Query the database
rsIPAddr.Open strSQL, adoCon
'Loop through the IP address and check 'em out
Do while NOT rsIPAddr.EOF
'Get the IP address to check from the recordset
strCheckIPAddress = rsIPAddr("IP")
'See if we need to check the IP range or just one IP address
'If the last character is a * then this is a wildcard range to be checked
If Right(strCheckIPAddress, 1) = "*" Then
'Remove the wildcard charcter form the IP
strCheckIPAddress = Replace(strCheckIPAddress, "*", "", 1, -1, 1)
'Trim the users IP to the same length as the IP range to check
strUserIPAddress = Mid(strUserIPAddress, 1, Len(strCheckIPAddress))
'See if whats left of the IP matches
If strCheckIPAddress = strUserIPAddress Then blnIPMatched = True
'Else check the IP address metches
Else
'Else check to see if the IP address match
If strCheckIPAddress = strUserIPAddress Then blnIPMatched = True
End If
'Move to the next record
rsIPAddr.MoveNext
Loop
'Clean up
rsIPAddr.Close
Set rsIPAddr = Nothing
'Return the function
bannedIP = blnIPMatched
End Function
Prior to the loop is when the users IP address is obtained. Within the loop, if the users IP is going to be compared to an IP that has an * in it, the users IP (strUserIPAddress) is trimmed to match the length of the banned IP minus the *. In the loop the users IP is not restored to its proper length, so it remains trimmed as it is compared to the rest of the banned IPs.
One solution would be to add the line strUserIPAddress = getIP() after the lines:
'See if whats left of the IP matches
If strCheckIPAddress = strUserIPAddress Then blnIPMatched = True
We've tested this out and IP banning is now working excellent for us. 