Virus Scanner / File scanner
 

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

Virus Scanner / File scanner

Started by ??????Hawk??????, 09 August, 2005, 23:38:14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

??????Hawk??????

 
 
 
 
 
 
---A sort of Virus Checker  ( could be used for any files )
---By ??????Hawk??????
---use the right click pc-Scan to scan a user
---Requires viruslist.txt in your scripts folder containig a list of virus file names ( or any file names )
---Requested by RipTorn  09-08-2005
 
bot_name1 = "Scanner"
 
Files = {}
sCounter = 0 
function Main()
	loadfile("viruslist.txt", Files)
	SetTimer(1000)
end




function OnTimer()
		sCounter = sCounter + 1
		tNick:SendData("$Search Hub:"..bot_name1.." F?T?0?1?"..Files[sCounter]) 
		if sCounter == table.getn(Files) then
			StopTimer()
			sCounter = 0
		end
end



function OpConnected(curUser)
curUser:SendData("$UserCommand 1 2 pc-scan\\-=scan user=-$<%[mynick]> !scan %[nick]||")
end


function ChatArrival(user, data)
		local sString = ""
		data = string.sub(data,1,string.len(data)-1)
		local _,_,Cmd,Nick = string.find( data, "%b<>%s+(%S+)%s+(%S+).*" )
		if Cmd == "!scan" and Nick and user.bOperator then
			tNick = GetItemByName(Nick)
				if tNick then
					StopTimer()
					sCounter = 0
					StartTimer() 
					return 1
				else
					user:SendData(bot_name1,Nick.." Is Offline")
					return 1
				end
		end
end

function SRArrival(curUser,data)
	local _,_,nick = string.find( data, "\05(%S*)|$" ) 
	if nick == bot_name1  then 
		local _,_, test = string.find(data,"$SR%s+%S+(.*)%d+%s+%d+/%d+")
		Reason = FindWhat(data)		
		if test == nil then
			test = " Cant Find Folder. "
		end						
		curUser:SendPM(bot_name1,"! ! ! W A R N I N G ! ! ! you are Infected with "..Reason..".. found in the directory: "..test)								 
		curUser:TempBan() 
		StopTimer()
		sCounter = 0
	end 
end


function FindWhat(data) 
	for i,v in Files do 
		if( string.find(data, i)) then 
			return v 
		end 
	end 
end 



function loadfile(filetoload, TabletoLoad)
local f,e = io.open(filetoload,"r")
	if f then
	local counter = 1
		while 1 do
			line = f:read("*l")
				if line ==  nil then
					break
				end
			TabletoLoad[counter]=line
			counter = counter + 1
		end
		 f:close(f)
	else
		f,e = io.open(filetoload, "w" )
		f:write()
		f:close()
	end
end
 
 

TiMeTrAVelleR

option to add lines  by command ( virus etc )  in txt file would be nice

greetzz  TT

(-=TrIp-iN-SuN=-)

