Slyck.com
 
Slyck Chatbox - And More

Blocking uploads to specific countries

A place for developers and programmers of file-sharing software to discuss issues.
Forum rules
PLEASE READ BEFORE POSTING: Slyck Forum Rules

Blocking uploads to specific countries

Postby ukdnb » Tue Jan 31, 2006 12:39 pm

There's been a discussion here about how blocking uploads to people from your own country could help improve your security. So i thought i'd start a discussion here about how it might be implemented.

This concept could be applied to any filesharing program but i thought i'd start with an Azurues plugin. Not because i particularly like Azurues (i'm a uTorrent man myself) but because it's popular and it's open source and, erm, it supports plugins :P

I don't know anything about developing AZ plugins but i do know Java (although i'm better at C++).

So i'm gonna throw down some ideas here and see what people think before I do some research myself (i won't have time until the weekend).

Who to block?

It's been a while since i used AZ, but if i remember right it already tells you what country the other peers are from. So hopefully it's possible to use this feature to block specific countries. This raises a few questions:

1) Is this accessable from a plugin?
2) How does it determine what country the peer is from?
3) How reliable is it?

Another option is to use GeoIP (is this what AZ uses?) which claims 97% accuracy.

Impact on the network

What affect is blocking uploads to a whole country going to have to a swarm? Well if your in the USA your gonna be blocking a hell of a lot of people. But if the swarms big enough and has enough international peers to max your download then you won't notice a thing. Torrents with not many peers or a torrent that might be of interest to only one country could suffer quite heavily if every one did this.

Maybe it would be best to do this on per torrent basis, so if you want to allow uploads to fellow countrymen on a particular torrent you can (possible with a plugin?).

Abuse

What if someone decides to use this to block uploads to everyone? maybe it should only allow you to block one country? Any legit reason why someone would want to block more than one country?

Built in IP filter.

Azurues has a built in IP filter (i believe?) which could be utilised. Does this block connections in both directions? Do we want that? or just uploads? can it be made to block just uploads?

I'm sure there's more I need to consider but that's all i think of right now.

Anyone know of any AZ plugin developement tutorials or documentation?

Anyone already familiar with developing AZ plugins? I don't mind if you take this idea and code it youself, I'm sure i can find something else to do at the weekend other than learn how to make plugins :P

So, anyone have any thoughts on this? Thinks it's a good idea? Thinks it's a dumb idea? Let me know :)
ukdnb
 
Posts: 17
Joined: Wed Jan 25, 2006 11:13 am
Location: England

Postby Nick » Tue Jan 31, 2006 1:12 pm

As a bit of background on this, I quote from an edited previous posting below

If UK filesharers restrict their shares exclusively to those outside of the UK, then this would exclude investigation by BPI

Similarly, if US users did the same, they would exclude the RIAA (MediaSentry, Bay TSP, etc).
Doubtless the RIAA would cotton on eventually, and they would start basing their detection offshore, but it would slow down their operations

As a point of interest, the Copyright Design & Patents Act (UK) says about imports
http://www.opsi.gov.uk/acts/acts1988/Ukpga_19880048_en_3.htm#mdiv22

Quote:
22. The copyright in a work is infringed by a person who, without the licence of the copyright owner, imports into the United Kingdom, otherwise than for his private and domestic use, an article which is, and which he knows or has reason to believe is, an infringing copy of the work.



Thus an imported copy (digital or otherwise) brought into the UK for such purposes seems to fall outside of the scope of UK copyright protection. Likewise, so would the subsequent re-export of such material.

Now, US law contains an interesting item that may well prove to be the reciprocal:
TITLE 17 > CHAPTER 6 > § 602
http://www.law.cornell.edu/uscode/html/uscode17/usc_sec_17_00000602----000-.html


(2) importation, for the private use of the importer and not for distribution, by any person with respect to no more than one copy or phonorecord of any one work at any one time, or by any person arriving from outside the United States with respect to copies or phonorecords forming part of such person’s personal baggage;



Perhaps this is worth opening up to discussion?
Nick
 
