PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: BoJlk on 03 October, 2004, 19:14:41

Title: forbidden Files Check
Post by: BoJlk on 03 October, 2004, 19:14:41
I'm looking for a Simple Bot to search the file list for
[Program files, Windows folder, Documents and settings]

I'm using DCDM v0.308
Maybe there is a RAW command for that?
Title:
Post by: WickeD on 03 October, 2004, 19:38:15
Try this one my m8!


-- BadFilesDetecter V: 1.0 by [ES]latinmusic. Date: 05/11/2003
-- Base on Illegalist by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- Modificed by Leo (for music hub)
-- Modified by nErBoS
-- Operators are now checked as normal users
-- Some extensions added
-- All known bugs fixed by ----------->>> OpiumVolage

BotName = "![BadFilesDetecter]!?"
MessageToSend = " are not allowed in this hub."
time = 3 --Value in minutes
Files = {
[".dll"]="No .dll files in this hub, you have been banned for "..time.." minutes.",
[".sys"]="No .sys files in this hub, you have been banned for "..time.." minutes.",
[".ini"]="No .ini files in this hub, you have been banned for "..time.." minutes.",
[".php"]="No .php files in this hub, you have been banned for "..time.." minutes.",
[".hlp"]="No .hlp files in this hub, you have been banned for "..time.." minutes.",
[".lnk"]="No .lnk files in this hub, you have been banned for "..time.." minutes.",
[".cue"]="No .cue files in this hub, you have been banned for "..time.." minutes.",
[".pkg"]="No .pkg files in this hub, you have been banned for "..time.." minutes.",
[".lib"]="No .lib files in this hub, you have been banned for "..time.." minutes.",
[".ins"]="No .ins files in this hub, you have been banned for "..time.." minutes.",
[".cmd"]="No .cmd files in this hub, you have been banned for "..time.." minutes.",
[".bat"]="No .bat files in this hub, you have been banned for "..time.." minutes.",
[".cod"]="No .cod files in this hub, you have been banned for "..time.." minutes.",
[".cox"]="No .cox files in this hub, you have been banned for "..time.." minutes.",
[".loc"]="No .loc files in this hub, you have been banned for "..time.." minutes.",
[".cnt"]="No .cnt files in this hub, you have been banned for "..time.." minutes.",
[".vxd"]="No .vxd files in this hub, you have been banned for "..time.." minutes.",
[".vga"]="No .vga files in this hub, you have been banned for "..time.." minutes.",
[".stb"]="No .stb files in this hub, you have been banned for "..time.." minutes.",
[".chp"]="No .chp files in this hub, you have been banned for "..time.." minutes.",
[".nrg"]="No .nrg files in this hub, you have been banned for "..time.." minutes.",
[".iso"]="No .iso files in this hub, you have been banned for "..time.." minutes.",
[".vob"]="No .vob files in this hub, you have been banned for "..time.." minutes.",
[".pas"]="No .pas files in this hub, you have been banned for "..time.." minutes.",
[".vcf"]="No .vcf files in this hub, you have been banned for "..time.." minutes.",
[".dfm"]="No .dfm files in this hub, you have been banned for "..time.." minutes.",
[".res"]="No .res files in this hub, you have been banned for "..time.." minutes.",
[".reg"]="No .reg files in this hub, you have been banned for "..time.." minutes.",
[".vdi"]="No .vdi files in this hub, you have been banned for "..time.." minutes.",
[".map"]="No .map files in this hub, you have been banned for "..time.." minutes.",
[".scr"]="No .scr files in this hub, you have been banned for "..time.." minutes.",
[".diz"]="No .diz files in this hub, you have been banned for "..time.." minutes.",
[".lst"]="No .lst files in this hub, you have been banned for "..time.." minutes.",
[".pdf"]="No .pdf files in this hub, you have been banned for "..time.." minutes."
}
function NewUserConnected(curUser)
frmHub:EnableSearchData(1)
for i,v in Files do
curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)
end
end
function OpConnected(curUser)
frmHub:EnableSearchData(1)
for i,v in Files do
curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)
end
end
function DataArrival(curUser, data)
if( strsub(data, 1, 3) == "$SR" ) then
_,_,nick = strfind( data, "\05(%S*)|$" )
local s = 5 + strlen(curUser.sName)
local e = strfind(data, "%d+%s%d+/%d+") - 2
local path = strsub(data, s, e)
local s = 5 + strlen(curUser.sName)
Reason = FindWhat(curUser,data)
if (Reason == "Other files") then return end
curUser:SendData(BotName, "Disconnecting.....")
curUser:SendData(BotName, "Reason: "..Reason)
curUser:SendData(BotName, "Path: "..path.. ".")
curUser:Disconnect()
curUser:TimeBan(time) --This line tempban a user for an specific amount of time in minutes, to incree/decrease the time change the value in variable 'time'
-- curUser:TempBan() --This line tempban a user for an specific amount of time pre-setted inside ptokax advanced settings, to make it work, uncomment this line and comment the line above
end
end
function FindWhat(curUser,data)
for i,v in Files do
if (strfind(strlower(data), "%"..i.."\005")) then
return v
end
end
return "Other files"
end



