IPGuard?
 

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

IPGuard?

Started by Snowman, 04 May, 2005, 16:39:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Snowman

FINALLY!!! :))

Here is the new and reborn IPGuard? Stand-alone from my good old Mean-Machine?

Changelog:

- Changed > Rewritten for Lua v5.
- Changed > Rewritten the filters to be accurate. (It actually blocked some IP's that shouldn't be blocked before).
- Changed > Moved the "Guarding.P2P" file to a subfolder called "IPGuard?".
- Added > It's now possible to change the botname.
- Added > It's now possible to set if reports should be sent to the Ops.
- Added > a settings file in the subfolder "IPGuard?"


You can get it at the link below ;)


Snowman
\"The day Microsoft makes a product that doesn\'t suck, it will be a vacuumcleaner\"

Mean-Machine Homepage

night_hawk

i am getting this message

Syntax IPGuard?.lua:7: bad argument #1 to `lines' (No such file or directory
)
Syntax IPGuard?.lua:48: bad argument #1 to `lines' (No such file or directory
)


just to let you know cuase it is not working

bastya_elvtars

Hehe thats due to the ? fucking things up, due to Windows filesystem character encoding problems. Now why did you compile the bot? You will have to re-release it with correct settings, or decompiled. :P
Everything could have been anything else and it would have just as much meaning.

OpticaL

Remove it IPGuard isn't a registered name anyway =)

night_hawk

i will wait for snowman to look at it..

Snowman

Hi to all of you.

The ? is NOT the problem.
Note that the Guarding.P2P AND the settings.dat MUST reside in the subfolder IPGuard? or it WILL fail with the error you have seen.

It works great here :)


Snowman
\"The day Microsoft makes a product that doesn\'t suck, it will be a vacuumcleaner\"

Mean-Machine Homepage

bastya_elvtars

QuoteOriginally posted by Snowman
The ? is NOT the problem.

Such characters are still dangerous to use in folder names, especially when users have no opportunity to change it if they have problems.
Everything could have been anything else and it would have just as much meaning.

Typhoon

here's another version.. tested quickly and worked...

--// a peerguardian script ..
--// by Typhoon?/Ratcom_Typhoon?
--// 09-05-2004 
--// idea and code from NXS-4 by NightLitch
-- rewrote to Lua 5 30042005

---- setup
tSetting = {
	GuardianCheck = 1,
	notifyOps = 1,
	BotName = frmHub:GetHubBotName(),
	GuardianFile = "peerguard/Guarding.P2P",}

---- setup end

Guard = {}

function Main()
       LoadTable(Guard,tSetting.GuardianFile) 
end


function NewUserConnected(curUser)
	if tSetting.GuardianCheck==1 then
		local check,comp = BlockGuard(curUser.sIP)
		if check == "fail" then
		if comp ~= nil then com = comp else com = "Unknown" end
			if tSetting.notifyOps==1 then
				curUser:SendData(tSetting.BotName, "Your Ip is not allowed in here,bye bye")
				curUser:Disconnect()
				SendPmToOps(tSetting.BotName,"*** "..curUser.sName.." - ( "..curUser.sIP.." ) from Company \" "..com.." \" tried to login! ***")
			end
		end
	end
end



function BlockGuard(ip)
	local _,_,a,b,c,d = string.find(ip, "(%d*).(%d*).(%d*).(%d*)")
	if ( tonumber(a) and tonumber(b) and tonumber(c) and tonumber(d) ) then
		local uip = ComputeIP(ip)
		if uip then
			for range,comp in pairs(Guard) do
				local _,_,r1,r2 = string.find(range, "(.*)-(.*)")
				r1 = ComputeIP(r1)
				r2 = ComputeIP(r2)
				if uip>=r1 and uip<=r2 then
					return "fail",comp
				end
			end
		end
	end
end

function ComputeIP(curIP)
	local _,_,a,b,c,d = string.find(curIP, "(%d+).(%d+).(%d+).(%d+)")
	return a*16777216 + b*65536 + c*256 + d
end

function LoadTable(table,file)
	local f = io.open(file)
	if f then
		for line in f:lines() do
			local s,e,ind,val = string.find( line, "(.*):(.*)")
			table[val]=ind
    	end
		f:flush()
  		f:close()
	end
end

just make a folder called "peerguard" and place the Guarding.p2p file inside it

feel free to extend improve old convert from lua 4 could be improved much more i guess

Typhoon?



Snowman

As almost everyone uses Windows XP with Unicode support these days then this AND a lot of other special characters can be used freely.

But if someone still have problems with it then please drop a note...


Snowman
\"The day Microsoft makes a product that doesn\'t suck, it will be a vacuumcleaner\"

Mean-Machine Homepage

bastya_elvtars

QuoteOriginally posted by Snowman
As almost everyone uses Windows XP with Unicode support these days then this AND a lot of other special characters can be used freely.

Better not discuss this 'feature' here, but search me on MSN and I will tell you about this second-to-none Unicode support. My idea was just part of the 'play safe policy'.
Everything could have been anything else and it would have just as much meaning.

sander815

please change this to not use the "'tm" marking, i cannot use it on my win2000

Snowman

v3.0.65 released.

- Changed > Removed the Trademark logo due to Win2K incompability.


Snowman
\"The day Microsoft makes a product that doesn\'t suck, it will be a vacuumcleaner\"

Mean-Machine Homepage

sander815

can you release it as not compiled maybe?
i want to be able to change its nick etc

Snowman

sander815:

It IS possible to edit the name... Read the readme...


Snowman
\"The day Microsoft makes a product that doesn\'t suck, it will be a vacuumcleaner\"

Mean-Machine Homepage

SMF spam blocked by CleanTalk