Posts: 3840
Joined: Sun Jan 30, 2005 7:38 am

Postby irish » Tue Jan 31, 2006 1:27 pm

After reading through the previous related thread and now this I'll be very interested as to how this develops. I'm not a programmer, know nothing about java, plugins or whatever but I'm great at giving support. So well done ukdnb for following on with this idea and hopefully it will bear some fruition. :D
And a belated welcome to Slyck
User avatar
irish
 
Posts: 1830
Joined: Tue Feb 15, 2005 5:03 pm
Location: Na hOileain Chanaracha

Postby Nick » Tue Jan 31, 2006 1:47 pm

Yes, forgot to mention that. Well done for stepping in and trying to do something
Nick
 
Posts: 3840
Joined: Sun Jan 30, 2005 7:38 am

Postby BasicTek » Tue Jan 31, 2006 2:50 pm

Nice concept indeed. But some things I think need to be answered 1st.

1) If you are in a country (US, UK, etc) and you successfully block all IP/peers in that country from uploading from your client. Does this keep you safer technically? In other words are the current cases based on data collected from **AA bots inside the users perspective countries or outside?

2) Does this keep you safer legally? Are there any copyright loopholes that could provide an out? Or would it be viewed on a technical level that your client is still creating copies of data on your computer so it doesn't matter with whom you share?


I'm all for anything that can reduce your chances of getting of getting a letter someday. :twisted:
"The government, which was designed for the people, has got into the hands of the bosses and their employers, the special interests. An invisible empire has been set up above the forms of democracy." - Woodrow Wilson
User avatar
BasicTek
 
Posts: 1610
Joined: Sat Jun 04, 2005 12:59 pm
Location: Somewhere warm

Postby Nick » Tue Jan 31, 2006 2:56 pm

As far as legislation is concerned, you are restricting your dealings to import/export and the links mentioned in my post would probably apply.

I'm not sure that it's bullet proof, but it does offer a serious defence opportunity that isn't currently present.
Nick
 
Posts: 3840
Joined: Sun Jan 30, 2005 7:38 am

Postby tarp404 » Tue Jan 31, 2006 11:32 pm

For the country location plugin that's already present, I think it does a WHOIS for each IP that wants to connect, via the whois databases such as ARIN and RIPE. These databases are free to use and easy to design plugins around.

Should be pretty damn easy to hack the plugins' sources to get it to do what you want to do without starting from scratch, since that aforementioned plugin already makes use of the APIs for the whois databases.

A blanket filter using azureus' ipfilter would be a bad idea IMO because you can't invoke the filter on a per-torrent basis, so you'll be creating a performance drain on torrents that don't need to be filtered, stuff like tv shows, games, and indie content. That really would be a critical usability requirement considering how much content is out there these days that isn't under the domain of RIAA/MPAA and hence not needed to be filtered on the basis of country.

Though I dunno how effective this really would be. Most people just roll over if they get sued, not because they're guilty but because they can't afford to fight it. This technique wouldn't stop the extortion because they don't need a solid case in order to file one of their lawsuits. And on top of that, consider the implications of a lawsuit-bot simply using a proxy from outside his country. Is that a loophole? I sure as hell don't know, but it seems like it might be.
what what in the butt
User avatar
tarp404
 
Posts: 375
Joined: Sun Feb 20, 2005 4:31 pm

Postby BasicTek » Wed Feb 01, 2006 7:32 am

Well I did some checking into mediasentry to see if I could find out what countries they were operating in. This quote I found troubling.

Gary Alen Millin President of mediasentry wrote:We have numerous data centres including in those places, plus in the UK, plus we use data centres in Asia from time to time depending on the needs of our clients plus other locations in the US


PDF of interview here, quote taken from the end of page 7

NOTE: I still haven't found anything on the MPAA yet which should be more of a concern to bittorrent users.
"The government, which was designed for the people, has got into the hands of the bosses and their employers, the special interests. An invisible empire has been set up above the forms of democracy." - Woodrow Wilson
User avatar
BasicTek
 
Posts: 1610
Joined: Sat Jun 04, 2005 12:59 pm
Location: Somewhere warm

