-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal/Feature request: AddToBlackList #13
Comments
Precision / security isn't usually a concern for most applications, so I'm not sure that belongs to the library. What you suggest could help, but attackers can just tweak their system a bit and then they are back on the game (e.g: they may ignore the second request coming from a particular host). I'm OK with adding a missing API to the library: "AddToBlackList", which keeps track of IP/port (or just IPs) that seem to be bogus, and refuses to talk to them in next iterations. This could maybe done with a bloomfilter to save memory. But you'd then implement the rest of the logic of finding a bogus peer on your own application. Your application would get the results from PeersRequestResults, then post-process them as you suggested. If you find bogus peers that answer to anything, then you call "dht.AddToBlackList" to permanently prevent it from being used again. |
On 11/10/2013 01:19 AM, Yves Junqueira wrote:
I'm not looking for security, just wanted to spend minimal time/CPU on
If I get popular enough for them to target me I suspect I'll be running
Heh, fancy. I'm hoping there isn't that many, but I haven't tried
Sounds fair.
Sounds good. |
On 11/10/2013 01:19 AM, Yves Junqueira wrote:
I still think AddToBlackList is worthwhile, but the problem is not as As a result I got 150 replies from random IPs, but each one only replied I summed the number of times a reply for each IP: hosts peer IP... [145 or so snipped] So basically things are working pretty well. I'm unsure how 150 hosts could hear of my infohashes though. Assuming 2M hosts, a random dht.PeersRequest request is going to average Still sounds like a reasonable fraction of peers must be malicious. |
@spikebike , are you still interested in this feature? Nobody else seems to have asked for it. |
I am, but don't feel strongly about it. It would be nice to minimize the overhead of running the DHT, keeping evil peers out of the routing table, etc. But I can mitigate the problem outside of nictuku/dht. |
I just noticed Jech's DHT has a reasonable looking implementation. In particular https://github.com/jech/dht/blob/master/dht.c lines 657 and 687 Looks like Jech thought it was a good idea. |
jech's blacklist has only 10 slots and it's used for blocking hosts that send malformed messages. It doesn't seem like he ever removes nodes from that list. So I'm not sure that would suit your needs. But we do have a blacklist of sorts, but it tracks spammy clients. http://godoc.org/github.com/nictuku/nettools#ClientThrottle It should be OK to add a separate list or map of blocked hosts there, and two methods "Block" and "Unblock". Want to send a pull request? |
Annoyingly many peers will claim they are peers for any requested infohash. Some way to black list them would be useful. Two potential strategies:
put anyone that replies on black list.
The text was updated successfully, but these errors were encountered: