blockipranges
 

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

blockipranges

Started by night_hawk, 20 March, 2004, 19:29:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

night_hawk

anyone know how to use this bot if they can help me with it i would really like it thank you....

-- Date: 09-06-2003
--
-- code from klownietklowniet
-- network: [ > DC - UniteD < ]
--
-- Request by Skippy
--
-- Block ip ranges. Key in table is the start of the range and the value is the end


BotName = "ipRangeR"

blockedips=

{
-- start(key) = end of range(value)
["62.36.0.0"] = "62.36.204.103"

}

function Main()
frmHub:RegBot(BotName)
end

function NewUserConnected(curUser)
if BlockedIp(curUser.sIP) == 1 then
curUser:SendPM(BotName, "Your ip belongs to an ip range that is not allowed into this hubs!")
curUser:SendPM(BotName, "You are beeing disconnected!")
SendPmToOps(BotName, "User "..curUser.sName.." with ip "..curUser.sIP.." was disconnected by "..BotName.."!")
curUser:Ban()
end

end

------------------------------------------------------------------------------------

--// This function checks to see if users ip should be blocked from entering the hub

------------------------------------------------------------------------------------

function BlockedIp(tmpip)

local r1,g1,a1,b1,c1,d1 = strfind(tmpip, "(%d*).(%d*).(%d*).(%d*)")

for s,e in blockedips do

local r2,g2,a2,b2,c2,d2 = strfind(s, "(%d*).(%d*).(%d*).(%d*)")

local r3,g3,a3,b3,c3,d3 = strfind(e, "(%d*).(%d*).(%d*).(%d*)")

if a1 > a2 and a1 < a3 then

return 1

elseif a1==a2 and a1==a3 then

if b1 > b2 and b1 < b3 then

return 1

elseif b1==b2 and b1==b3 then

if c1 > c2 and c2 < c3 then

return 1

elseif c1==c2 and c1==c3 then

if d1 > d2 and d1 < d3 then

return 1

else

return 0

end

elseif c1==c2 then

if d1 >d2 then

return 1

else

return 0

end

elseif c1==c3 then

if d1
return 1

else

return 0

end

else

return 0

end

elseif b1==b2 then

if c1>c2 then

return 1

elseif c1==c2 then

if d1 > d2 then

return 1

else

return 0

end

else

return 0

end

elseif b1==b3 then

if c1
return 1

elseif c1==c3 then

if d1
return 1

else

return 0

end

else

return 0

end

else

return 0

end

elseif a1==a2 then

if b1>b2 then

return 1

elseif b1==b2 then

if c1>c2 then

return 1

elseif c1==c2 then

if d1>c2 then

return 1

else

return 0

end

else

return 0

end

else

return 0

end

elseif a1==a3 then

if b1
return 1

elseif b1==b3 then

if c1
return 1

elseif c1==c3 then

if d1
return 1

else

return 0

end

else

return 0

end

else

return 0

end

else

return 0

end

end

end


pHaTTy

add them in

blockedips = {

["iphere"] = "totherange",
["another"] = "andanother",

}


but i used to use this in gekko, so i decided to write my own as this one is pretty slow


CLICK HERE
Resistance is futile!

night_hawk

you said you have a better one post it here please..If you do not mind and how to use it just when i was using mean machine it had peer gardain and have so much trouble with it that i when to robocop and am just looking for something to block certain ip #'s tthank you

PiRaTe

isnt there a way or a script that can read from a notepad file as i have all the ips in text format that i want to ban. If this is possible it would save me adding around 500 ip ranges manually..


hope somone can help...

PiRaTe

pHaTTy

QuoteOriginally posted by night_hawk
you said you have a better one post it here please..If you do not mind and how to use it just when i was using mean machine it had peer gardain and have so much trouble with it that i when to robocop and am just looking for something to block certain ip #'s tthank you

look on my post up there and click on CLICK HERE ;)
Resistance is futile!

night_hawk

--//RangeBlaster v2.05 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)

Bot = "RangeBlaster"

Ranges = {}

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

function LoadIps()
   local tmp = 0
   local handle = openfile("RangeBlaster/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
      Ranges[ipr1] = ipr2
   line = read(handle)
   end
   SendToAll(Bot,"Successfully loaded "..tmp)
end

function Blocked(userip)
   local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
   for i,p in Ranges do
      local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
      local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
      if range1 == ipa1 then
         if range1 < ipa1 or range1 > ipa2 then
         else
            if range2 < ipb1 or range2 > ipb2 then
            else
               if range3 < ipc1 or range3 > ipc2 then
               else
                  if range4 < ipd1 or range4 > ipd2 then
                  else
                     collectgarbage()
                     flush()
                     return 1
                  end
               end
            end
         end
      end   
   end   
end

function DataArrival(user,data)
   if strsub(data, 1, 13) == "$ValidateNick" then
      if Blocked(user.sIP) == 1 then
         user:SendData(Bot, "This hub is private, you will now be disconnected!")
         user:SendData(Bot, "Disconnecting...")
         SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
         user:Disconnect()
      end
   end
end


you mean this one ok how do i use it....

pHaTTy

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

Bot = "RangeBlaster" 

Ranges = {} 

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

function LoadIps()
	local tmp = 0
	local handle = openfile("RangeBlaster/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
	SendToAll(Bot,"Successfully loaded "..tmp)
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, 13) == "$ValidateNick" then
		if Blocked(user.sIP) == 1 then 
			user:SendData(Bot, "This hub is private, you will now be disconnected!") 
			user:SendData(Bot, "Disconnecting...") 
			SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!") 
			user:Disconnect() 
		end
	end
end

ok make a folder named RangeBlaster, then a file named Ranges.dat

and enter ranges in like so

127.0.0.0|127.0.0.2


or download gekko (latest) and take the ranges.dat from there and that has 1227 ranges already done for ya ;)
Resistance is futile!

night_hawk

where do i add the ip range #'s

[NL]trucker

night_hawk

enter your ip.s in the ipranges.dat
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


SMF spam blocked by CleanTalk