/WickeD
Title:
Post by: Herodes on 03 October, 2004, 19:45:50
You can do that with the use of ADLSearch ....

pls serach the forum and look in the DC++ Faq (http://dcplusplus.sourceforge.net/faq/faq.php?list=all&prog=1&lang=en&onlynewfaq=1) about in ADLSearch and the DCDM++ forum (http://www.imperialnet.org/forum/index.php) too ...


What Wicked posted is for  Ptx it wont work in Lua enabled client ...
Title: Yes I know that!
Post by: WickeD on 03 October, 2004, 19:51:06
If you do not get the Client to check the users share so can you try the Script that I posted my m8!

/WickeD
Title:
Post by: nErBoS on 03 October, 2004, 20:49:38
Hi,

Don't forget the script will only make a search in active users.

Best regards, nErBoS
Title:
Post by: BoJlk on 04 October, 2004, 00:12:16
Yeah nErBoS That's a problem
about the passive user...

Thou the script is a problem because i don't want to BAN ppl for sharing one of those files
I't could be some program patch that contains *.dll files

I would rather to timeban user for sharing "program files" , "Windows" , "Documents and settings"...
Title:
Post by: nErBoS on 04 October, 2004, 00:36:14
Hi,

You want to add timeban to all files that are in the table or just for a certain amount ??

Best regards, nErBoS
Title:
Post by: bastya_elvtars on 04 October, 2004, 01:16:10
i really cannot understand why you are searching for forbidden files thru script, not dcdm++. it can be made fully automated as well, and a gui helps u, not harder than a scripted way.
Title:
Post by: BoJlk on 04 October, 2004, 16:22:34
Well...
QuoteHi,

You want to add timeban to all files that are in the table or just for a certain amount ??

Best regards, nErBoS

I dont want to look 4 File Extentions...
Just for directories (program files,...etc.)

Quotei really cannot understand why you are searching for forbidden files thru script, not dcdm++. it can be made fully automated as well, and a gui helps u, not harder than a scripted way

He,he...Where? do i type the Raw commands...
And what Raw command should i type in.
And it presents a problem!
If there's a condition when i closed the DCDM client
And my other OPs are usin standart DC++ Client...
I this case that a problem.
Title:
Post by: bastya_elvtars on 04 October, 2004, 16:37:31
users having a 119.64k sized wpk file in their share are not too important to kick them immediately, the lolita stuff can be done by adlsearch

in case you close dcdm++ well dont close it or ask an op 2 use dcdm++

you give more importance for this than you should, m8
Title:
Post by: nErBoS on 04 October, 2004, 22:02:52
Hi,

QuoteOriginally posted by BoJlk
I dont want to look 4 File Extentions...
Just for directories (program files,...etc.)

Just put what you want instead of the file extions, for eg:

["what to ban"] = "Reason to give to user",
If you don't want the rest, just remove it from the table.

Best regards, nErBoS
Title:
Post by: BoJlk on 05 October, 2004, 01:05:01
QuoteOriginally posted by nErBoS
Just put what you want instead of the file extions
Thanks nErBoS i thought it only looks for files?...10x

QuoteOriginally posted by bastya_elvtars
users having a 119.64k sized wpk file in their share are not too important to kick them immediately, the lolita stuff can be done by adlsearch

in case you close dcdm++ well dont close it or ask an op 2 use dcdm++

you give more importance for this than you should, m8

Why you think it's not important?
Title:
Post by: BoJlk on 05 October, 2004, 01:33:11
I've tested it...
Syntax error: attempt to perform arithmetic on a nil value
stack traceback:
   1:  function `DataArrival' at line 36 [file `...rotaX TESTING\scripts\BadFilesDetecter v1.0.lua']

I just addited this part:
[color=green]...Files = {
["program files"]="UnShare program files Directory, and then come back - you are banned for "..time.." minutes.",
["RECYCLER"]="UnShare RECYCLER, and then come back - you are banned for "..time.." minutes.",
[".vob"]="No .vob files in this hub, yo uare banned for "..time.." minutes.",
}
function NewUserConnected(curUser)...[/color]

I'm sorry to ask this i know nothing about LUA nor Scripting, thou i've looked at line 36

[color=green]local e = strfind(data, "%d+%s%d+/%d+") - 2[/color]
Title:
Post by: bastya_elvtars on 05 October, 2004, 01:52:24
QuoteOriginally posted by BoJlk
QuoteOriginally posted by nErBoS
Just put what you want instead of the file extions
Thanks nErBoS i thought it only looks for files?...10x

QuoteOriginally posted by bastya_elvtars
users having a 119.64k sized wpk file in their share are not too important to kick them immediately, the lolita stuff can be done by adlsearch

in case you close dcdm++ well dont close it or ask an op 2 use dcdm++

you give more importance for this than you should, m8

Why you think it's not important?

suppose i enter a hub with my 87G shared and including a 10k tmp file

then u kick me for it immediately, or timeban etc.

better just send 3 or whatever warnings - and it can be done by dcdm++ combined with a ptokax script - i will make the script part...
Title:
Post by: BoJlk on 05 October, 2004, 03:18:38
i modified it for timeban of 3 min.
for sharing program files etc.

If i'll send warning and won't get responded i'll kick the user.

So why not instead of whit fuss i'll prevent him from entering...
Title:
Post by: bastya_elvtars on 05 October, 2004, 03:44:14
damn man, use your brain

when i have a 10k uninstall.exe in my 87 gig share you kick me immediately? instead of warning 2 remove?

thats why i asked, rofl
Title:
Post by: BoJlk on 05 October, 2004, 04:40:17
i'll explain myself again...
I WANT TO SEARCH DIRECTORY not an extention.!

And where do you see here any [".exe"]
...Files = {
["program files"]="UnShare program files Directory, and then come back - you are banned for "..time.." minutes.",
["RECYCLER"]="UnShare RECYCLER, and then come back - you are banned for "..time.." minutes.",
[".vob"]="No .vob files in this hub, yo uare banned for "..time.." minutes.",
}
function NewUserConnected(curUser)...

Am i using my brain now?
Title:
Post by: bastya_elvtars on 05 October, 2004, 05:06:08
Am i using my brain now?

And what if theres a band called Recycler? ;)
Title:
Post by: BoJlk on 05 October, 2004, 07:00:12
then i hope there's no "program files" band ;)
Title:
Post by: nErBoS on 05 October, 2004, 12:32:22
Hi,

