DHT blocker
 

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

DHT blocker

Started by Jorgo, 05 August, 2010, 20:24:41

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jorgo

A new version of ApexDC++ just came out which has DHT enabled by default. A user in the private hub I'm in nearly had a heart attack when someone who's not a member started downloading files from him - and our user isn't in any other hubs.

What I'm looking for urgently is a method to detect DHT and block users who have it enabled in their client. I'm not sure if this should be done in ptokax itself or by script - either way it's pretty urgent. There are always users who never react to hub announcements where we would ask everybody to turn it off manually.

Because of the urgency of the matter, I'll also post this in the ptokax feature request section - please forgive double posting.

lUk3f1l3w4lK3R

#1
I tried such a script a while ago but with no success.
A script to disconnect users who have DHT enabled would be nice,
cause it doesnt matter on which kind of hub (NMDC or ADC) you are,
with DHT enabled, users that are not on the same hub can leech from you.
I run also a private hub and would like to see such a script
but i think its not possible due to the fact that a client that have the DHT
feature, only sends the info about this support when connecting to a ADC hub.
Therefore i dont see a way to block these clients with a PtokaX script.
When connecting to a ADC hub then ADDHT0 is send in SU (Support).
When this is not send in SU then DHT is disabled.
This info is not send by the client when you connect to a NMDC hub,
not in MyINFO and not in Support.
Maybe i missed something and somebody can enlighten me
but i think its not possible to write such a script for PtokaX.

Naithif

#2
Quote from: StrongDC++ nmdchub.cpp
StringList feat;
				feat.push_back("UserCommand");
				feat.push_back("NoGetINFO");
				feat.push_back("NoHello");
				feat.push_back("UserIP2");
				feat.push_back("TTHSearch");
				feat.push_back("ZPipe0");
					
				if(CryptoManager::getInstance()->TLSOk() && !getStealth())
					feat.push_back("TLS");
					
				if(BOOLSETTING(USE_DHT))
					feat.push_back("DHT0");
					
				supports(feat);



Quote from: Test
$Supports UserCommand NoGetINFO NoHello UserIP2 TTHSearch ZPipe0 TLS DHT0


function SupportsArrival(tUser, sData)
	if string.find(sData, "DHT0") then
		Core.Kick(tUser, "Hub-Security", "Please turn off DHT in Settings/Advanced/Publish shared files on DHT and use it for searching alternate sources")
	end
end


Should work... Modify it to your needs...

Possibly sending a message and disconnecting is better because supports arrive first from a client and maybe even before kicked users check.

Jorgo

That works just fine, thanks a lot!

pR0Ps

#4
Just as an FYI to everyone looking for this, this script works for StrongDC++ 2.30+ and it's derivatives (such as ApexDC++ 1.3.5). At the moment these are the only clients that even support DHT, so this script will detect all DHT users, no exceptions (for now). Thanks for the post Naithif.

EDIT: NMDC hubs will receive "DHT0" while ACD hubs will get "ADDHT0".

Yahoo

gr8 work @ Naithif

seen you are a long time :D
"BoRN FIGhTEr"

PPK

#6
Quote from: pR0Ps on 06 August, 2010, 17:02:11
At the moment these are the only clients that even support DHT, so this script will detect all DHT users, no exceptions (for now).
Wrong, there are other (and older) clients using Kademlia DHT network and they are not detected by this script :P
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

pR0Ps

Hmmm, didn't know that. Good to know. Probably not that relevant though, those clients have been around for a while and this seems to be a new thing for most hubowners. Is there any way to check for people using DHT on those older clients?

Naithif

#8
Quote from: PPK on 06 August, 2010, 23:01:38
Wrong, there are other (and older) clients using Kademlia DHT network and they are not detected by this script :P

That doesn't really count because:

- This feat was requested on other places because Apex 1.3.5 enabled DHT by default. I believe the request here was connected and it is from the hub owner telling why they banned 1.3.5

- Latest kad client is RevConnect that has core 0.674 (other kad clients are even older) which is usually disallowed in private hubs.

PPK

Quote from: Naithif on 07 August, 2010, 13:16:26
- This feat was requested on other places because Apex 1.3.5 enabled DHT by default.
Here it is requested as DHT blocker...
Quote from: Naithif on 07 August, 2010, 13:16:26
- Latest kad client is RevConnect that has core 0.674 (other kad clients are even older) which is usually disallowed in private hubs.
More 0.674 based clients have kademlia. And they all have kademlia from reverse connect (where it is from year 2003)  ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Jorgo

#10
Well, I'm no expert in the matter, but I'd like the script to be as complete as possible. The goal is to not permit any public connections on a private hub.

Naithif

Quote from: PPK on 07 August, 2010, 15:19:53
Here it is requested as DHT blocker...

It does just that.
As far as one can do via hub/scripting. More can be done client level, but I doubt anyone will do that.

Besides the request was started as:

Quote from: Jorgo on 05 August, 2010, 20:24:41
A new version of ApexDC++ just came out which has DHT enabled by default.[...]

So... Exactly...



Quote from: PPK on 07 August, 2010, 15:19:53
More 0.674 based clients have kademlia. And they all have kademlia from reverse connect (where it is from year 2003)  ::)

Yes. What I've tried to say is that 99.99% clients that have kad are stuck on (at most) 0.674.

So banning older clients including 0.674 solves the problem.
Private hubs doesn't rely on usercount anyway, so doing that shouldn't be a problem. Some even enforce a particular client...



P_pan

is it possibble to forward a msg to opchat as soon someone is  using this DHT stuff?

like : user:.... has dht enabled etc etc.... ?

thanks for this great script!

P_pan

