*** Advanced BadFile Search
 

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

*** Advanced BadFile Search

Started by NightLitch, 04 March, 2005, 12:43:32

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

Here is a strip from Thor 6 BadFileSearch part, I hope this works I just stripped it fast...

---------------------------------------------------------------------------------------------------
-- Advanced BadFile Active Search // Stripped from Thor 6
-- By: NightLitch 2005-03-04
---------------------------------------------------------------------------------------------------
tBadFiles = {

	{"explorer.scf" , "NO sharing of installed / packed programs or games"},
	{".temp.mp3" , "NO sharing of incomplete downloads"},
	{"_INCOMPLETE_" , "NO sharing of incomplete downloads"},
	{"download123456789.dat" , "NO sharing of incomplete downloads"},
	{"part.met" , "NO sharing of incomplete downloads"},
	{".getright" , "NO sharing of incomplete downloads"},
	{"autorun.inf" , "NO sharing of installed / packed programs or games"},
	{"DCPlusPlus.exe" , "NO sharing of installed / packed programs or games"},
	{"valve.avi" , "NO sharing of installed / packed programs or games"},
	{"virscan .dat" , "NO sharing of installed / packed programs or games"},
	{"Netlimiter" , "NO sharing of installed / packed programs or games"},

}
---------------------------------------------------------------------------------------------------
--// Don't Edit below this point if you don't now what you are doing
---------------------------------------------------------------------------------------------------

tTimer = {}

function Main()
	RegTimer(SearchForBadFiles, 20 * 1000, "ActiveBadFileSearch")  -- Active Search Each 20 Sec
	SetTimer(1000)
	StartTimer()
end

function OnTimer()
	for i=1,table.getn(tTimer) do
		tTimer[i][3] = tTimer[i][3] + 1
		if tTimer[i][3] > tTimer[i][2] then
			tTimer[i][3]=1
			tTimer[i][1]()
		end
	end
end

function SRArrival(sUser,sData)
	local _,_,From,Path,FileSize,FreeSlots,TotalSlots,Who = string.find(sData, "^%$SR%s+(%S+)%s+(.*)(%d+)%s+(%d+)%/(%d+).*(%S+)%|$")
	if tCall["BadFileSearch"] then pcall(tCall["BadFileSearch"],sUser,Path,Who,FileSize) end
end

tCall = {}
tCall["BadFileSearch"] = function(sUser,Path,Who,FileSize)
	if sUser.bOperator then return 0 end
	if Who == "SlotFetch" then
		local FileFound, FileReason = BadFiles(Path)
		if FileFound then
			sUser:SendData(frmHub:GetHubBotName(), "*** You have been kicked for "..FileReason..". "..Path.." "..Units(FileSize))
			SendToOps(frmHub:GetHubBotName(), "*** User "..sUser.sName.." has been kicked for "..FileReason..". "..Path.." "..Units(FileSize))
			sUser:TempBan()
		end
	end
end

RegTimer = function(Function,Interval,str)
   local tmpTrig = Interval / 1000
   table.insert(tTimer,{Function,tmpTrig,1,str})
end

Units = function(intSize)
	if tonumber(intSize) ~= 0 then
		local tUnits = { "Bytes", "KB", "MB", "GB", "TB" }
		intSize = tonumber(intSize);
		local sUnits;
		for index = 1, table.getn(tUnits) do
			if(intSize < 1024) then
				sUnits = tUnits[index];
				break;
			else 
				intSize = intSize / 1024;
			end
		end
		return string.format("%0.1f %s",intSize, sUnits);
	else 
		return "0 Bytes"
	end
end

BadFiles = function(PathStr)
	for i = 1, table.getn(tBadFiles) do
		if string.find(PathStr, tBadFiles[i][1]) then
			return 1,tBadFiles[i][2]
		end
	end
	return nil, "Other Files"
end

