Table of Contents
Using Kali Linux on Raspberry Pi
Kali Linux is a Linux distribution developed with a focus on penetration testing and security auditing. It prides itself on more than 600 free and open-source security tools. Most users are only familiar with running Kali on their PCs. However, did you know you can actually run Kali on Raspberry Pi? The Raspberry Pi is a small and highly portable device the size of a credit card. You can carry it with you wherever you go and "hack" from anywhere.
Additionally, the Pi comes quite handy when you want to carry out tasks that need to run for a long time without interruption. For example, think of WIFI password cracking. Such tasks can run from a few seconds to many hours. The Pi can be useful for such tasks since you can leave it running inside your 'Office Desk' and continue working with your PC. This post will give you a step0by-step procedure on installing Kali Linux on your Raspberry Pi.
- Raspberry Pi board (2, 3, or 4)
- Reliable power supply
- Micro SD card (at least 8GB)
- Internet access
Step-1. Download Kali Linux ARM image for Raspberry Pi
Since its initial release in March 2013, Kali Linux has received numerous updates and improvements. As of writing this post, Kali Linux is available for Desktops, Virtual Machines, Mobile, Cloud, Docker Containers, Window Subsystem for Linux (WSL), and Live Boot. We will download the Kali LinuxARM image in this post, which runs on ARM architecture devices like the Raspberry Pi.
Step-2. Write Kali ARM Image to SD Card with Balena Etcher
To get started, we will need to write the Kali Linux ARM image on the SD card. For this tutorial, we will use the Balena Etcher utility. It is a cross-platform application available for Linux, macOS, and Windows. When you first launch the application, you will see a window similar to the one below:
Let's discuss the various options available on the Etcher window:
- Flash from file: This option allows you to select the Operating System image you want to write from your PC.
- Select target: This option allows you to select the SD card storage you want to write.
- Flash: Click this button to start writing the image.
When the flashing is complete, eject the SD card from your PC and insert it in your Raspberry Pi to start the installation process.
Step-3. Boot and Install Kali Linux on Raspberry Pi
Before starting your Pi, connect all the peripheral devices you will require. That includes a mouse, keyboard, ethernet cable, and Monitor. Once done, connect the power supply and start your Raspberry Pi. Unlike most operating systems, Kali Linux doesn't provide a configuration page to set up your partitions, language, user, etc. All that is done for you. However, you change these options later in the Settings.
If you are connected to a monitor, you will see lines of characters running down the screen as the kernel is booting. When done, you will see the Kali Linux login window.
Step-4. Logging into Kali Linux
The default login credentials are:
- Username: kali
- Password: kali
In earlier releases of Kali, the default username and password were "
root" and "
toor," respectively. However, that changed since the release of Kali 2020.1 to "
kali" and "
After a successful login, the first thing you need to do is change the default password. Launch the Terminal and execute the command below;
You will be prompted to enter your current password before type your new password.
Note: When typing the password, nothing will be displayed on the screen. This is not a fault but a security measure with most Linux systems. Therefore, type your password and hit Enter when done.
Step-5. Fix Display Resolution
In certain cases, when you first launch Kali on Raspberry Pi, you will notice the display resolution might be a little off. For example, if you are connected to a Monitor/Tv screen, you will notice that the window does not fill the screen's edge. When you try to change the resolution in the Settings window, you find only one display resolution value. In my case, it was 640x480.
To fix this issue, we will need to tweak the default configurations in the
config.txt file. To get started, we need to mount the partition (mmcblk0p1) containing the configuration files. Execute the commands below:
sudo mount /dev/mmcblk0p1 /mnt cd /mnt ls
Now we need to edit the config.txt file indicated in the image above. Execute the command below.
sudo nano config.txt
Look for the two lines 'framebuffer_width' and 'framebuffer_height.' Uncomment these two lines and enter your desired screen resolution values. In my case, I set the 1280x720 resolution.
Save the file (
Ctrl+S) and Exit (
Ctrl +X). Change your working directory to point to your home directory and unmount the device file. Execute the commands below.
cd sudo umount /mnt sudo reboot now
After successfully rebooting your Pi, your Kali should log in with your new set Display resolution.
Tips and Tricks
If you wish to connect a Bluetooth device to Kali Linux on Raspberry Pi 4 board, you need to start the uart helper service. Execute the commands below:
sudo systemctl enable --now uart.service sudo systemctl enable --now bluetooth.service
If you have a problem with audio, that's because, by default, it's routed to the HDMI. To use the 3.5mm jack, execute the command below.
sudo amixer -c 0 set numid=3 1
That's it! You are good to go. I believe up to this point you have Kali installed and running on your Raspberry Pi. Are you just getting started with Penetration testing, be sure to check some of our tutorials to kick start your career.
Please feel free to share your experience with our readers in the comments section.