Download Blocker - Page 2
 

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

Download Blocker

Started by c h i l l a, 24 October, 2003, 12:20:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sajy2k

--Download-Blocker-V.1.1-NP

NickPrefix = "[TMX]"

function Main()
	frmHub:EnableFullData(1)
end

function DataArrival(curUser, data)
	if (strsub(data, 1, 1) == "$" and strsub(curUser.sName,1,strlen(NickPrefix)) ~= NickPrefix and strfind(data, "ConnectToMe")) then
		return 1
	end
end


I have problem with this script. It make all the users in the hub receive Connection timeout message although they have the correct prefix. Please help on this plese

c h i l l a

This script blocks searches and downloads till the user replies with a certain Key.
Yepp I also wonder whats its good for.

--DowBlo  Download / Search Blocker - UNLOCK V.1 
--Blocks Download and search until they reply with a certain key.


ToBlock = {}
DBLTrig = {
	["$Rev"] = 1,
	["$Con"] = 1,
	["$Sea"] = 1,
}

function Main() 
	frmHub:EnableFullData(1) 
end 

function NewUserConnected(curUser)
	if curUser.iProfile == -1 then
		ToBlock[curUser.sName] = tostring(random(10000))
	end
end

function UserDisconnected(curUser)
	ToBlock[curUser.sName] = nil
end

function DataArrival(curUser,data)
	if ToBlock[curUser.sName] then
		if strsub(data,1,1) == "$" then
			if DBLTrig[strsub(data,1,4)] then
				curUser:SendData(" *** To UnLock the Download and Search Protection, please reply with :  "..ToBlock[curUser.sName])
				return 1
			end
		elseif strsub(data,1,1) == "<" then
			if strsub(data,strlen(data)-strlen(ToBlock[curUser.sName]),strlen(data)-1) == ToBlock[curUser.sName] then
				curUser:SendData(" *** Download and Search have been UnLocked.")
				ToBlock[curUser.sName] = nil
			end
		end
	end
end

XPMAN

The script:



aNicks = {

["Nick1"] = 1,

["Nick2"] = 1,

["Nick3"] = 1,

}





function Main()

frmHub:EnableFullData(1)

end



function DataArrival(curUser, data)

if (strsub(data, 1, 1) == "$" and strfind(data, "ConnectToMe") and not aNicks[curUser.sName]) then

return 1

end

end





Allows only Nicks entered to download, and i noticed one with a prefix. What would really come in handy is a script that WOULD ALLOW ALL to connect and download within the hub. But have a script so as to enter their Nick to not download ,returning a "You are not authorized now to download"

just like the script above but enter Nicks to NOT GIVE permission to download. That way someone using the above script wouldn't have to enter everyone on their hub in the script in order to let them download.

This would be very handy, hub owners could then have the ability to "censor" who CANNOT download by simply entering their Nick in the script.

c h i l l a

sure, nice idea...  just oone thing, these scripts are not proof, just a exsample.

active client connects to a blocked client,  if active client has a slot open  the blcoked client will be able to download.

1 leak.

well to make it totally proof one would also need to prevent useres from connectiong to blocked useres, well only need to prevent active users actually, but maybe better to also block the passive ones to active blocked clients, so no extra data is sent, will think of something.

c h i l l a

#29
this would be a 100% download upload blocker.

--100% Blocker by chill

cmd1 = "+blocknick"

BlockedNicks = {}

function Main()
	frmHub:EnableFullData(1) 
end

BlockTriggs = {
	["$Rev"] = 1,
	["$Con"] = 2,
}

