block VPN
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

block VPN

Started by @tlantide, 18 May, 2010, 21:29:48

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

@tlantide

Good evening
Is he(it) possible to make a script to block the VPN
Example Peer2Me

Scanning

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

TTB

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
]]--
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

SMF spam blocked by CleanTalk