Postby Nick » Wed Feb 01, 2006 7:41 am

Thanks BT, that is a little troubling.

Having said that, the export of material from the US isn't covered by US legislation - thus I suspect would only amount to an infringement in the country of destination. And it's ok to import into the UK for personal and private use.

And it seems the reciprocal applies from the UK to the US, so I don't see this as a major stumbling block.
Nick
 
Posts: 3840
Joined: Sun Jan 30, 2005 7:38 am

Postby ukdnb » Wed Feb 01, 2006 1:34 pm

tarp404 wrote:For the country location plugin that's already present, I think it does a WHOIS for each IP that wants to connect, via the whois databases such as ARIN and RIPE. These databases are free to use and easy to design plugins around.

This is a plugin? I thought it was something built in to AZ (being able to see what country the peers are from).
I'd rather avoid a whois lookup as they tend to be slow and give much more information than needed, plus if the whois database is down for maintenance or something then it all falls down.
An internal database would be faster and more reliable, if AZ doesn't have one then i'd rather use GeoIP. That's what DC++ uses and seems quite effective.

tarp404 wrote:A blanket filter using azureus' ipfilter would be a bad idea IMO because you can't invoke the filter on a per-torrent basis, so you'll be creating a performance drain on torrents that don't need to be filtered, stuff like tv shows, games, and indie content. That really would be a critical usability requirement considering how much content is out there these days that isn't under the domain of RIAA/MPAA and hence not needed to be filtered on the basis of country.

Yes, i'd agree with a blanket filter not being ideal. but if it's possible to hack it in some way to do what i need then it might save some time and effort. Per torrent would be the ideal solution.
ukdnb
 
Posts: 17
Joined: Wed Jan 25, 2006 11:13 am
Location: England

Postby ukdnb » Sat Feb 04, 2006 6:48 am

Did a bit of work on this last night.

Looks like the best option is to just mod the CountryLocator plugin (it does use GeoIP). Modding it to reject connections from any country is like a couple of lines of code.

Just need to work out how to add a settings page and how to make it per torrent.

With any luck i'll have a working version this weekend :)
ukdnb
 
Posts: 17
Joined: Wed Jan 25, 2006 11:13 am
Location: England

Postby Nick » Sat Feb 04, 2006 6:57 am

I look forward to seeing this. I see what you're doing, but not much I can offer by way of help, though
Nick
 
Posts: 3840
Joined: Sun Jan 30, 2005 7:38 am

Postby BasicTek » Sat Feb 04, 2006 7:50 am

Hmmmm just installed the plugin and it seems to work pretty good. I could kick and ban any users with my countries flag easy enough from my seeds. Although without extra code others would pop in.

1 question ukdnb, will this code you're adding block all dl/ul in a country or just ul?
"The government, which was designed for the people, has got into the hands of the bosses and their employers, the special interests. An invisible empire has been set up above the forms of democracy." - Woodrow Wilson
User avatar
BasicTek
 
Posts: 1610
Joined: Sat Jun 04, 2005 12:59 pm
Location: Somewhere warm

Postby k0D » Sat Feb 04, 2006 8:01 am

banning from flag is very interesting ... i hope you can find a way to ban all country's ips! that would be excellent
k0D
 
Posts: 7
Joined: Fri Feb 03, 2006 8:09 pm

Postby ukdnb » Sat Feb 04, 2006 9:06 am

BasicTek wrote:1 question ukdnb, will this code you're adding block all dl/ul in a country or just ul?


Initially it will block both.
a) because I can't see an easy way to block only uploads
b) i'm not sure if i even want to do that, seems a bit selfish leeching from people whom your not prepared to upload to.
ukdnb
 
Posts: 17
Joined: Wed Jan 25, 2006 11:13 am
Location: England

Postby Nick » Sat Feb 04, 2006 9:09 am

I agree. But if people in all countries were doing that, then it would surely balance out?
Nick
 
Posts: 3840
Joined: Sun Jan 30, 2005 7:38 am

Postby LaX » Sat Feb 04, 2006 9:54 am

