OpSecurity.v2.02
 

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

OpSecurity.v2.02

Started by TrIp-iN-SuN, 13 September, 2006, 16:29:59

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TrIp-iN-SuN

                  -= Changelog since OpSecurity 2.01 =-

 Converted to lua 5.1 by ']['rIp?iN??uN

 chngd: changed file pxwsa.dll to pxwsa_l51.dll under libs directory


 For Download Click here http://www.mytempdir.com/926946

TopCat

Hi TrIp-iN-SuN

I got an error in the lua file

[12:02] Syntax C:\ptokax0.3.5.1.lua5.1.1\scripts\OpSecurty.lua:46: attempt to call global 'libinit' (a nil value)

could you take a look and fix it?

thx and greetings TopCat
???? TOPCAT'S HOUSE ????

topcat.no-ip.biz:411

Psycho_Chihuahua

pxwsa_l51.dll must be under ptokax root for it to work - bluebear mentioned that once
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

TopCat

Hi Psycho_Chihuahua

pxwsa_l51.dll is in the map off the ptokax death2adult runs on it to.
but still getting the error
???? TOPCAT'S HOUSE ????

topcat.no-ip.biz:411

Madman

find this line
Code: lua
libinit = package.loadlib("libs/pxwsa_l51.dll", "_libinit")

and remove libs/ and it should work....
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

TopCat

Thx Madman

Works fine now  ;D
???? TOPCAT'S HOUSE ????

topcat.no-ip.biz:411

TrIp-iN-SuN

enjoy if u don't remove this u need make folder with name libs in the folder ptokax and add this file to that folder and it's work pxwsa_l51.dll :P

Yahoo

can someone post this script plzz the .when i clicked on the link it said file removed
"BoRN FIGhTEr"

Madman

Code: lua
-- OpSecurity 0.1 Lua5
-- Small Op Account Protection script
-- by ']['yphoon™
-- thx to Mutor for helping me when being blind/stupid
-- write dynip to disable the check on the user
--// OpSecurity.v2.01
--// heaviliy modified by GeceBekcisi
-- # Added: Checking of dynamic dns hosts, you need to place pxwsa.dll under libs directory
-- # Rmved: Writing dynip to disable the check on the user since its quite useless
-- # Chngd: Nearly rewrote the whole script structure to add more flexibility
-- # Added: Commands to add, delete or show stored entries and profile level check for commands
-- # Chngd: Ban type to tempban, sometimes it takes some time for hosts to be updated and we won't want to fully ban an op accidentally
-- OpSecurity.v2.02
-- Converted to lua 5.1 by ']['rIp•iN•?uN
-- # chngd: changed file pxwsa.dll to pxwsa_l51.dll under libs directory

tSettings = {
	-- Name of your bot
	["sBotsNm"] = frmHub:GetHubBotName(),
	-- Mail adress of hub owner or anyone which are concerned with editing hosts
	["sMailAd"] = "tripsun1@walla.com",
	-- Location of stored hosts
	["sFileNm"] = "OPSecurity.tbl",
	-- Command strings
	["sAddCMD"] = "addophost",
	["sDelCMD"] = "delophost",
	["sShwCMD"] = "showopcheck",
	-- Temp ban time in minutes if IP check fails
	["iTmpBan"] = 20,
	-- Minimum profile level to access commands
	["iMinLvl"] = 5,
	-- Profile levels (works with RoboCop and default settings, do not change unless you really need to)
	["tPrfLvl"] = {	
		[-1] = 0,	-- Unreg Users
		[0] = 5,	-- Masters
		[1] = 3,	-- Operators
		[2] = 2,	-- VIPs
		[3] = 1,	-- Regs
		[4] = 4,	-- Moderators
		[5] = 6,	-- NetFounders
	},
}

-- Initializing WSA library
libinit = package.loadlib("libs/pxwsa_l51.dll", "_libinit")
libinit()

Main = function()
	local FileHandle = io.open(tSettings.sFileNm)
	if FileHandle then
		FileHandle:close()
	else
		local FileHandle = io.open(tSettings.sFileNm, "w+")
		FileHandle:write("tHosts = {\n}")
		FileHandle:close()
	end
	tFunctions.LoadFromFile(tSettings.sFileNm)
end

OnExit = function()
	tFunctions.SaveToFile(tSettings.sFileNm, tHosts, "tHosts")
end

OpConnected = function(curUser)
	if tHosts[curUser.sName] then
		local Name = curUser.sName
		if ((tHosts[Name] == curUser.sIP)  or (WSA.GetHostByName(tHosts[Name]) == curUser.sIP)) then
			curUser:SendPM(tSettings.sBotsNm,"You have passed the IP-Check!")
		else
			local InfoMsg = "\r\n\r\n\t\t• You Are Being Banned For Using A Op Account That) don't Belong To You •"..
							"\r\n\t\t• If YOU Really Are An Operator At This Hub And Just Got A New IP •"..
							"\r\n\t\t• Wait Until Your Tempban Ends And Retry After Updating Your Host Info Or •"..
							"\r\n\t\t• Just Mail To This Address And Warn Hub Owner: "..tSettings.sMailAd
			SendToOps(tSettings.sBotsNm, curUser.sName.." from "..curUser.sIP.." has been banned because user failed IP check. Check bans please")
			SendPmToOps(tSettings.sBotsNm, curUser.sName.." from "..curUser.sIP.." has been banned because user failed IP check. Check bans please")
			curUser:SendData(tSettings.sBotsNm, InfoMsg)
			curUser:TimeBan(tSettings.iTmpBan)			
			return 1
		end
	end
