---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
option to add lines by command ( virus etc ) in txt file would be nice
greetzz TT
[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
Code Removed
interesting Thanks will give it a run later in the week
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)
Thanks Hawk :)
Greets TT
Got this
[20:17] Syntax ...\Bureaublad\TiMe`s PriVate\scripts\Virus scanner.lua:38: attempt to index global `tNick' (a nil value)
Greetz TT
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
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
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
[21:50] Syntax C:\ptokax0.3.3.21\scripts\virus scanner.lua:44: attempt to index global `tNick' (a nil value)
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.
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?
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 ??
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 :-)
Syntax ...pyez\Desktop\--=[ TTC ]=--\scripts\Virus Scanner.lua:72: attempt to index global `tNick' (a nil value)
awsome Idea btw
hi there ...
im goin out right now .. but i will work again on this one when i return ...
??????Hawk??????;) ;)
any news??? :D
no news :D
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??????
Go go go king go go :D. Very nice :)
\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
Edited the above post ... :))
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
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
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.
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()
is there somebody that got the virus list for me?
the link somewhere here is not working
thanks