About the error here you have the script corrected...

-- BadFilesDetecter V: 1.0 by [ES]latinmusic. Date: 05/11/2003
-- Base on Illegalist by Ptaczek, Jan-3, 2003
-- Searches for specified patterns. Useful for illegal share checking
-- Modificed by Leo (for music hub)
-- Modified by nErBoS
-- Operators are now checked as normal users
-- Some extensions added
-- All known bugs fixed by ----------->>> OpiumVolage
-- Upgrade on script code by nErBoS

BotName = "![BadFilesDetecter]!?"
MessageToSend = " are not allowed in this hub."
time = 3 --Value in minutes
Files = {
[".dll"]="No .dll files in this hub, you have been banned for "..time.." minutes.",
[".sys"]="No .sys files in this hub, you have been banned for "..time.." minutes.",
[".ini"]="No .ini files in this hub, you have been banned for "..time.." minutes.",
[".php"]="No .php files in this hub, you have been banned for "..time.." minutes.",
[".hlp"]="No .hlp files in this hub, you have been banned for "..time.." minutes.",
[".lnk"]="No .lnk files in this hub, you have been banned for "..time.." minutes.",
[".cue"]="No .cue files in this hub, you have been banned for "..time.." minutes.",
[".pkg"]="No .pkg files in this hub, you have been banned for "..time.." minutes.",
[".lib"]="No .lib files in this hub, you have been banned for "..time.." minutes.",
[".ins"]="No .ins files in this hub, you have been banned for "..time.." minutes.",
[".cmd"]="No .cmd files in this hub, you have been banned for "..time.." minutes.",
[".bat"]="No .bat files in this hub, you have been banned for "..time.." minutes.",
[".cod"]="No .cod files in this hub, you have been banned for "..time.." minutes.",
[".cox"]="No .cox files in this hub, you have been banned for "..time.." minutes.",
[".loc"]="No .loc files in this hub, you have been banned for "..time.." minutes.",
[".cnt"]="No .cnt files in this hub, you have been banned for "..time.." minutes.",
[".vxd"]="No .vxd files in this hub, you have been banned for "..time.." minutes.",
[".vga"]="No .vga files in this hub, you have been banned for "..time.." minutes.",
[".stb"]="No .stb files in this hub, you have been banned for "..time.." minutes.",
[".chp"]="No .chp files in this hub, you have been banned for "..time.." minutes.",
[".nrg"]="No .nrg files in this hub, you have been banned for "..time.." minutes.",
[".iso"]="No .iso files in this hub, you have been banned for "..time.." minutes.",
[".vob"]="No .vob files in this hub, you have been banned for "..time.." minutes.",
[".pas"]="No .pas files in this hub, you have been banned for "..time.." minutes.",
[".vcf"]="No .vcf files in this hub, you have been banned for "..time.." minutes.",
[".dfm"]="No .dfm files in this hub, you have been banned for "..time.." minutes.",
[".res"]="No .res files in this hub, you have been banned for "..time.." minutes.",
[".reg"]="No .reg files in this hub, you have been banned for "..time.." minutes.",
[".vdi"]="No .vdi files in this hub, you have been banned for "..time.." minutes.",
[".map"]="No .map files in this hub, you have been banned for "..time.." minutes.",
[".scr"]="No .scr files in this hub, you have been banned for "..time.." minutes.",
[".diz"]="No .diz files in this hub, you have been banned for "..time.." minutes.",
[".lst"]="No .lst files in this hub, you have been banned for "..time.." minutes.",
[".pdf"]="No .pdf files in this hub, you have been banned for "..time.." minutes."
}