#13
Thank You Master Mutor!

getting an little error though
DHT_block.lua: 4: unexpected symbol near "="

and scripts does crash

lUk3f1l3w4lK3R

#14
Quote from: P_pan on 20 August, 2010, 08:59:37
Thank You Master Mutor!

getting an little error though
DHT_block.lua: 4: unexpected symbol near "="

and scripts does crash

remove the , at the end of line 2 and the script starts and you dont get the error message


I get this error message when a registered user try to download filelist from another user:
PtokaX\scripts\kickdht.lua:34:attempt to perform arithmetic on field '?'(a nil value)

P_pan

QuoteI get this error message when a registered user try to download filelist from another user:
PtokaX\scripts\kickdht.lua:34:attempt to perform arithmetic on field '?'(a nil value)

This error i don't have at all.....  total no lua error does show...

Ur Trick did solve  my prob...  Thank You lUk3f1l3w4lK3R



P_pan

getting now indeed this error aswell but now on line 39

PtokaX\scripts\kickdht.lua:39:attempt to perform arithmetic on field '?'(a nil value)

P_pan

Thank You....

works very fine :)

somewherenotthere

Doesnt seem to be working... no errors, just not doing anything.

somewherenotthere

Yes I do/did.

It is working now thought, weird...

kudos to the creators of this script, really really helpful!

merlin_xl54

I started using this in our private hub and seem to be getting quite a few notifications. Even from users with the newest DC++ 0.770. We also have some older clients too. Is there a cut off where clients have it on with no options to turn it off. Can it be listed under any other options? We have a lot of clients pre 0.699 etc?

TIA

M
Living is easy with eyes closed.

P_pan

it looks like this script is a little mean ghost.... :)

error: scripts\DHT_block.lua:50: attempt to concatenate a nil value

:)  on latest build....

For_Ever_MeXxX

#22
Hello,

how I can remove the Botname from the Report in Operator Chat?

<#Operator> <#Kolloid> The Unregistered User, NICK with IP: **.**.**.** is using DHT.


and if I set only Report it Spams the Operator Chat with the same message 5 times or sometimes more...
Look here...

[12:26:30] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:26:30] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:26:30] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:26:30] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT. 
[12:26:31] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:26:31] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:26:31] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:26:31] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT.
[12:26:32] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:26:32] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:26:32] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:26:32] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT.
[12:26:33] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:26:33] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:26:33] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:26:33] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT.
[12:26:34] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:26:34] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:26:34] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:26:34] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT.
[12:26:35] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:26:35] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:26:35] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:26:35] <#Operator> <#Kolloid> The Unregistered User, [ sossana ] with IP: [ **.**.**.** ] is using DHT.
[12:26:35] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT.
[12:27:48] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:27:48] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:27:48] <#Operator> <#Kolloid> The Unregistered User, [ sossana ] with IP: [ **.**.**.** ] is using DHT.
[12:27:48] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:27:48] <#Operator> <#Kolloid> The Unregistered User, [ [RO]90-CMO ] with IP: [ **.**.**.** ] is using DHT.
[12:27:48] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT.
[12:28:46] <#Operator> <#Kolloid> The Unregistered User, [ ROMANIA-GIRL ] with IP: [ **.**.**.** ] is using DHT.
[12:28:46] <#Operator> <#Kolloid> The Unregistered User, [ [ro][rds]fane ] with IP: [ **.**.**.** ] is using DHT.
[12:28:46] <#Operator> <#Kolloid> The Unregistered User, [ sossana ] with IP: [ **.**.**.** ] is using DHT.
[12:28:46] <#Operator> <#Kolloid> The Unregistered User, [ sdhgfnsdfsdxaz ] with IP: [ **.**.**.** ] is using DHT.
[12:28:46] <#Operator> <#Kolloid> The Unregistered User, [ [RO]90-CMO ] with IP: [ **.**.**.** ] is using DHT.
[12:28:46] <#Operator> <#Kolloid> The Unregistered User, [ [RO][AG][RDS][George_2010] ] with IP: [ **.**.**.** ] is using DHT.

somewherenotthere

#23
hey mutor, this is definitely a helpful script, apex users are now aware of the fact that dht is enabled.

The problem that i am experiencing is that, on user arrival, the opchat gets spammed with msgs of all users using dht and multiples of this:

Quote[21:39:34] <*> <*> The Reg, *with I.P.: *.*.*.*is using DHT.
[21:39:34] <*> <*> The Owner, *with I.P.: *..*.*is using DHT.
[21:39:34] <*> <*> The Reg, *with I.P.: *.*.*.*is using DHT.
[21:39:34] <*> <*> The Owner, *with I.P.: *.*.*.*is using DHT.
[21:39:34] <*> <*> The Reg, *with I.P.: *.*.*.*is using DHT.
[21:39:34] <*> <*> The Owner, *with I.P.: *.*.*.*is using DHT.
[21:39:36] <*> <*> The Reg, *with I.P.: **.*.*is using DHT.
[21:39:36] <*> <*> The Owner, *with I.P.: *.*.*.*is using DHT.
[21:39:36] <*> <*> The Reg, *with I.P.: *.*.*.*is using DHT.
[21:39:36] <*> <*> The Unregistered User, *with I.P.: *.*.*.*is using DHT.
[21:39:36] <*> <*> The Owner, *with I.P.: ***.*.*is using DHT.

I have report only on fyi. Any help? it seems like such a random thing

somewherenotthere

Hey Mutor, I did read them yes, and i used the latest one. Unless there is something i missed in those 2 posts? Or perhaps you could make it clearer as to what your suggestion is in those posts?

SMF spam blocked by CleanTalk