Check share for bad files
 

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

Check share for bad files

Started by VERMiN, 09 November, 2003, 16:47:47

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VERMiN

I have searched all "badfiles" scripts I've come over and none either work, search spams or is too inaccurate.

Does anyone knows of a good one? Most preferable would be a script that open (for example) a file called ForbiddenFiles.txt and the content of this file could be:

explorer.exe
iexplorer.exe
mspaint.exe
taskman.exe
.dll
.vob
.tmp
.temp
.antifrag
MyList.bz2
c:\windows
d:\windows

and search every user that connects and also actively in DataArrival()

Most preferable the script would tell the user which file that failed to pass the badfile() check.

Most important is that all forbidden files must be defined in a textfile and NOT within the script itself.


I hope that somebody has time and/or interest to help me ;)
The damned creator of [-MORBID-].  \" A damn fine security script \" [/COLOR]


HOMEPAGE
E-mail

klownietklowniet

get dc++k

illigalist is ok as a script though, and many use it without problems.
[ > DC - UniteD < ]

[ES]latinmusic

#2
-- 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

VERMiN

Thanks, pal.  But could you make it to retrieve the illegal files from a textfile instead of being pre-defined within the script? And maintained the ability to output what kind of a file that triggered the script?

Yeah, I'm being a pain in the a** ;)
The damned creator of [-MORBID-].  \" A damn fine security script \" [/COLOR]


HOMEPAGE
E-mail

VERMiN

Btw: It also generates an -> Search spam detected..

When a user connects..
The damned creator of [-MORBID-].  \" A damn fine security script \" [/COLOR]


HOMEPAGE
E-mail

[ES]latinmusic

Generated spam, i test it and no generates something, but i will recheck it again, but not today, i coding another script today, also anyone can take a shoot for me  :P

VERMiN

It seems that this line causes the 'spam detected':

curUser:SendData("$Search Hub:"..BotName..random(1, 100) .." F?F?0?1?"..i)

Under NewUserConnected()
The damned creator of [-MORBID-].  \" A damn fine security script \" [/COLOR]


HOMEPAGE
E-mail

plop

QuoteOriginally posted by [ES]latinmusic
Generated spam, i test it and no generates something, but i will recheck it again, but not today, i coding another script today, also anyone can take a shoot for me  :P
share more, what i can remember (tryed it a long time back) is that it starts on share around 200GB+.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

[ES]latinmusic

Oh, plop, it was not tested with big share, i will give another try this week with it, not exacly now, i'm doing another bot currently. I think it can be fixed, but i'm not sure, anyway i need it, so i willl take a look agin.

pHaTTy

QuoteOriginally posted by VERMiN
Btw: It also generates an -> Search spam detected..

When a user connects..

it seems it has todo this, it does not cause any problems......;)
Resistance is futile!

VERMiN

Ok, now I'm really confused!

If I use the script by itself it seems to work just fine. No "Spam detected from bot". It finds bad files and everything is just wonderful etc...

But if I cut out the script exactly as it is into a another script (kind of aa all-in-1) and run the combined script it DOES NOT work. Spam detected all over again, and no it doesn't find any bad files while it spams :(

But now to the part that I cannot understand. If I have BOTH the BadFile script and my All-in-1 and all the sudden my script doesn't say anything about any spamming and it start to find badfiles.

Summary: I need to have the above script running in order to get the same script but used within my own to work. If I remove the script posted by latinmusic my script starts to spam all over again.

I'm going mad..
The damned creator of [-MORBID-].  \" A damn fine security script \" [/COLOR]


HOMEPAGE
E-mail

[ES]latinmusic

The script i posted was developed to work as an standalone script, use it in that way, if you wanna merger into another script, then probably all data arrival need to be fixed.

VERMiN

I've located the problem. The bot name must not contain any spaces. I named the bot 'File Check' and that's what caused all the spam problem. I had no idea.
The damned creator of [-MORBID-].  \" A damn fine security script \" [/COLOR]


HOMEPAGE
E-mail

VERMiN

However it doesn't always locate 'bad files'. I've shared my windows directory on 3 of my computers, and the script only reports a bad file share when ONE of my computers connects to my testhubb.

Does it matter how much you got in share? Can the script be altered to verify/find more accurate?
The damned creator of [-MORBID-].  \" A damn fine security script \" [/COLOR]


HOMEPAGE
E-mail

SMF spam blocked by CleanTalk