function NewUserConnected(curUser)
frmHub:EnableSearchData(1)
for i,v in Files do
curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)
end
end

function OpConnected(curUser)
frmHub:EnableSearchData(1)
for i,v in Files do
curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)
end
end

function DataArrival(curUser, data)
if( strsub(data, 1, 3) == "$SR" ) then
_,_,nick = strfind( data, "\05(%S*)|$" )
local s,e,path = strfind(data, "$SR%s+%S+%s+(.+)%x+%s+%x+/%x+")
if (path ~= nil) then
Reason = FindWhat(curUser,data)
if (Reason == "Other files") then return end
curUser:SendData(BotName, "Don't share illegal files. Please correct them.")
curUser:SendData(BotName, "Reason: "..Reason)
curUser:SendData(BotName, "Path: "..path.. ".")
SendPmToOps(BotName, "The user: "..curUser.sName.." is sharing illegal files.")
SendPmToOps(BotName, "Path: "..path)
end
end
end

function FindWhat(curUser,data)
for i,v in Files do
if (strfind(strlower(data), "%"..i.."\005")) then
return v
end
end
return "Other files"
end

Best regards, nErBoS
Title:
Post by: BoJlk on 05 October, 2004, 18:35:53
10x nErBoS the King, :)
i thought about what bastya_elvtars Said and can this script not ban
instead just warn Owner/OPs/ChatOP (one of them, so i can shoose)