function DataArrival(curUser,data)
	if strsub(data,1,1) == "$" then
		local str1 = strsub(data,1,4)
		if BlockTriggs[str1] then
			if BlockedNicks[strlower(curUser.sName)] then
				curUser:SendData("*** You are not authorized to download.")
				return 1
			elseif BlockTriggs[str1] == 1 then
				local _,_,conNick = strfind(data,"(%S+)|$")
				if BlockedNicks[strlower(conNick)] then
					curUser:SendData("*** The user you are trying to download is not authorized to upload.")
					return 1
				end
			elseif BlockTriggs[str1] == 2 then
				local _,_,conNick = strfind(strsub(data,14,strlen(data)),"^(%S+)")
				if BlockedNicks[strlower(conNick)] then
					curUser:SendData("*** The user you are trying to download is not authorized to upload.")
					return 1
				end
			end
		end
	elseif strsub(data,1,1) == "<" and curUser.bOperator then
		local _,_,cmd,nick = strfind(data,"^%b<>%s+(%S+)%s+(%S+)|$")
		if cmd and cmd == cmd1 then
			if BlockedNicks[strlower(nick)] then
				BlockedNicks[strlower(nick)] = nil
				curUser:SendData("*** "..nick.." is now unblocked.")
			else
				BlockedNicks[strlower(nick)] = 1
				curUser:SendData("*** "..nick.." is now blocked.")
			end
		end
	end
end

pHaTTy

way to go this is a nice idea :)) keep up good work :)
Resistance is futile!

XPMAN

--100% Blocker by chill



cmd1 = "+blocknick"



BlockedNicks = {}



function Main()

frmHub:EnableFullData(1)

end



BlockTriggs = {

["$Rev"] = 1,

["$Con"] = 2,

}



function DataArrival(curUser,data)

if strsub(data,1,1) == "$" then

local str1 = strsub(data,1,4)

if BlockTriggs[str1] then

if BlockedNicks[strlower(curUser.sName)] then

curUser:SendData("*** You are not authorized to download.")

return 1

elseif BlockTriggs[str1] == 1 then

local _,_,conNick = strfind(data,"(%S+)|$")

if BlockedNicks[strlower(conNick)] then

curUser:SendData("*** The user you are trying to download is not authorized to upload.")

return 1

end

elseif BlockTriggs[str1] == 2 then

local _,_,conNick = strfind(strsub(data,14,strlen(data)),"^(%S+)")

if BlockedNicks[strlower(conNick)] then

curUser:SendData("*** The user you are trying to download is not authorized to upload.")

return 1

end

end

end

elseif strsub(data,1,1) == "<" and curUser.bOperator then

local _,_,cmd,nick = strfind(data,"^%b<>%s+(%S+)%s+(%S+)|$")

if cmd and cmd == cmd1 then

if BlockedNicks[strlower(nick)] then

BlockedNicks[strlower(nick)] = nil

curUser:SendData("*** "..nick.." is now unblocked.")

else

BlockedNicks[strlower(nick)] = 1

curUser:SendData("*** "..nick.." is now blocked.")

end

end

end

end



How about add   +unblock to remove the block, so for example if the reason they were being blocked is resolved  a master or op could  +unblock,  and have all info stored in a   .dat  file so even if the hub is reset all people blocked will still be blocked.

c h i l l a

thanks phatty...

well XPMAN, its the same command as to block.

if the nick already exsist as blcoked then it is removed try yourself

+blocknick test

and then again.

acrespo

Chilla, is there a version to block all download/upload (like this new version) but operators can download but not upload to all?

c h i l l a

#34
nope not really...
well just have your OP's to have zero slots.
but when a op then connects to a blocked client, and if he is using dc++, then the blocked client will be able to get the OP's filelist.

After a connection has been establishe between 2 clients, the clients don't use the hub anymore to communicate. So then either client can send out a connection request directly to the other client.

Apart from that the script above is easy to pass by, just change nick,
so we could switch over to IP's, no problem,
but then you can change IP's , well thats when you start to insert only allowed nicks ;).

But Its just a playing around.

acrespo

hummm let me see...

When op connects in a blocked user, the blocked user can download filelist from this dc++ op. But only filelist? Can't download any other file?

The other point, I don't understand, because if I blocked all client except Ops, nobody can estabilish a connection with anybody right?