SearchForBadFiles = function()
	if t == nil then
		t =1
		if tBadFiles[t] then
			SendToAll("$Search "..frmHub:GetHubIp()..":"..frmHub:GetHubUdpPort().." F?F?0?1?"..tBadFiles[t][1])
		end
	elseif t > table.getn(tBadFiles) then
		t = nil
	else
		t = t+1
		if tBadFiles[t] then
			SendToAll("$Search "..frmHub:GetHubIp()..":"..frmHub:GetHubUdpPort().." F?F?0?1?"..tBadFiles[t][1])
		else 
			t = 0
		end
	end
end

*UPDATED*

report errors...

// NL
//NL

BrainWave

wow!

seems to be a gr8 script! does it scan also passive users?

is it difficult to add a function to ALLOW only certain extensions? if another file that a .mp3 is found for example, the user is kicked... easier than enter every existing extension to the script... it would be gr8 for my future mp3 only hub...

i'll try this script... =)

NightLitch

It searches both Active and Passive Users....
//NL

PPK

QuoteOriginally posted by NightLitch
   RegTimer(ActiveSearchForBadFiles, 20 * 1000, "ActiveBadFileSearch")  -- Active Search Each 20 Sec
   RegTimer(PassiveSearchForBadFiles, 25 * 1000, "PassiveBadFileSearch") -- Passive Search Each 25 Sec
Why you waste badwith with both type of searches ?(
Passive search request return replys only from active...
Active search request return replys from all  :]
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

bastya_elvtars

Yes, and we get kicked again for antichildporn.lua.
Everything could have been anything else and it would have just as much meaning.

NightLitch

#5
QuoteOriginally posted by PPK
QuoteOriginally posted by NightLitch
   RegTimer(ActiveSearchForBadFiles, 20 * 1000, "ActiveBadFileSearch")  -- Active Search Each 20 Sec
   RegTimer(PassiveSearchForBadFiles, 25 * 1000, "PassiveBadFileSearch") -- Passive Search Each 25 Sec
Why you waste badwith with both type of searches ?(
Passive search request return replys only from active...
Active search request return replys from all  :]

Good point... heheh

*Edited*

I just noticed it worked

Had done some bad code in my own Bot as ussuall

HATE IT!!!!

Cheers / NL
//NL

TTB

Hi,


QuoteIt searches both Active and Passive Users....

That was a quote by NightLitch... But it also checks "passive users"? Didn't know that was possible by script serversite.
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

TTB

Nightlitch,

can you add some features in this script?

* Search also for "forbidden" folders
* Search for files with size -1 bytes

Then it should be complete...

Hope u have some time to make this  :D
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

BeeR

QuoteOriginally posted by TTB
Nightlitch,

can you add some features in this script?

* Search also for "forbidden" folders
* Search for files with size -1 bytes

Then it should be complete...

Hope u have some time to make this  :D

why not add a block on large files also ,, a value = size in GB
A cold BeeR is stunning !!

Doobert

Nightlitch
Thanks for a very handy script indeeed. Just one question as I am not very good with these things. Is it possible to change somewhere in the =script so that the kicks show in pm and not in main chat?
Thanks again.
Posted on: 26 March 2005, 02:25:09
QuoteOriginally posted by Doobert
Nightlitch
Thanks for a very handy script indeeed. Just one question as I am not very good with these things. Is it possible to change somewhere in the =script so that the kicks show in pm and not in main chat?
Thanks again.

Its Ok I have managed to solve the problem myself with more than a little help from a friend:)
makes the script even more perfect for my needs.

Typhoon

QuoteOriginally posted by Doobert
Nightlitch
Thanks for a very handy script indeeed. Just one question as I am not very good with these things. Is it possible to change somewhere in the =script so that the kicks show in pm and not in main chat?
Thanks again.

The kick was only shown to Ops . and not users ...

so no point to make a change unless you don't like it to give you the message in main :)

Typhoon?



Doobert

