[SCRIPT] detect_bans.py

This script allows you to detect possible evading players, this is verified through the player's IP ranges, this also verify through the country, city, ISP and region.
This detection starting from 3 ranges of pairs of numbers (x.x.x.o) (obviously).

For example:
Player IP = 193.33.144.96
IP ban = 193.33.144.34

In this case there are 3 ranges of similarity, which would be:  193.33.144, the same happens if this find 2 ranges of similarity.
In 3 ranges or 2, the matches of Country, city, ISP and region may vary.

Messages:
"Ban evader detected" => If it detects 4 matches (country, isp, city, region)
"Possible ban evader detected" => If it detect 2-3 matches (this may vary)
"Unlikely ban evader detected" => If it detects 1 match (country)
"No matches detected" => If there is no match (this is only shown in the /compare command)
"1 range ip detected but 0 matches found" => in case there is 1 range of similarity between both IPs but they are from different countries (such as 181.1.75.205 (ARG) 181.141.75.205 (CO))

The detection by one only range (1 range ip detected but 0 matches found / Unlikely ban evader detected) by default is disabled, this is to avoid that warnings are shown frequently, but if you want to activate it you can use the command /toggleunlikely

Optional command:

/compare <ip1> <ip2>
This command is used to see the data of both IP, the range of matches will also be shown.

Example:
/compare 25.9.98.125 25.9.98.123
IP 25.9.98.125: Country: United Kingdom, City: Woodstock, ISP: UK Ministry of Defence, Region: England
IP 25.9.98.123: Country: United Kingdom, City: Woodstock, ISP: UK Ministry of Defence, Region: England
Matches: country/city/isp/region, type: Ban evader detected

PD:
When an evader or possible evader is detected, the script will send a warning to the administrators, moderators and guards that are available on the server, as well as on the IRC, something like this:

This would be better if a bot did it in the IRC, so we can verify more easily if a player is evader through the country/isp/city/region,  this will give us more precision even if both IPs do not match.
I will do it when I have time, thanks.


detect_bans.py (10.3 KB)