Dont think so Nick. Look at me for example. I rarely see anyone connect to me thats in my city, let alone my country, so it wouldnt be a big problem, as nobody would leeching off me.

But if you are in the US or UK, theres a big chance that lots of people from your country that connects to you. That means a big bunch of peers are blocking each other. People in the US can connect to a swarm that has 50 seeds, with 30 of them also from US. Thus, they would only be able to connect to 20 seeds, which is a big speed hit.
User avatar
LaX
 
Posts: 6551
Joined: Sun Oct 23, 2005 7:02 am
Location: One of the multiverses you're not in

Postby irish » Sat Feb 04, 2006 9:57 am

@ukdnb I've just reread your initial posting on impact to the network and it's made me think of the following.

-a choice to block downloads from a certain country (using the plugin) should be made available for individual torrents.
i.e - I'm downloading an episode and I'm blocking country A from providing me downloads but meanwhile a new linux distro iso is only receiving a meagre 2kb due to the connections from country A being blocked.

An individual 'torrent country block' plugin would be ideal.
User avatar
irish
 
Posts: 1830
Joined: Tue Feb 15, 2005 5:03 pm
Location: Na hOileain Chanaracha

Postby abou105 » Sat Feb 04, 2006 12:06 pm

this is a great idea im sorry i dont have much more input but it really is something ive been looking for and hasnt been available. hope it all goes well.
User avatar
abou105
 
Posts: 1468
Joined: Sun Jun 15, 2003 4:00 pm
Location: a place in my head

Postby ukdnb » Sat Feb 04, 2006 1:50 pm

I've made a crude version and it works :)

http://rapidshare.de/files/12550164/Cou ... r.zip.html

Create a folder in your plugins dir and extract this into it. If you already have CountryLocator installed you can just overwrite it with this.

Open settings.txt and replace the "gb" with the country you want to block eg. us, de etc.

Any peers from that country will be added to the session IPFilter. I wanted to avoid using the IPFilter but it doesn't seem to let me just remove peers without banning them as well :/

You can get the source here . If you want to compile it you'll need to grab the original Country locator source from CVS and replace the file from my zip.
Last edited by ukdnb on Sat Feb 04, 2006 1:59 pm, edited 1 time in total.
ukdnb
 
Posts: 17
Joined: Wed Jan 25, 2006 11:13 am
Location: England

Postby LaX » Sat Feb 04, 2006 1:53 pm

Cool thanks! Gonna try it out just before I go to bed.
User avatar
LaX
 
Posts: 6551
Joined: Sun Oct 23, 2005 7:02 am
Location: One of the multiverses you're not in

Postby TcE » Sat Feb 04, 2006 9:46 pm

anyone know JAvA its be sweet if you made a plugin for azureus to do this i can do it manually in azureus aswell but automatically doing it would be cool or if you could right click on a torrent in my torrents view and click block all peers from my country would be really sweet this is a damn good idea :P
TcE
 
Posts: 443
Joined: Thu Dec 29, 2005 7:45 pm

Postby Nick » Sun Feb 05, 2006 5:48 am

i presume it's just me, but I'm damned if I can manage to download from the url given. It asks me if I want free or premium, I say premium and it just hangs rigtht there

Any hints?
Nick
 
Posts: 3840
Joined: Sun Jan 30, 2005 7:38 am

Postby Unbiased_Opinion » Sun Feb 05, 2006 5:51 am

Try the 'free' option nick. :wink:
User avatar
Unbiased_Opinion
 
Posts: 5469
Joined: Fri Jul 16, 2004 6:33 am
Location: US

Postby LaX » Sun Feb 05, 2006 5:51 am

Nick, you gotta pay to use premium. Choose free

Damn you U_O, you just gotta beat me by a few seconds :wink: :P
Last edited by LaX on Sun Feb 05, 2006 5:53 am, edited 1 time in total.
User avatar
LaX
 
Posts: 6551
Joined: Sun Oct 23, 2005 7:02 am
Location: One of the multiverses you're not in

Next

Return to Developers Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron
© 2001-2008 Slyck.com