end

ChatArrival = function(curUser, data)
	curUser.SendMessage = curUser.SendData
	return tFunctions.GetCommands(curUser, data)
end

ToArrival = function(curUser, data)
	local s,e,to = string.find(data, "$To:%s+(%S+)%s+From:")
	if to == tSettings.sBotsNm then
		curUser.SendMessage = curUser.SendPM
		return tFunctions.GetCommands(curUser, data)
	end
end

tCommands = {}
tCommands[tSettings.sAddCMD] = function(curUser, data)
	local s,e,nick,arg  = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(.*)") 
	if nick then
		if arg then
			if tHosts[nick] then
				curUser:SendMessage(tSettings.sBotsNm, "Error: An entry for "..nick.." with IP/Host "..tHosts[nick].." is already in check list."..
				"Delete it first if you want to modify this entry.")
			else
				tHosts[nick] = arg
				tFunctions.SaveToFile(tSettings.sFileNm, tHosts, "tHosts")
				curUser:SendMessage(tSettings.sBotsNm, "You have successfully added "..nick.." with IP/Host "..arg.." to check list.")
			end
		else
			curUser:SendMessage(tSettings.sBotsNm, "Error: You have to enter a host (IP, DNS Host or just \"dynip\") Usage: !"..tSettings.sAddCMD.." <nick> <host>")
		end
	else
		curUser:SendMessage(tSettings.sBotsNm, "Error: You have to enter a nick! Usage: !"..tSettings.sAddCMD.." <nick> <host>")
	end
	return 1
end

tCommands[tSettings.sDelCMD] = function(curUser, data)
	local s,e,nick = string.find(data,"%b<>%s+%S+%s+(%S+)") 
	if nick then
		if tHosts[nick] then
			tHosts[nick] = nil
			tFunctions.SaveToFile(tSettings.sFileNm, tHosts, "tHosts")
			curUser:SendMessage(tSettings.sBotsNm, "You have successfully deleted "..nick.." from check list.")
		else
			curUser:SendMessage(tSettings.sBotsNm, "Error: There is no entry for "..nick.." in check list.")
		end
	else
		curUser:SendMessage(tSettings.sBotsNm, "Error: You have to enter a nick! Usage: !"..tSettings.sDelCMD.." <nick>")
	end
	return 1
end

tCommands[tSettings.sShwCMD] = function(curUser, data)
	local Listing,LoopCount = "",0
	for i,v in pairs(tHosts) do
		LoopCount = LoopCount + 1
		Listing = Listing.."\r\n\t"..string.format("%02d",LoopCount)..". Nick: "..i.."\r\n\t      Host: "..v..""
	end
	if LoopCount ~= 0 then
		local sMsg = "\r\n"..
			"\t"..string.rep("_",50).."\r\n"..
			"\tOP Security Host Check List\r\n"..
			"\t"..string.rep("?",50)..""..
			""..Listing.."\r\n"..
			"\t"..string.rep("_",50).."\r\n"
		curUser:SendMessage(tSettings.sBotsNm,sMsg)
	else
		local sMsg = "\r\n"..
			"\t"..string.rep("_",50).."\r\n"..
			"\tOP Security Host Check List\r\n"..
			"\t"..string.rep("?",50)..""..
			"\r\n\tNo entries found!\r\n"..
			"\t"..string.rep("_",50).."\r\n"
		curUser:SendMessage(tSettings.sBotsNm,sMsg)
	end
	return 1
end

tFunctions = {}
tFunctions.GetCommands = function(curUser, data)
	local data = string.sub(data, 1, (string.len(data)-1))
	local s,e,Command = string.find(data, "%b<>%s+%p(%S+)")
	if Command and tCommands[Command] then
		if tSettings.tPrfLvl[curUser.iProfile] >= tSettings.iMinLvl then
			return tCommands[Command](curUser, data)
		else
			curUser:SendMessage(tSettings.sBotsNm, "Error: You are not allowed to use this command!")
		end
		return 1
	end
end

tFunctions.Serialize = function(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");
	sTab = sTab or "";
	sTmp = ""
	sTmp = sTmp..sTab..sTableName.." = {\n"
	for key, value in pairs(tTable) do
		local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
		if(type(value) == "table") then
			sTmp = sTmp..tFunctions.Serialize(value, sKey, sTab.."\t");
		else
			local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end
		sTmp = sTmp..",\n"
	end
	sTmp = sTmp..sTab.."}"
	return sTmp
end

tFunctions.SaveToFile = function(file , table , tablename)
	local handle = io.open(file,"w+")
	handle:write(tFunctions.Serialize(table, tablename))
	handle:flush()
	handle:close()
end

tFunctions.LoadFromFile = function(filename)
	local f = io.open(filename)
	if f then
		local r = f:read("*a")
		f:flush()
		f:close()
		local func,err = loadstring(r)
		if func then x,err = pcall(func) end
	end
end
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Yahoo

i am getting the following error
opsecurity_v2.02.lua:65: attempt to index global 'tHosts' (a nil value)
"BoRN FIGhTEr"

Rincewind

Yahoo's problem was down to a blank OpSecurity.tbl which is now sorted.

Yahoo

thanks for all the help provided by u guys thanks a lot
"BoRN FIGhTEr"

SMF spam blocked by CleanTalk