Kali Linux On The Raspberry Pi With The Pitft
Kali Linux On The Raspberry Pi With The Pitft
Kali Linux On The Raspberry Pi With The Pitft
Guide Contents 2
Overview 3
Installing Kali 5
Download and Copy Image to SD Card 5
Get a Terminal on Your New Kali Box 6
Basic Post-Installation Setup 8
Configuring the PiTFT 10
If You Don't Care About Using Kali's Kernel Patches 10
If You Want the Kali Kernel Patches 11
Kali isn't intended as a general-purpose desktop OS for end users. Instead, it's a collection of useful
tools for monitoring, exploring, and attacking networks. It comes out of the box with tools like
Wireshark (https://adafru.it/eDB), nmap (https://adafru.it/eZP), and Aircrack-ng (https://adafru.it/eZQ),
and is particularly useful in situations where you just want a disposable machine/installation with
some network tools.
Enter the Raspberry Pi: Cheap, portable, low-power, and easy to customize. There's been a lot of
interest in using small ARM boxes like the Pi with Kali, and it's well-supported by the maintainers.
Since the Raspberry Pi 2 was released, we've gotten a series of requests for help with getting PiTFT
displays to work with Kali on the Pi 2. This guide explains how to do that, and includes a kernel
package built with both our PiTFT configuration and the patches applied for a standard Kali Linux
build.
1. Be good to other people: Don't violate people's privacy, steal their resources, or break their
networks.
2. Do the reading: Learn the purposes and effects of your tools.
3. Remember that even considered, ethical use of the tools on networks you don't own can be
received badly by authorities, or violate some broadly-written laws.
If you're new to topics like pentesting, start by exploring networks you own or have sanctioned
access to.
This guide assumes some experience with GNU/Linux systems (https://adafru.it/eZU), and relies
heavily on the command line (https://adafru.it/eZV).
First, check out the Kali Linux - Raspberry Pi (https://adafru.it/eZW) page. You should find a link to a
downloads page (https://adafru.it/eZX) containing a recent image for the Raspberry Pi A/B+ or the Pi
2 - grab the one that's appropriate for your hardware. I went with kali-1.1.0-rpi2.img.xz .
As of this writing, the v1.0.9 image for the Raspberry Pi A/B+ TFT may work out of the box on
a Model B+ with a PiTFT, and might even supply all the drivers and configuration you need for
the PiTFT display. It will not boot on a Pi 2, which is why we're going to do it the 'long' way
The rest of the Kali installation instructions are quite good - you could probably just follow them and
come back here.
xz --decompress kali-1.1.0-rpi2.img.xz
And used the following dd invocation to copy the image to an SD card in my USB card reader:
If you're using an HDMI monitor and keyboard, you should see a login prompt after the Pi finishes
booting, looking something like this:
Alternatively, you can make sure the Pi is connected to the network, and use an SSH client from
another machine. That's the approach I'm taking:
Just look for the eth0 line containing a string like inet addr:192.168.1.4 .
You could also use the Adafruit Pi Finder (https://adafru.it/eZY) from a Windows, Mac, or Linux
desktop to locate the Pi and get a terminal.
Once logged in, you should do a bit of simple housekeeping on the new installation.
Since it's not very safe to leave the default password on a machine, start by setting a new password
for the root user with the passwd command:
Once that's done, reconfigure the OpenSSH server to generate new host keys with dpkg-reconfigure
openssh-server :
For this guide, I'm using the PiTFT - Assembled 320x240 2.8"
TFT+Touchscreen (https://adafru.it/dDE), but these instructions should work for any hardware
supported by the Adafruit PiTFT Helper (https://adafru.it/eIn), including the 2.8" capacitive version,
the 2.2" version, and the 3.5" version (https://adafru.it/e27).
...and in fact, these would mostly work for Kali. If you just want a working Kali install with the stock
Adafruit kernel, you can mount the boot partition, and then follow the instructions for installing
First, while logged in as root, make sure the boot partition (the first partition on the SD card) is
available for writing:
This will let us install a custom kernel and rewrite files like config.txt and cmdline.txt to configure
the display. Next, add apt.adafruit.com to your package repository lists, and install adafruit-pitft-
helper :
Then wait until everything has installed (this will take quite a while), and run the helper script:
Make sure you change -t 28r to an appropriate value for your hardware, if it differs from the 2.8"
resistive screen. adafruit-pitft-helper -h will list the valid values.
If you're a glutton for punishment, you can build these using our Raspberry Pi Kernel-o-
Matic (https://adafru.it/epp), which uses Vagrant to spin up a little virtual machine just for cross-
compiling Pi kernels. We have a guide (https://adafru.it/f00) for the basics of installation; in particular,
here we need to do a custom build (https://adafru.it/f01) using this branch of the Adafruit kernel
repository (https://adafru.it/f02) which contains Kali's patches along with our tweaks for the PiTFT.
Once you have the Vagrant box running, do vagrant ssh to connect, and then build the kernel like
so:
If you'd rather skip this process, you can download a pre-built set of packages here:
or by running
wget https://adafruit-download.s3.amazonaws.com/adafruit_pitft_kernel_1.20150420-1.tar.gz
Either way, once you have a file like adafruit_pitft_kernel_1.20150420-1.tar.gz , copy it to /root on your
Pi, and extract it like so:
tar xf adafruit_pitft_kernel_1.20150420-1.tar.gz
cd adafruit_pitft_kernel_1.20150420-1
./install.sh
This will take a long time. Once finished, it'll prompt to reboot the Pi immediately. It's safe to say
yes, or no if you want to check the contents of /boot to make sure that the kernel and related files
got replaced properly, which you can do with ls -l /boot :
Finally, download and run the PiTFT helper script. (Grab it directly from GitHub rather than installing
from apt.adafruit.com, because the packaged version depends on a different kernel package.)
And run:
cd Adafruit-PiTFT-Helper
./adafruit-pitft-helper -u /root/ -t 28r
Your output will likely look a bit different from this (I recorded the above GIF after I'd already
configured the screen once), but should be similar.
You should also be able to run startx at the prompt and land on the desktop.