How to Create a Portable Hacker Station With Raspberry Pi and Kali Linux
Hacking Wi-Fi passwords , spoofing accounts, and testing networks for exploits are all fun enough, but if you want to take the show on the road, you’ll need an easily portable setup. Log into Kali Linux and Raspberry Pi .
This post is part of our Evil Week series on Lifehacker where we take a look at the dark side of goal achievement. Sometimes evil is justified, and sometimes knowing evil means knowing how to defeat it. I want more? Visit our wicked week tags page .
Kali Linux is an operating system built for network penetration testing . You can run it on your laptop to crack nearby Wi-Fi passwords, spoof networks, check for Bluetooth vulnerabilities, and more. Remember, using this knowledge to hack into secure networks is likely to result in arrest and a felony charge – possibly a federal charge of violating the Computer Security Act. You should use this knowledge only for the good, for your own training and play only with those networks that you control. We’ve talked in some detail about using Kali Linux before , so we won’t go into details, but check out our guide for an overview of everything you can do with it . All of this applies to the version of the Raspberry Pi that we will create here.
The Raspberry Pi is a small credit card sized computer that doesn’t require a lot of power to use. When you pair the Raspberry Pi and Kali Linux together, you have a super portable network testing machine that you can take with you wherever you go. In this tutorial, we’ll show you how to run Kali on a Raspberry Pi with a touchscreen. This way, you never have to install Kali Linux on your main computer.
What do you need
- Raspberry Pi ( Model B / B + or 2 , however the Raspberry Pi 2 requires a few extra steps to install, so if you don’t want to go through them stick with Model B +)
- Battery ( Any of these 5V external USB batteries made for smartphones should work, although there are more elegant solutions out there if you’re interested )
- Wi-Fi card
- 8GB SD card
- PiTFT touchscreen ( update: an older version of this post pointed to this screen , which still works, but not suitable for Raspberry Pi 2 or other newer Pi)
- Carrying case (optional, but if you carry your Raspberry Pi around it is useful. This cover from Adafruit, made to pack in PiTFT, and Model B is a great option if you are working with this model).
- Keyboard (I like to use a small wireless keyboard with touchpad like this to fit in a small bag).
- Desktop computer (for initial setup)
Step one: install Kali on your Raspberry Pi
Before we do anything, you need to download and install the Kali Linux Touch Screen Image Build for the Raspberry Pi. It’s like installing any other Raspberry Pi operating system we’ve covered in detail here , but here’s a short version:
How to install Kali to SD card on Windows
- Download the Kali Linux Raspberry Pi image for your hardware (B / B + users should get the TFT version, Raspberry Pi 2 the Pi 2 version) and unzip the .img file inside. Note. If you are not using a touchscreen display, download the regular Kali Linux version for Raspberry Pi .
- Download Win32DiskImager and unzip the application (.exe file) inside.
- Insert the SD card into your Windows computer using a card reader.
- Open Win32DiskImager.exe, the application you just downloaded, by double clicking on it. If you are using Windows 7 or 8, right-click it and select “Run as administrator”.
- If your SD card is not automatically detected by the application, click the drop-down menu in the upper right corner (labeled “Device”) and select it from the list.
- In the application section with image files, click on the small folder icon and select the Raspbian .img file you just downloaded.
- Click the Write button and wait for Win32DiskImager to do its job. When it’s over, you can safely remove the SD card and insert it into your Raspberry Pi.
How to install Kali to SD card on OS X
- Download the Kali Linux Raspberry Pi image for your hardware (B / B + users should get the TFT version, Raspberry Pi 2 the Pi 2 version) and unzip the .img file inside. Note. If you are not using a touchscreen display, download the regular Kali Linux version for Raspberry Pi .
- Download the RPi-sd map builder (be sure to select the correct version for the OS X version you have installed) and unzip the application.
- Insert your SD card into Mac using a card reader.
- Open the RPi-sd Map Designer. You will be immediately prompted to select a Raspbian image. Select the .img file you downloaded earlier.
- You will be asked if your SD card is connected. Since we inserted it earlier, it is, so click “Continue”. You will be presented with SD card options. If you only have one inserted, you will not see anything else in the list and it will be checked. If not, just check only the card you want to use and click OK.
- Enter the administrator password and click OK.
- You will be asked if the SD card has been removed. This must happen because the application must unmount it in order for it to perform a direct copy. Check again that your SD card is no longer available in Finder. DO NOT remove it from the USB port. If you are sure, click “Continue”.
- The RPi-sd card maker finishes preparing your SD card, safely ejecting it, and inserting it into your Raspberry Pi device.
Step two: connect the display
The Raspberry Pi has a GPIO (Universal I / O) that the touchscreen fits into. On a Raspberry Pi, it’s a set of pins in the corner – it should be pretty obvious how they fit together. Go ahead and insert your display into the Raspberry Pi.
Step three: plug everything in and turn on the power
After connecting the display, it’s time to connect everything else. Connect the Wi-Fi adapter and keyboard to the USB ports. Then connect the Pi to a battery pack.
The startup process can be a little slow and clunky here, so don’t worry if it takes a little time. You will first see a white screen for a while before the download process starts. Finally, you are greeted by a login screen.
If you are using a Raspberry Pi 2, you will need to do some tweaks here for the screen to work. If you are using B +, go to the next step.
The Raspberry Pi 2 currently requires additional steps to get the screen working. On initial boot, you are greeted with a sad white screen. Fortunately, getting the screen to work isn’t that hard. Unfortunately, you’ll either need an HDMI monitor to connect the Pi, or you’ll need to login via SSH to get through this part . Plug in any of them and boot the Pi now.
- You will see a prompt for username and password from the command line on the Raspberry Pi. Enter the username
root
and passwordtoor
. - Start by mounting your boot partition. Type
mount /dev/mmcblk0p1 /boot
and press Enter. - Then you will download and install the Adafruit installer. Type
wget http://adafruit-download.s3.amazonaws.com/adafruit_pitft_kernel_1.20150420-1.tar.gz
and press Enter. - Type
tar xf adafruit_pitft_kernel_1.20150420-1.tar.gz
and press Enter to extract this file. - Type
cd adafruit_pitft_kernel_1.20150420-1
and press Enter. - Type
./install.sh
and press Enter. It will take some time. When it finishes, it will ask you to reboot. Say yes and wait for the reboot. - Enter
git clone https://github.com/adafruit/Adafruit-PiTFT-Helper.git
and press Enter to load the Adafruit screen software. - Ok, now you need to mount your boot disk again. Type
mount /dev/mmcblk0p1 /boot
and press Enter. - Type
cd Adafruit-PiTFT-Helper
and press Enter. - Type
./adafruit-pitft-helper -u /root/ -t 28r
and press Enter. This sets up your display. - Now you need to fix some issues where the loading screen only shows a blinking cursor. Type
sudo apt-get install xserver-xorg-video-fbdev
and press Enter. - After that type
cd /usr/share/X11/xorg.conf.d/
and press Enter. - Finally, type
nano 99-fbdev.conf
and press Enter. This will open a text file. You will need to copy the following piece of code into the file:
Section "Device" Identifier "myfb" Driver "fbdev" Parameter "fbdev" "/ dev / fb1" End of section
When you’re done press Ctrl + X to save and exit.
This should do the trick. Go ahead and type reboot and press Enter to restart the Pi with a working screen.
Step four: login and turn on your wifi card
Now it’s time to log in and turn on the wifi card so you can actually use the tools inside Kali Linux. The Raspberry Pi will automatically recognize your Wi-Fi card, but you still need to log into your network. First thing we need to do is launch the Kali Linux GUI and make sure everything works:
- You will see a prompt for username and password from the command line on the Raspberry Pi. Enter the username
root
and passwordtoor
(we will change this later). - Type
startx
and press Enter to load the Kali GUI. It may take a while for the Pi to boot. - You can now navigate your Pi using the touchscreen and keyboard. Tap the small terminal icon on the dock at the bottom to open a command prompt.
- To configure the Wi-Fi card, enter
nano /etc/network/interfaces
at the command prompt and press Enter to load the configuration file for the Wi-Fi settings. - Add the following lines to the text file you just opened, substituting your network information:
auto wlan0iface wlan0 inet dhcpwpa-ssid "your network name" wpa-psk "network password"
When you’re done press Ctrl + X to save and exit. Your Wi-Fi card should now be working (although you may have to reboot first).
Step five: change your password
Before doing anything else, you should really change your device’s root password (so someone with similar hacking skills doesn’t gain control of it). Fortunately, it’s simple.
- While you are still at the command prompt (if not, just click the terminal icon in Kali to open it again), type
passwd
and press Enter. - Enter your new password twice.
- It is also good to reconfigure your OpenSSH server now so that it is not used by default. Type
dpkg-reconfigure openssh-server
and press Enter.
Your little portable system is now set up and secure.
What can you do with this device
It is now up to you to decide what you will do with your little portable hacking station. You can use the Pi’s touchscreen for basic navigation and run any program in Kali Linux you want. If you’re unsure of where to start, here are some ideas:
- Set up SSH to connect to the Pi remotely
- Learn command line basics
- Hack Wi-Fi password, create a fake network, or monitor the traffic of another device
- Keep track of everything that happens on the network
- More Kali Linux tutorials
The world is your oyster. Hack responsibly, everyone.