And one more thing: the script stops the search after the first string found...
If it's not too difficult to make the script make a list of file found...
Eventually the script will do this
1.check for directory/files
2. allow ppl to cennect
3. warn user : "to unshare the bad files"
4. send PM with list of files found in the share to master/OP/chatOP (can be changed)
Title:
Post by: nErBoS on 06 October, 2004, 00:37:26
Hi,

I have edited the script bellow. Try out.

Best regards, nErBoS
Title:
Post by: BoJlk on 11 October, 2004, 15:22:02
Another Question:

Does the Script distinguish betwen "Directory" name
and "file" name?

And if not can it be done?
Title:
Post by: DEEP-GOA on 11 October, 2004, 17:07:23
QuoteOriginally posted by BoJlk
Another Question:

Does the Script distinguish betwen "Directory" name
and "file" name?

And if not can it be done?

edit into adl search all ur needs..
.. DCDM rocks.. ;)
Title:
Post by: DEEP-GOA on 11 October, 2004, 18:04:42
QuoteOriginally posted by Mutor
..Why script all this when DCDM can do it better, without spamming the hub? Ahh f**k what do I know?

peace...

agree agree
Title:
Post by: nErBoS on 12 October, 2004, 03:31:32
Hi,

Yes mutor i agree with you, but if BoJlk wants the script let it have, he has been advised more then one time that DCDM is much better then this script (on resources and in facilaties). But everyone can make its choice  :))

Best regards, nErBoS
Title:
Post by: nErBoS on 12 October, 2004, 09:09:09
Hi,

You know me and you know my english  :P

Best regards, nErBoS
Title:
Post by: BoJlk on 12 October, 2004, 19:03:09
Look, Thank to Mutor
for intredusing me the DCDM++

I looked into the DCDM forums/sections
i'm looking for the raw commands for it...
Can you post the RAW command...
Title:
Post by: blackwings on 12 October, 2004, 19:13:17
QuoteOriginally posted by BoJlk
Look, Thank to Mutor
for intredusing me the DCDM++

I looked into the DCDM forums/sections
i'm looking for the raw commands for it...
Can you post the RAW command...
Check this link =
http://www.ukdnb.dsl.pipex.com/guide/raw.htm
Title:
Post by: bastya_elvtars on 12 October, 2004, 21:26:04
QuoteOriginally posted by BoJlk
Look, Thank to Mutor
for intredusing me the DCDM++

I looked into the DCDM forums/sections
i'm looking for the raw commands for it...
Can you post the RAW command...

mm i dont abuse drugs but i still see this text? what happened?  :D  :D  :D
Title:
Post by: BoJlk on 12 October, 2004, 23:45:49
What?
My English is a problem  :D