Anonymous communication with PirateBox
Treasure Chest

Lead Image © drizzed, 123RF.com
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.
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 192.168.188.25 b8:27:eb:31:86:6c Raspberry Pi Foundation 192.168.188.26 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/timesave.sh ./conf/piratebox.conf install 04 $ sudo systemctl enable timesave 05 $ sudo /opt/piratebox/bin/board-autoconf.sh
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.
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/usb_share.sh
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.

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.

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).
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
News
-
Linux Mint Finally Receiving Support for Gestures
If you use the Linux Mint Cinnamon desktop, you'll be thrilled to know that 21.2 is getting support for gestures on touchscreen devices and touchpads.
-
An All-Snap Version of Ubuntu is In The Works
Along with the standard deb version of the open-source operating system, Canonical will release an-all snap version.
-
Mageia 9 Beta 2 Ready for Testing
The latest beta of the popular Mageia distribution now includes the latest kernel and plenty of updated applications.
-
KDE Plasma 6 Looks to Bring Basic HDR Support
The KWin piece of KDE Plasma now has HDR support and color management geared for the 6.0 release.
-
Bodhi Linux 7.0 Beta Ready for Testing
The latest iteration of the Bohdi Linux distribution is now available for those who want to experience what's in store and for testing purposes.
-
Changes Coming to Ubuntu PPA Usage
The way you manage Personal Package Archives will be changing with the release of Ubuntu 23.10.
-
AlmaLinux 9.2 Now Available for Download
AlmaLinux has been released and provides a free alternative to upstream Red Hat Enterprise Linux.
-
An Immutable Version of Fedora Is Under Consideration
For anyone who's a fan of using immutable versions of Linux, the Fedora team is currently considering adding a new spin called Fedora Onyx.
-
New Release of Br OS Includes ChatGPT Integration
Br OS 23.04 is now available and is geared specifically toward web content creation.
-
Command-Line Only Peropesis 2.1 Available Now
The latest iteration of Peropesis has been released with plenty of updates and introduces new software development tools.