Anonymous communication with PirateBox

Treasure Chest

Lead Image © drizzed,

Lead Image © drizzed,

Article from Issue 211/2018

PirateBox provides an easily accessible server for files, chats, and forum posts for meetings of all kinds. The system works without logins and protocols, so users remain anonymous.

Pirates used to have a hard time finding a suitable place for their ill-gotten booty. Today, treasures mainly exist in digital form, but finding a suitable location for a digital treasure chest is still difficult. You need to assemble and set up a small server and install and configure server services. PirateBox uses a Raspberry Pi [1] – any model will do – as a platform for your treasure trove. The system does not even require network access and works completely independently, if required.

Laying Down the Ship

The software comes in the form of a ZIP archive that you unpack and then dd to the memory card as you would a Raspbian image (Listing 1); or, you could use a program like Win32 Disk Imager.

Listing 1

Installing PirateBox

$ sudo dd if=piratebox*.img of=/dev/sdc bs=1M; sync
2068840448 bytes (2,1 GB, 1,9 GiB) copied, 4 s, 517 MB/s
2048+0 Data sets on
2048+0 Data sets off
2147483648 bytes (2,1 GB, 2,0 GiB) copied, 4,95754 s, 433 MB/s

On Linux, you discover the output device ID required for the dd command with the lsblk command (in Listing 1, it's /dev/sdc/). A 4GB SD memory card is sufficient, because the system partition does not automatically expand to the entire disk. The system later stores data on a USB stick or a corresponding hard drive.

PirateBox does not come with a graphical interface. Therefore, you don't need to connect the Raspberry Pi used for the box to a display. Network access is not absolutely necessary, either. On a Raspberry Pi  3 (RPi3) with an integrated WiFi chip, PirateBox automatically sets up a wireless network named PirateBox – Share Freely (Figure 1). You need to associate with this network to configure the system.

Figure 1: After commissioning, associate with the WiFi network provided by PirateBox.

Next, proceed to manage the system through SSH. To access the treasure chest, use

ssh alarm@piratebox.lan

with the alarm password. If you are not working in the PirateBox wireless network,

ssh alarm@alarmpi

also works. If name resolution does not work, you can discover the PirateBox's IP address on a Linux system with an ARP scanner (Listing 2). Alternatively, the classic approach is to look at the network configuration on your Internet router.

Listing 2

Finding the IP Address

$ sudo arp-scan --localnet | grep Raspberry  b8:27:eb:31:86:6c   Raspberry Pi Foundation  b8:27:eb:66:ab:44   Raspberry Pi Foundation

Starboard Side

After flashing the image file and logging in via SSH, PirateBox informs you of the installed version and gives instructions for your first steps (Figure 2). The first thing you should do is change the admin user password with the passwd command. Then, use the date command to enter the current time; the format is YYYYMMDD HHMM. This step is necessary because the Raspberry Pi does not have a battery-buffered clock and has to do without a time server in standalone operation without network access (Listing 3, lines 1-4).

Listing 3

Setting the Current Time

01  $ sudo timedatectl set-ntp false
02  $ sudo date -s "20180418 1841"
03  $ cd /opt/piratebox && sudo ./bin/ ./conf/piratebox.conf install
04  $ sudo systemctl enable timesave
05  $ sudo /opt/piratebox/bin/
Figure 2: PirateBox is configured via SSH. A tutorial with the first steps helps.

As the third step, activate an image and discussion board (last line), if required. During installation, you only need to assign a password for administrative tasks. You can then reach the forum from http://piratebox.lan/board – but only if the user is on the box's wireless LAN. The Kareha [2] software used here is strongly reminiscent of the notorious 4chan anonymous forum (Figure 3). The discussion board only offers the bare essentials, with no user administration.

Figure 3: The Kareha forum used by PirateBox is similar to the infamous 4chan image board.

For more space, connect a USB storage device, which must be formatted with a VFAT partition. Because the PirateBox system does not support the necessary Linux mkfs.vfat command, you have to do this on another computer first. The following command then automatically integrates the medium into the system:

$ sudo /opt/piratebox/rpi/bin/

PirateBox offers a DLNA service (Listing 4), so multimedia files (music and videos) can be played with the appropriate players without having to provide a server or access data.

Listing 4

Setting Up a Media Server

$ sudo cp /etc/minidlna.conf /etc/minidlna.conf.bkp
$ sudo cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf
$ sudo systemctl start minidlna
$ sudo systemctl enable minidlna

Step 6 in Figure 2 is only required if you have equipped the PirateBox Raspberry Pi with a real-time clock (RTC) in the form of a HAT add-on board.

Preparing to Board

Now fully equipped, you can deploy PirateBox at your next pirate meeting, such as a LAN party. You don't have to announce the existence of the box, because the wireless PirateBox – Share Freely will quickly attract the attention of the participants (see also the "On the Network" box). If a known pirate logs in, the web front end opens automatically as a hotspot page with the URL http://piratebox.lan (Figure 4). Thanks to its responsive design, the latest version of PirateBox also works on smartphones.

On the Network

If you do not work with PirateBox's wireless network but would rather connect the system directly to a router, the piratebox.lan address name resolution will not work. Instead, you can access the box with http://alarmpi/content and http://alarmpi/board or, alternatively, through the IP address. However, you must note that the upload function only works with http://piratebox.lan, which is hard coded in the page source. As a remedy, call the routine for uploading data directly through http://alarmpi:8080.

Figure 4: After logging in to the box's wireless LAN, the web front end opens automatically in a browser on compatible systems.

On the PirateBox page, participants can chat anonymously, upload data anonymously, and download data after clicking on Files in the page header (Figure 5). However, in our lab, I encountered limits when uploading: You have to be patient when transferring large files through the Raspberry Pi's WiFi network, and the filesystem used for the USB data carrier does not support files of more than 4GB.

Figure 5: The uploaded data is available to all users without user administration and password protection.

You can access the media server with an appropriate DLNA client without any further configuration. On Windows, for example, foobar2000 [3] acts as a DLNA client (with an additional plugin). The VLC Media Player [4] runs on almost any system, and under Android, you can find free DLNA clients like Slick UPnP [5]. The combination of these two applications lets you play the videos stored on PirateBox on an Android smartphone (Figure 6).

Figure 6: You can stream multimedia files with Slick UPnP on an Android smartphone.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95