LJ Archive

PirateBox

Adrian Hannah

Issue #219, July 2012

The PirateBox is a device designed to facilitate sharing. There's one catch, it isn't connected to the Internet, so you need to be close enough to connect via Wi-Fi to this portable file server. This article outlines the project and shows how to build your own.

In days of yore (the early- to mid-1990s) those of us using the “Internet”, as it was, delighted in our ability to communicate with others and share things: images, MIDI files, games and so on. These days, although file sharing still exists, that feeling of community has been leeched away from the same activities, and people are somewhat skeptical of sharing files on-line anymore for fear of a lawsuit or who's watching.

Enter David Darts, the Chair of the Art Department at NYU. Darts, aware of the Dead Drops (deaddrops.com) movement, was looking for a way for his students to be able to share files easily in the classroom. Finding nothing on the market, he designed the first iteration of the PirateBox.

The PirateBox is a self-contained file-sharing device that is designed to be simple to build and use. At the same time, Darts wanted something that would be private and anonymous.

The PirateBox doesn't connect to the Internet for this reason. It is simply a local file-sharing device, so the only thing you can do when connected to it is chat with other people connected to the box or share files. This creates an interesting social dynamic, because you are forced to interact (directly or indirectly) with the people connected to the PirateBox.

The PirateBox doesn't log any information. “The PirateBox has no tool to track or identify users. If ill-intentioned people—or the police—came here and seized my box, they will never know who used it”, explains Darts. This means the only information stored about any users by the PirateBox is any actual files uploaded by them.

The prototype of the PirateBox was a plug computer, a wireless router and a battery fit snugly into a metal lunchbox. After releasing the design on the Internet, the current iteration of the PirateBox (and the one used by Darts himself) is built onto a Buffalo AirStation wireless router (although it's possible to install it on anything running OpenWRT), bringing the components down to only the router and a battery. One branch of the project is working on porting it to the Android OS, and another is working on building a PirateBox using only open-source components.

How to Build a PirateBox

There are several tutorials on the PirateBox Web site (wiki.daviddarts.com/PirateBox_DIY) on how to set up a PirateBox based on what platform you are planning on using. The simplest (and recommended) way of setting it up is on an OpenWRT router. For the purpose of this article, I assume this is the route you are taking. The site suggests using a TP-Link MR3020 or a TP-Link TL-WR703N, but it should work on any router with OpenWRT installed that also has a USB port. You also need a USB Flash drive and a USB battery (should you want to be fully mobile).

Assuming you have gone through the initial OpenWRT installation (I don't go into this process in this article), you need to make some configuration changes to allow your router Internet access initially (the PirateBox software will ensure that this is locked down later).

First, you should set a password for the root account (which also will enable SSH). Telnet into the router, and run passwd.

The next thing you need to do is set up your network interfaces. Modify /etc/config/network to look similar to this:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.2.111'
        option netmask '255.255.255.0'
        option gateway '192.168.2.1'
        list dns '192.168.2.1'
        list dns '8.8.8.8'

assuming that the router's IP address will be 192.168.2.111 and your gateway is at 192.168.2.1.

Next, modify the beginning of the firewall config file (/etc/config/firewall) to look like this:

config defaults
        option syn_flood     '1'
        option input         'ACCEPT'
        option output        'ACCEPT'
        option forward       'ACCEPT'
#Uncomment this line to disable ipv6 rules
#       option disable_ipv6  1

config zone
        option name          'lan'
        option network       'lan'
        option input         'ACCEPT'
        option output        'ACCEPT'
        option forward       'ACCEPT'

config zone
        option name          'wan'
        option network       'wan'
        option input         'ACCEPT'
        option output        'ACCEPT'
        option forward       'ACCEPT'
        option masq          '1'
        option mtu_fix       '1'

Leave the rest of the file untouched.

In /etc/config/wireless, find the line that reads “option disabled” and change it to “option disabled 0” to enable wireless. At this point, you need to reboot the router.

Now, connect a FAT32-partitioned USB Flash drive to the router, and run the following commands on the router:


cd /tmp
wget http://piratebox.aod-rpg.de/piratebox_0.3-2_all.ipk
opkg update && opkg install piratebox*

When you restart the device, you should see a new wireless network called “PirateBox - Share Freely”. Plug your router in to a USB battery, and place everything into an enclosure of some kind (preferably something black with the Jolly Roger emblazoned on the side). Congratulations! With little to no hassle, you've created a mobile, anonymous sharing device!

Using the PirateBox

The point of the PirateBox is to be integrated easily into a public space with zero effort on the part of the end user; otherwise, no one ever would use it! This means using it has to be incredibly simple, and it is. If you are connected to the “PirateBox - Share Freely” network and you try to open a Web page, you automatically will be redirected to this page (Figure 1).

Figure 1. PirateBox Home Screen

As you can see, you are given choices as to what you wish to do: browse and download files, upload files or chat with other users—all of which is exceedingly easy to do. Go build your own PirateBox and get sharing!

Adrian Hannah has spent the last 15 years bashing keyboards to make computers do what he tells them. He currently is working as a system administrator for the federal government. He is a jack of all trades and a master of none. Find out more at about.me/adrianhannah.

LJ Archive