[05:18] Syntax ...tings\andrey\Desktop\New Folder (4)\scripts\scan.lua:22: attempt to concatenate field `?' (a nil value) it's not work when i scan it's type me this error

??????Hawk??????

#3
Code Removed

 
 

Inflictor

interesting Thanks will give it a run later in the week
Devils Designs Web Templates, Forum Templates, Downloads are free[/color][/url]

Riptorn

#5
list of known virus spyware torjans i know sharing windows is bad but just for a 2 min scan aint to risky this list will find more than most virus scanner do now as i made it from many sources 2 more lists coming soon name this viruslist.txt

download list here

TiMeTrAVelleR

Thanks  Hawk :)

Greets  TT

TiMeTrAVelleR

Got this

[20:17] Syntax ...\Bureaublad\TiMe`s PriVate\scripts\Virus scanner.lua:38: attempt to index global `tNick' (a nil value)


Greetz TT

??????Hawk??????

#8
Was you scanning an op when you got this error  ???

try this one....

 ---A sort of Virus Checker V2  ( could be used for any files )
---By ??????Hawk??????  09-08-2005 updated 10-08-2005
---use the right click pc-scan\\-=scan user=- to scan a user
---use the right click pc-scan\\-=Add File=- to add a file to the scan list
---Requires viruslist.txt in your scripts folder containig a list of virus file names ( or any file names )
---Requested by RipTorn  
 
bot_name1 = "Scanner"
 
Files = {}
sCounter = 0 
function Main()
	loadfile("viruslist.txt", Files)
	SetTimer(1000)
end




function OnTimer()
	if tNick then
		sCounter = sCounter + 1
		tNick:SendData("$Search Hub:"..bot_name1.." F?T?0?1?"..Files[sCounter]) 
		if sCounter == table.getn(Files) then
			StopTimer()
			sCounter = 0
			SendToOps(bot_name1," Scanning Complete.... ")
		end
	else
		StopTimer()
		sCounter = 0
	end
end



function OpConnected(curUser)
curUser:SendData("$UserCommand 1 2 pc-scan\\-=scan user=-$<%[mynick]> !scan %[nick]||")
curUser:SendData("$UserCommand 1 2 pc-scan\\-=Add File=-$<%[mynick]> !addfile %[line:FIle]||")
end

OpDisconnected = UserDisconnected
function UserDisconnected(curUser) 
	 if curUser.sName == tNick.sName then
		StopTimer()
		sCounter = 0
	end
end


function ChatArrival(user, data)
		local sString = ""
		data = string.sub(data,1,string.len(data)-1)
		local _,_,Cmd,Nick = string.find( data, "%b<>%s+(%S+)%s+(%S+).*" )

		if Cmd == "!scan" and Nick and user.bOperator then
			tNick = GetItemByName(Nick)
				if tNick then
					SendToOps(bot_name1,user.sName.." Activated File Scan.... Now Scanning.... "..tNick.sName)
					StopTimer()
					sCounter = 0
					StartTimer() 
					return 1
				else
					user:SendData(bot_name1,Nick.." Is Offline")
					return 1
				end
		elseif Cmd == "!addfile" and Nick and user.bOperator then
			Files[(table.getn(Files) + 1)] = Nick
			SaveTable("viruslist.txt", Files)
			user:SendData(bot_name1,Nick.." Has been added to the Scan List.")
			return 1
		end
end

function SRArrival(curUser,data)
	local _,_,nick = string.find( data, "\05(%S*)|$" ) 
	if nick == bot_name1  then 
		local _,_, test = string.find(data,"$SR%s+%S+(.*)%d+%s+%d+/%d+")
		Reason = FindWhat(data)		
		if test == nil then
			test = " Cant Find Folder. "
		end						
		curUser:SendPM(bot_name1,"! ! ! W A R N I N G ! ! ! you are Infected with "..Reason..".. found in the Folder: "..test)								 
		SendToOps(bot_name1," "..curUser.sName.." Has been Kicked for Sharing "..Reason.." Found in folder:-"..test)
		curUser:TempBan() 
		StopTimer()
		sCounter = 0
	end 
end


function FindWhat(data) 
	for i,v in Files do 
		if( string.find(data, v)) then 
			return v 
		end 
	end 
end 

function SaveTable(filetoSave, TabletoSave)
local a , b
local f,e = io.open(filetoSave, "w" )
		for a,b in TabletoSave do
			f:write(b.."\n")
		 end
	 f:close()
end

function loadfile(filetoload, TabletoLoad)
local f,e = io.open(filetoload,"r")
	if f then
	local counter = 1
		while 1 do
			line = f:read("*l")
				if line ==  nil then
					break
				end
			TabletoLoad[counter]=line
			counter = counter + 1
		end
		 f:close(f)
	else
		f,e = io.open(filetoload, "w" )
		f:write()
		f:close()
	end
end

TiMeTrAVelleR

#9
only scanned a user (reg)

[11:36] Syntax ...\Bureaublad\TiMe`s PriVate\scripts\Virus scanner.lua:44: attempt to index global `tNick' (a nil value)


greetzz TT

HillyBilly

#10
I tested it with the last script.

The error appears when i first checked an user in this case piraat after it finished user piraat reconnect or logs off

VirusScanner.lua5.lua:85: attempt to index global `tNick' (a nil value)

Cheers HB

kunal

[21:50] Syntax C:\ptokax0.3.3.21\scripts\virus scanner.lua:44: attempt to index global `tNick' (a nil value)

kuipie

Nice job on the scanner.
Maybe someting can be added to it.
it would be nice when the op who request the scan can get a pm to when a file is found.

Sarpanch

I think i have a problem with mine as wen i search it says searching but doesnt let me know when it finishes the search because ive had a little look through and it does say that it will send a pm back to the ops when its done, what could be wrong?

LiqUiD~TrolL

hello ppl , i m looking this tread again and again Hawk anything new in this script ???


did you find anything ??? where it was the prob ??

new version ??
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Syphrone-NL

I get this error

[14:07] Syntax ...blad\Mijn Hubbie\0.3.3.21.nt.dbg\scripts\scanner.lua:44: attempt to index global `tNick' (a nil value)

line 44 is in my script:

if curUser.sName == tNick.sName then

of this:

OpDisconnected = UserDisconnected
function UserDisconnected(curUser) 
	 if curUser.sName == tNick.sName then
		StopTimer()
		sCounter = 0
	end
end

can somebody fix that for me :-)
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

Spykez

