PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: ??????Hawk?????? on 09 August, 2005, 23:38:14

Title: Virus Scanner / File scanner
Post by: ??????Hawk?????? on 09 August, 2005, 23:38:14

 
 
 
 
 
 
---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
 
 
Title:
Post by: TiMeTrAVelleR on 10 August, 2005, 00:43:52
option to add lines  by command ( virus etc )  in txt file would be nice

greetzz  TT
Title:
Post by: (-=TrIp-iN-SuN=-) on 10 August, 2005, 04:20:08
[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
Title:
Post by: ??????Hawk?????? on 10 August, 2005, 18:26:06

Code Removed

 
 
Title:
Post by: Inflictor on 10 August, 2005, 18:31:59
interesting Thanks will give it a run later in the week
Title: list of known virus
Post by: Riptorn on 10 August, 2005, 18:50:41
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 (http://www.forum.freedom-network.org.uk/files/Riptorn/viruslist.txt)
Title:
Post by: TiMeTrAVelleR on 10 August, 2005, 20:12:00
Thanks  Hawk :)

Greets  TT
Title:
Post by: TiMeTrAVelleR on 10 August, 2005, 20:28:46
Got this

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


Greetz TT
Title:
Post by: ??????Hawk?????? on 10 August, 2005, 22:28:54
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
Title:
Post by: TiMeTrAVelleR on 11 August, 2005, 10:38:16
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
Title:
Post by: HillyBilly on 11 August, 2005, 20:58:56
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
Title:
Post by: kunal on 03 September, 2005, 18:22:50
[21:50] Syntax C:\ptokax0.3.3.21\scripts\virus scanner.lua:44: attempt to index global `tNick' (a nil value)
Title:
Post by: kuipie on 06 September, 2005, 10:37:47
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.
Title:
Post by: Sarpanch on 11 September, 2005, 14:23:03
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?
Title: HAWK
Post by: LiqUiD~TrolL on 26 September, 2005, 03:51:40
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 ??
Title:
Post by: Syphrone-NL on 19 October, 2005, 19:29:31
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 :-)
Title:
Post by: Spykez on 23 October, 2005, 13:17:20
Syntax ...pyez\Desktop\--=[ TTC ]=--\scripts\Virus Scanner.lua:72: attempt to index global `tNick' (a nil value)
Title:
Post by: Spykez on 23 October, 2005, 13:19:05
awsome Idea btw
Title:
Post by: ??????Hawk?????? on 23 October, 2005, 13:34:25
hi there  ...  

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


 ??????Hawk??????;)  ;)
Title:
Post by: Spykez on 26 October, 2005, 16:24:07
any news???   :D
Title:
Post by: 6Marilyn6Manson6 on 26 October, 2005, 16:33:34
no news :D
Title:
Post by: ??????Hawk?????? on 02 November, 2005, 20:14:11
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??????
Title:
Post by: 6Marilyn6Manson6 on 02 November, 2005, 20:33:28
Go go go king go go :D. Very nice :)
Title: Still error
Post by: kuipie on 02 November, 2005, 21:16:39
\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
Title:
Post by: ??????Hawk?????? on 02 November, 2005, 21:36:20
Edited the above post  ... :))
Title:
Post by: Syphrone-NL on 17 November, 2005, 21:23:47
got this error:

[21:21] Syntax ...ad\Mijn Hubbie\0.3.3.21.nt.dbg\scripts\v-scanner.lua:20: attempt to concatenate field `?' (a nil value)

of this line:

tNick:SendData("$Search Hub:"..bot_name1.." F?T?0?1?"..Files[sCounter])

of this:

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
Title: re..
Post by: [NL]Tazzie on 17 November, 2005, 22:12:33
Made some changes to make rightclicker work.
And dont have the error mentioned above.

---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
---Changed the rightclicker to make it work by Tazzie 

bot_name1 = "Scanner"

-- Sets who can use release script
Allowed = {
[0] = 1, -- Master
[1] = 0, -- Operator
[2] = 0, -- VIPs
[3] = 0, -- Regs
[4] = 0, -- Moderator
[5] = 1, -- Netfounder
}

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 3 pc-scan\\**Your Online "..bot_name1.."**$<%[mynick]>%[nick]||")
curUser:SendData("$UserCommand 1 3 pc-scan\\-=scan user=-\\Scan a user$<%[mynick]> !scan %[nick]||")
curUser:SendData("$UserCommand 1 3 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
Title: Re: Virus Scanner / File scanner
Post by: Spykez on 14 April, 2006, 05:07:40
Alright, a lil blast from the past, how do we know if a file is infect, what kind of alert is there when we scan? Also is that virus list above us up to date or where can I get a current threat list.
Title: Re: Virus Scanner / File scanner
Post by: DEEP-GOA on 30 April, 2006, 09:44:22
Quote from: Spykez on 14 April, 2006, 05:07:40
Alright, a lil blast from the past, how do we know if a file is infect, what kind of alert is there when we scan?

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()

Title: Re: Virus Scanner / File scanner
Post by: cowboydaddy on 27 July, 2006, 19:11:00
is there somebody that got the virus list for me?
the link somewhere here is not working
thanks