IP Ranges in the permanent ban list
 

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

IP Ranges in the permanent ban list

Started by Mardeg, 13 May, 2004, 20:58:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mardeg

Ok only noticed this after having ptokax running for a long time now. If I double-click on the permanent ban list I get a dialog asking "Nick IP or Partial IP to ban:" and found out I can add things like  "150.101.*" (example only) and anything in that range will be banned.

I know banning 65355 possible combinations of IPs is drastic and have only used it on very rare occasions where a particularly persisent user just won't give up. I only wish this function was possible in the tempban list.

btw, how can IP ranges like this be added via a script? I tried

local _,_,iprng = strfind(user.sIP,"(%d+%.%d+%.)%d+%.%d+")
iprng = iprng.."*"
user:Ban(iprng)

but that didn't work, and typing

!banip 150.101.*

only returns syntax error by hub security.

nEgativE

#1
I think that could b a idea for next ptokax public beta.

I use this IP Range Script by Phatty

--//RangeBlaster v2.07 by Phatty
--//IP Keys written by John, and Phatty

Bot = "Bot_name" 

Ranges = {} 

function Main() 
	frmHub:RegBot(Bot)
	LoadIps()
end 

function LoadIps()
	local tmp = 0
	local handle = openfile("Ranges.dat","r")
	line = read(handle)
	while line do
		tmp = tmp + 1
		local s,e,ipr1,ipr2 = strfind(line,"(%S+)|(%S+)")
		if ipr2 == nil then
			SendToAll(Bot,"Error on line "..line)
		end
		local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(ipr1, "(%d*).(%d*).(%d*).(%d*)") 
		local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(ipr2, "(%d*).(%d*).(%d*).(%d*)")
		si1 = CheckNumber(ipa1)..CheckNumber(ipb1)..CheckNumber(ipc1)..CheckNumber(ipd1)
		si2 = CheckNumber(ipa2)..CheckNumber(ipb2)..CheckNumber(ipc2)..CheckNumber(ipd2)
		Ranges[si1] = si2
	line = read(handle)
	end

end

function Blocked(userip) 
	local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
	checker = CheckNumber(range1)..CheckNumber(range2)..CheckNumber(range3)..CheckNumber(range4)

	--SendToAll(Bot,"IP-Test..."..checker)

	for i,p in Ranges do 
		local s,e,xstart = strfind(i, "(%d*)") 
		local s,e,xend = strfind(p, "(%d*)")
	
		if checker > xstart and checker < xend then
			collectgarbage()
			flush()
			return 1
		else
		end
	end	
end

function CheckNumber(number)
	numbera = tonumber(number)
	if numbera < 10 then
		numbera = "00"..number
	elseif numbera < 100 then
		numbera = "0"..number
	else
		numbera = number
	end
	return numbera
end

function DataArrival(user,data)
	if strsub(data, 1, 8) == "$Version" then
		if Blocked(user.sIP) == 1 then 
			user:SendData(Bot, "IP - Range Banido no LusoBrasil Hub.") 
			SendToOps(Bot, "? OP MSG ? Usu?rio(a): "..user.sName..", com o IP: ["..user.sIP.."] foi desconectado do Hub, motivo: IP - Range Banido.") 
			user:TempBan() 
			user:Disconnect() 
		end
	end
end


Make a file in scripts dir/ "Ranges.dat"

150.101.0.0|150.101.255.255

SMF spam blocked by CleanTalk