Syntax ...pyez\Desktop\--=[ TTC ]=--\scripts\Virus Scanner.lua:72: attempt to index global `tNick' (a nil value)

Spykez


??????Hawk??????

hi there  ...  

im goin out right now  ..  but i will work again on this one when i return  ...


 ??????Hawk??????;)  ;)

Spykez


6Marilyn6Manson6


??????Hawk??????

#21
sorry for the delay  ...  

try this one  .....

---A sort of Virus Checker V3  ( could be used for any files )
---By ??????Hawk??????  09/08/2005 updated 10/08/2005-- 02/11/2005
---use the right click pc-scan\\-=scan user=- to scan a user
---use the right click pc-scan\\-=Add File=- to add a file to the scan list
---Requires viruslist.txt in your scripts folder containig a list of virus file names ( or any file names )
---Requested by RipTorn  
 
bot_name1 = "Scanner"
 
Files = {}
sCounter = 0 
function Main()
	loadfile("viruslist.txt", Files)
	SetTimer(1000)
end

function OnTimer()
	if tNick then
		sCounter = sCounter + 1
		tNick:SendData("$Search Hub:"..bot_name1.." F?T?0?1?"..Files[sCounter]) 
		if sCounter == table.getn(Files) then
			StopTimer()
			sCounter = 0
			SendToOps(bot_name1," Scanning Complete.... ")
		end
	else
		StopTimer()
		sCounter = 0
	end
end

function OpConnected(curUser)
	curUser:SendData("$UserCommand 1 2 pc-scan\\-=scan user=-$<%[mynick]> !scan %[nick]||")
	curUser:SendData("$UserCommand 1 2 pc-scan\\-=Add File=-$<%[mynick]> !addfile %[line:FIle]||")
end

function UserDisconnected(curUser) 
	 if tNick and curUser.sName == tNick.sName then
		StopTimer()
		tNick = nil
		sCounter = 0
	end
end

function ChatArrival(user, data)
		local sString = ""
		data = string.sub(data,1,string.len(data)-1)
		local _,_,Cmd,Nick = string.find( data, "%b<>%s+(%S+)%s+(%S+).*" )

		if Cmd == "!scan" and Nick and user.bOperator then
			if tNick then
				user:SendData(bot_name1,"Scan in Progres on user "..tNick.sName)
				return 1
			else
				tNick = GetItemByName(Nick)
					if tNick and not tNick.bOperator then
						SendToOps(bot_name1,user.sName.." Activated File Scan.... Now Scanning.... "..tNick.sName)
						StopTimer()
						sCounter = 0
						StartTimer() 
						return 1
					else
						user:SendData(bot_name1,Nick.." Is Offline or an Operator")
						return 1
					end
			end
		elseif Cmd == "!addfile" and Nick and user.bOperator then
			Files[(table.getn(Files) + 1)] = Nick
			SaveTable("viruslist.txt", Files)
			user:SendData(bot_name1,Nick.." Has been added to the Scan List.")
			return 1
		end
end

function SRArrival(curUser,data)
	local _,_,nick = string.find( data, "\05(%S*)|$" ) 
	if nick == bot_name1  then 
		local _,_, test = string.find(data,"$SR%s+%S+(.*)%d+%s+%d+/%d+")
		test = test or " Cant Find Folder. "
		local Reason = FindWhat(data) or " File Unknown "
		curUser:SendPM(bot_name1,"! ! ! W A R N I N G ! ! ! you are Infected with "..Reason..".. found in the Folder: "..test)								 
		SendToOps(bot_name1," "..curUser.sName.." Has been Kicked for Sharing "..Reason.." Found in folder:-"..test)
		curUser:TempBan() 
		tNick = nil
		StopTimer()
		sCounter = 0
	end 
end

function FindWhat(FileData) 
	for i,v in Files do 
		if string.find(string.lower(FileData), v) then 
			return v 
		end 
	end 
end 

function SaveTable(filetoSave, TabletoSave)
local a , b
local f,e = io.open(filetoSave, "w" )
		for a,b in TabletoSave do
			f:write(b.."\n")
		 end
	 f:close()
end

function loadfile(filetoload, TabletoLoad)
local f,e = io.open(filetoload,"r")
	if f then
	local counter = 1
		while 1 do
			line = f:read("*l")
				if line ==  nil then
					break
				end
			TabletoLoad[counter]=string.lower(line)
			counter = counter + 1
		end
		 f:close(f)
	else
		f,e = io.open(filetoload, "w" )
		f:write()
		f:close()
	end
end
 
 


??????Hawk??????

6Marilyn6Manson6

Go go go king go go :D. Very nice :)

kuipie

\Ptokax\scripts\virusscanner.lua:39: attempt to index global `tNick' (a nil value)

Must be around this part
function UserDisconnected(curUser) 
	 if curUser.sName == tNick.sName then
		StopTimer()
		tNick = nil
		sCounter = 0
	end
end

??????Hawk??????

Edited the above post  ... :))

SMF spam blocked by CleanTalk