QuoteOriginally posted by Typhoon?
QuoteOriginally posted by Doobert
Nightlitch
Thanks for a very handy script indeeed. Just one question as I am not very good with these things. Is it possible to change somewhere in the =script so that the kicks show in pm and not in main chat?
Thanks again.

The kick was only shown to Ops . and not users ...

so no point to make a change unless you don't like it to give you the message in main :)

Typhoon?

Thanks Typhoon but main chat can get a bit cluttered so i like to keep all my kick messages etc as pm to the hub bot that was my reason mate. I managed it so for me its now perfect:)

Typhoon

good to hear , and yes i also have made all kick/ban messages default off in my script , and if some would like to follw they can just signup and get it shown in pm or main :) ...

but good to hear that you like it :)

Typhoon?



James

Hi

is it possible to integrate a section with exceptions in your script?
EXAMPLE:

tBadFiles = {

   {"Chasey Lain.mpg" , "NO PORN"},
   {"Chasey Lain.avi" , "NO PORN"},
   {"xxx.mpg" , "NO PORN"},
                {"xxx.avi" , "NO PORN"},

EXCEPTION:

xxx tripplex
The Ballad of Chasey Lain
.jpg
.mp3

(-M??-)

this script is great just wanting to know if it can be edited not to check my vip's as most of my vips are ops and share clients and it kicks for   *** User ??????scooby?????? has been kicked for NO sharing of installed / packed programs or games. programs\New Folder\DC++k-CDM-v2.92\DCPlusPlus.exe 880.0 KB
or can a exceptions list be created

many thanks

TTB

HI,

if I'm not mistaken, you have to edit this line:
if sUser.bOperator then return 0 end
and change it into:
if sUser.bOperator or sUser.iProfile == 2 then return 0 end
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

jiten

Yups, that's it  :]

Skippy84

i found the way you can send it only in pm to user that was kicked


tCall["BadFileSearch"] = function(sUser,Path,Who,FileSize)

.
.
.
.

			sUser:SendData(frmHub:GetHubBotName(), "*** You have been kicked for "..FileReason..". "..Path.." "..Units(FileSize))



replace  sUser:SendData.....


sUser:SendPM

so it sends the message as PM

LoTeK_

To send report to OPs in PM instead of main chat you can change this line from:

SendToOps(frmHub:GetHubBotName(), "*** User "..sUser.sName.." has been kicked for "..FileReason..". "..Path.." "..Units(FileSize))

to:

SendPmToOps(frmHub:GetHubBotName(), "*** User "..sUser.sName.." has been kicked for "..FileReason..". "..Path.." "..Units(FileSize))

--

is possible to add a maxsize of files checked, like ".wav" max 50mb?

TTB

Hm, I'm using this script in the new ptokax, 17.09 (atm). But it doesn't seems to work. Someone else who has the same problem?
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

gizmo

How do i do to make the script to come in robocops kicklog. because sUser:TempBan() dont work

=)

FrancoS

#21
Somebody asked about passive users,

I use FileChecker, but the concept is the same.

The issue:

using dc++ search-spy and setting myself up as passive, I see that searches from the hub are arriving to my client...

I have shared a forbidden file

as active : I'm disconnected
as passive : I'm NOT disconnected

I'm wondering WHY!!!!!????

Thank you for any answer.

Robert

-SkA-

In my opinion this is a very good script...

Just a request: is it possible to add !start and !stop command?
???:::??x??em?-N????:::??? ?wN??

BrianzaLand Blog" style="border:0

LoTeK_

#23
QuoteOriginally posted by -SkA-
In my opinion this is a very good script...

Just a request: is it possible to add !start and !stop command?

A script can be started/stopped by PtokaX inbuild commands:
!startscript
!stopscript
----
Could be possible to modify this script in order to do  searches for files using File Type and Size?

[NL]scooby

hello all
why can searchchecker with warn, tempban,ipbanned maked?
see here:  preteen banned and dctmp file warned.
please can you this making for my?

Greetz [NL]Scooby

SMF spam blocked by CleanTalk