BitTorrent: IP banning entire nations

Sakunyuusha

New Member
Jan 27, 2008
1,855
3
I would like help learning how to block incoming and outgoing connections to computers located within the United States. In general, I would like to know how to do this for any given country (China, Japan, Korea, Canada, what have you).

Why? Pretty simple. For certain television programs, the American license holder will go onto the BitTorrent network and log every peer who forges connections with them. They will then notify the appropriate authorities and those peers will find themselves hammered with a legal notice. No fun. No fun at all.

So my logic was, "How do I protect myself from getting on those companies' shit lists?" And I figured that the safest tactic would be to just ban the entire country from connecting to me.

Keep in mind: I am in America. So I don't want to ban American connections in a way which would also kill my own ability to connect to people. All I want to do is make it so that I am connecting 100% to Canadians, Japanese, and other non-USA computers.

Can this be done?
 

Asvaldr

北斗神拳伝承者
Jun 18, 2009
257
125
I imagine that it would be possible considering websites like Rapidshare are able to detect how many users are downloading from which country and ban them from downloading anything if the "country"'s download limit is over. Furthermore, on torrent clients like uTorrent, you can see which country people are downloading/uploading from under the peers tab.

Now for the important issue: can you ban them from your client?
I personally haven't tried to do anything of the sort, so I'm not quite sure, but if you can ban IPs at all, I suppose you'd have to know a country's IP (if such a thing exists) or learn which IPs belong to which country and ban those respective IPs. Personally, it sounds like quite the hassle, but I'm sure someone here knows the answer. Good luck, and sorry I wasn't much help (or any help at all for that matter -_-v).
 

Sakunyuusha

New Member
Jan 27, 2008
1,855
3
A second thought which just occurred to me is that, if it's both possible and practical to use a proxy in conjunction with BitTorrent, then that would be the best plan of attack.

To me, "practical" would mean one of two things: either (a) it's very easy to swap back and forth between proxy and non-proxy mode, or else (b) the use of a proxy only subtracts up to 30 kbps from one's downward stream. Because if it's being seeded at 40 kbps, I could handle the drop to 10 (it'd suck, but I could do it), versus if the drop is 40, 60, 100 kbps, it isn't going to be worth it.
 

BadGuy

New Member
May 3, 2009
21
0
The way this is done would be as follows:
http://www.maxmind.com/ << that website has a database of all IP's and their geographical locations. Last time I used it, it would go to country level for free. I did not fully check out the current state, but this is how most sites do the whole IP/Geographical location tracking. If you want to do this, use this geoip database to match IP with location. IP's are unfortunately not matched neatly to country like phone numbers. They're just semi-randomly given out for a given subnet (which is actually something that has some kind of a structure). Proxy's are relatively bad idea since speed goes down and most proxies that allow passthrough of torrent traffic are either transparent or not anonymous enough to not get caught if someone's really trying to catch you. Banning ip's through the Geo IP database is your very best shot.

Hope it helps
 

BadGuy

New Member
May 3, 2009
21
0
Oh just an FYI as far as I know so far micro torrent (and most other tools) use hostnames to determine the country. Using the API for each ip would be a bit much and get everyone just banned from maxmind. Using the offline db would mean some kind of update capability would need to get built, which is why they don't use it. It might be good enough for you though (depending on your technical skills of course)
 

BudEWiser

Active Member
Dec 24, 2008
224
112

When you use peerguardian make sure to get several good IP ban lists, include the gov and p2p blocklists from peerguardian too.

Code:
http://list.iblocklist.com/?list=bt_level2
http://list.iblocklist.com/?list=bt_level1

http://peerguardian.sourceforge.net/lists/gov.php
http://peerguardian.sourceforge.net/lists/p2p.php

It is not guarenteed 100% blocking of dangerous IPs (all these freaks have to do is hire someone to collect peer data on torrents supplied to them), but it is safer than torrents in the nude.
Do make sure that if you trust a particular tracker or what not, and peerguardian is blocking it, to put that ip in your permallow list. iblocklist has a lot of good block files to choose from. Pick wisely and you won't have to pay for their "level 3" list :)