Let me explain my situation:
I am making a new hub to redirect all users from my main hub that get banned. This new hub exists only for Ops see the users problems and try to help these users. Nobody can download from anybody but Ops can download the filelist to see the bad files.

Can you help me to write a download block for my case?

c h i l l a

#36
sure no problem.

it actually already existsts..  you will have to insert the OP's names in it, and when they download a filelist and see the user connecting they just have to close the connection, look here

And well depending what setting your ops have the user could download anything. filelist anything, doesn't matter.

XPMAN

I couldn't get it to work. I assume you type the  +blocknick  in main chat? Tried a couple different ways but still coultn't get it to work. HELP.............

c h i l l a

it is

+blocknick

and you must be operator.

HaL

hi chilla

very nice script ;)
could you change it ...
if i write +blocknick
in mainchat, that the cmd was not seen in mainchat?

that would be great 4me ...

thx chilla

c h i l l a

nothing easier than that ;)

--100% Blocker by chill

cmd1 = "+blocknick"

BlockedNicks = {}

function Main()
	frmHub:EnableFullData(1) 
end

BlockTriggs = {
	["$Rev"] = 1,
	["$Con"] = 2,
}

function DataArrival(curUser,data)
	if strsub(data,1,1) == "$" then
		local str1 = strsub(data,1,4)
		if BlockTriggs[str1] then
			if BlockedNicks[strlower(curUser.sName)] then
				curUser:SendData("*** You are not authorized to download.")
				return 1
			elseif BlockTriggs[str1] == 1 then
				local _,_,conNick = strfind(data,"(%S+)|$")
				if BlockedNicks[strlower(conNick)] then
					curUser:SendData("*** The user you are trying to download from is not authorized to upload.")
					return 1
				end
			elseif BlockTriggs[str1] == 2 then
				local _,_,conNick = strfind(strsub(data,14,strlen(data)),"^(%S+)")
				if BlockedNicks[strlower(conNick)] then
					curUser:SendData("*** The user you are trying to download from is not authorized to upload.")
					return 1
				end
			end
		end
	elseif strsub(data,1,1) == "<" and curUser.bOperator then
		local _,_,cmd,nick = strfind(data,"^%b<>%s+(%S+)%s+(%S+)|$")
		if cmd and cmd == cmd1 then
			if BlockedNicks[strlower(nick)] then
				BlockedNicks[strlower(nick)] = nil
				curUser:SendData("*** "..nick.." is now unblocked.")
			else
				BlockedNicks[strlower(nick)] = 1
				curUser:SendData("*** "..nick.." is now blocked.")
			end
			return 1  -- TELLS THE HUB TO STOP PROCESSING THE DATA
		end
	end
end

HaL

gr?zi chilla ;)

thx a lot

great work :-)

greetz HaL

DJ RRebel

Heya Chilla ... thanks for this script.  I'm not entirely sure if it can be modified to do what I need though.  Here's what I'm looking for:

VIP & OPs:
- Can download anything from anyone

Registered:
- Can only download file lists and mp3's

Unregistered:
- Can only download mp3's with a certain fixed string in the actual file name (and file lists).


If this isn't posible, is there a way to at least block searching based on the same criteria?

c h i l l a

nope can't be done, this dowbload blocker is actually only a connection blocker.

I can block connections, but can't check what will be downloaded or how much.

yepyepyep4711

Hi chill,

I'm using this script, but I've noticed some users still can connect and dl (using other clients than dc++), if your method blocks more, maybe you could incorporate it in this script, that would be great. Remember, it is supposed to block only downloads and searches for unregged users, they can still chat and upload.

Here goes:

--------------------- 

-- LEECHBLOCKER 02 -- for PtokaX TD4 

--------------------- 

-- Created by SAMPLERman - HUB: samplerman.no-ip.info 

-- 5/August/2003 

-- Based on an idea by OpiumVolage and RabidWombat 

-- And thanks AGAIN to RabidWombat for new ideas 



-- This LUA script prevents users that are not registered in the hub (=aliens) 

-- from connecting to other users (for downloading). 

-- New users (=aliens) can chat, upload and be searched. They just can't download. 



-- This way your previously private hub can again be public. 



-- Optionally, the script also blocks searches (from nonregged users). 

-- However, it is recommended that you allow everyone to search your hub, so that 

-- new users know what they are missing. 



-- NEW in version 02: 

-- To allow an alien to download for 1 session, OPs can type this command: 

-- !letleech  



-- To do for next version: 

-- Optionally, aliens can download off of other aliens 



-- There are 2 kinds of hubs: 

-- 1) Open hubs for sharing anything 

-- 2) Small hubs that concentrate on a special interest (e.g. classical sheet music) 



-- This script is NOT recommended for hub kind #1, where it is enough to 

-- control how many GB users are sharing. 

-- Because in hub type #1 there is no point in registering users, this script 

-- should be adapted to make shared amount the criteria for letting download. 

-- Even better, for hub type #1 users who share little should be allowed to download 

-- from other people who share little. 

-- Freedom is a strength of the Direct Connect community; please do not cut into 

-- people's freedom except when absolutely necessary. 

-- This script is only for closed hubs with a very specific subject. 



------------------------------- 

-- SOURCES OF SCRIPTING INFO -- 

------------------------------- 

-- Scripting.txt (comes with PtokaX) 

-- <[URL]http://lua.bcs-solutions.de/[/URL]> 

-- LUA reference manual 4.0.pdf 



---------------------- 

-- GLOBAL VARIABLES -- make changes here only 

---------------------- 

smDebugging = "0" -- Default is "0" (silent mode). "1" sends msgs to OPs 

smBlockSearches = "1" -- Default is "0" (do not block searches) 

smBlockSearchExceptions = { "scores", "sheet music" } 



MsgToAliens = "\t\t\t*** warning***\r\n\t".. 

"YOU ARE UNABLE TO DOWNLOAD IN THIS HUB\r\n\t".. 

"Only registered users can download.\r\n\t".. 

"You still can chat and play the games...\r\n\t".. 

"...but the hub won't let you search or download until you register.\r\n".. 

"\tIn order to become a registered member:\r\n\t".. 

"1) Stay in the hub for awhile and be nice to everyone\r\n\t".. 

"2) After some time (max a day or two) someone will ask you if you want to register\r\n\t".. 

"We hope you will join us." 



LetLeechCommand = "!letleech" 



---------------------------------- 

-- Do not change anything below -- 

---------------------------------- 

smBot = frmHub:GetHubBotName() -- This line gets bot name from PtokaX hubsoftware; 

-- therefore, your Hub Bot should be enabled. 



ToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s+(%S+)"} 

LetLeech = {} 



--// This function is called when hub or script starts 

function Main() 

frmHub:EnableFullData(1) 

frmHub:UnregBot(smBot) 

frmHub:RegBot(smBot) 

--// If thus configured, remove search from blocking table: 

if smBlockSearches == "0" then 

for i,v in ToBlock do 

if v == "^$Search%s+(%S+)" then ToBlock[i] = nil end 

end 

end 

end 



--// This function is fired when a new user (non-OP) finishes login 

function NewUserConnected(user) 

if user.iProfile == -1 then 

user:SendPM(smBot,"\r\n"..MsgToAliens) 

end 

end 



--// This function is fired when new data arrives 

function DataArrival (user, data) 



--// See if data is the !letleech command: 

if strsub(data, 1, 1) == "<" then 

local line=strsub(data,1,strlen(data)-1) -- remove last char 

local s,e,cmd = strfind(line, "%b<>%s+(%S+)") 

local s,e,arg = strfind(line, "%b<>%s+%S+%s+(%S+)") 

if strlower(cmd)==strlower(LetLeechCommand) then 

if user.iProfile ~= 0 and user.iProfile ~= 1 then 

SendToAll(smBot, "...but you are not an OP!") 

return nil 

end 

who = GetItemByName(arg) 

