Good evening
Is he(it) possible to make a script to block the VPN
Example Peer2Me
I belive it's better to use PtokaX inbuild !rangeban <fromIP> <toIP> <reason> - permanently ban given IP range.
Grab vpn:s ip and check for entire range on http://www.dnsstuff.com or www.ripe.net
Less stress on the hub then via script and !rangeban allowes certain profiles to use vpn if you mark that in Profiles/settings.
If no users should be able to use vpn, then use !fullrangeban <fromIP> <toIP> <reason> - permanently ban given IP range.
If you must use script, try RangeFilter at http://forum.ptokax.org/index.php?topic=7369.0
Here is an older script who can detect VPN by ACTIVE users. I didn't upgrade it to the newer LUA version. Maybe someone else could/would :-). I don't have time to do this @ short notice.
It's a start ;D
-- Simple VPN detector by TTB
-- Thanx plop for the concept!
-- 16 juni 2006
-- Touched by GeceBekcisi (2006-06-15)
-- Added active search IP checking by GeceBekcisi (2006-06-16)
----------------------------------------
bot = "VPN-detector"
-- Safe IP table with decimal forms of some IP ranges, decimal forms are precalculated to save some CPU clocks :)
SafeIP = {
{2130706432, 2147483647}, -- 127.0.0.0,127.255.255.255
{167772160,184549375}, -- 10.0.0.0,10.255.255.255
{2886729728,2887778303}, -- 172.16.0.0,172.31.255.255
{3232235520,3232301055}, -- 192.168.0.0,192.168.255.255
}
function ConnectToMeArrival(curUser,data)
if not curUser.bOperator then
local _,_,sIP = string.find(data,"$ConnectToMe%s+%S+%s+(%d+%.%d+%.%d+%.%d+):%d+|")
if sIP then return CheckUser(curUser,sIP) end
end
end
function SearchArrival(curUser, data)
if curUser.bActive and not curUser.bOperator then
local _,_,sIP = string.find(data, "$Search (%d+%.%d+%.%d+%.%d+):%d+%s+%a%?%a%?%d+%?%d+%?.*|")
if sIP then return CheckUser(curUser,sIP) end
end
end
function OnError(ErrorMsg)
SendPmToOps(bot,"[ERROR] "..frmHub:GetHubName().." ---> "..ErrorMsg)
end
function CheckUser(curUser,sIP)
if curUser and sIP and sIP ~= curUser.sIP then
local DecIP = IPtoDEC(sIP)
local a = 0
for Index,Table in ipairs(SafeIP) do -- (Newbie hint: With this notation, "SafeIP[Index]" equals to "Table")
if not (DecIP > Table[1] and DecIP < Table[2]) then
a = 0
else
a = a + 1
end
end
if a == 0 then
SendPmToOps(bot,frmHub:GetHubName().." ---> Nick = "..curUser.sName.." UserIP = "..curUser.sIP.." ConnectIP = "..sIP.." Possible (VPN)violation -> PLEASE (SPEED)CHECK!")
return 1
else
--curUser:SendData(bot,"Your client's IP is incorrectly configured. Enter the correct one in the IP field in your client settings or try passive mode. Your current ip is: "..curUser.sIP)
--SendPmToOps(bot,frmHub:GetHubName().." ---> Nick = "..curUser.sName.." UserIP = "..curUser.sIP.." ConnectIP = "..sIP.." *SAFE*")
return 1
end
end
end
function IPtoDEC(sIP)
if sIP then
local _,_,a,b,c,d = string.find(sIP, "^(%d+)%.(%d+)%.(%d+)%.(%d+)$")
return a*16777216 + b*65536 + c*256 + d
end
end
--[[
RFC-1918 and RFC-3330 private address spaces:
? 127.0.0.0/8 --> 127.0.0.0 - 127.255.255.255
? 10.0.0.0/8 --> 10.0.0.0 - 10.255.255.255
? 172.16.0.0/12 --> 172.16.0.0 - 172.31.255.255
? 192.168.0.0/16 --> 192.168.0.0 - 192.168.255.255
]]--