if not who then 

SendToOps(smBot, arg.." is not online.") 

return 1 

end 

if who.iProfile ~= -1 then 

SendToOps(smBot, arg.." is registered and does not need a leech license.") 

return 1 

end 

LetLeech[arg] = 1 

SendToOps(smBot,arg.." has been granted a special leech license.") 

who:SendData(smBot,arg..", you are now authorized to download for this session.") 

return 1 

end 

end 



--// See if data should be blocked: 

for _,blockstring in ToBlock do 

local _, _, who = strfind(data, blockstring) 

if who then return smBlock(user,data,who) end 

end 

end 



function smBlock(user,data,who) 

local report 

local profnam = GetProfileName(user.iProfile) 

if profnam then 

profnam = strlower(profnam) 

else 

profnam = "alien" 

end 

--// Activity by Masters, OPs, VIPs and REGs are just reported to OPs: 

--// Also, searches pass if they are in the exception list: 

--// Data also passes if user is in LetLeech list: 

if (user.iProfile ~= -1) or smMatchException(data) 

or IsInLeechList(user) then 

report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data 

smDebugToOPs(report) 

return nil 

end 

--// Alien (not registered) users get blocked: 

local report = "\tBlocked from "..user.sName.." (".. 

profnam.."):\r\n\t"..data 

smDebugToOPs(report) 

return 1 

end 



function smMatchException(data) 

if strfind (data, "^$Search%s+(%S+)") then 

for _,exceptword in smBlockSearchExceptions do 

if strfind (strlower(data), strlower(exceptword)) then 

return 1 

end 

end 

end 

return nil 

end 



function IsInLeechList(user) 

for i,v in LetLeech do 

if i == user.sName then return 1 end 

end 

return nil 

end 



function smDebugToOPs(data) 

if smDebugging == "1" then 

SendToOps(smBot,data) 

end 

end

Thanx in advance. Cheers

Woodster

Hi

How Can i change this bot so only Masters can download??

I am using profiles from Robocop8.0a

Woody
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

[G-T-E]Gate?

This was Edited for me bu Pus;

Levels for downloads;


function Main() 
    
frmHub:EnableFullData(1

    
Levels = {
        
Master "1",
        
Operator "1",
        
VIP "1",
        
Reg "0",
        Default = 
"0"
    
}

end 

function DataArrival(curUserdata


    if (
strsub(data115) == "$RevConnectToMeand curUser.iProfile == -1then 
        local _
,_,towho strfind(data"$RevConnectToMe%s+%S+%s+(%S+)|"

        if 
isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then 
            curUser
:SendData("*** You must get registered to be able to download from Me so contact a person with [XXX] Tag to get Registered")     
        
end 

        
return 

    
elseif (strsub(data112) == "$ConnectToMeand curUser.iProfile == -1then 
        local _
,_,towho strfind(data"$ConnectToMe%s+(%S+)%s+.*|"
        
        if 
isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then 
            curUser
:SendData("*** You must get registered to be able to download from Me so contact a person with [G-T-E] Tag to get Registered")     
        
end 

        
return 
    end 

end 


function isEnabled(profile)
    
ret "0"
    
if profile then
        
for iv in Levels do        
            if ( 
== profile then
                ret 
v
            end
        end



Messege to user adjust to ur needs:

curUser:SendData("*** Add ur own messege to user here")     
        
end


Goodluck G8

Cp6uja

GoOd WoRk chila
LOoOL (uk-kingdom)pH?tt?

C===];;;:::::::>-------

siddharta

hi, i need a special variation of this blocker-script: regged users should not be able to d/l from OPs and VIPs either ... if it helps vips on my hub have all the same prefix [VIP]  .... so what i actually need is a script that blocks regged people to download from specified prefixes... but ONLY download should be blocked not search or upload! can you help me with that? thx

Herodes

#49
[*EDIT*] Totaly mistaken, sorry long hours [*EDIT*]

SMF spam blocked by CleanTalk