With 512 Mb Ram, A quad core 1gh CPU, Bluetooth and Wifi. The Raspberry Pi Zero 2 is a great little system to put kali linux onto. Tiny footprint, portable and can run off a power bank. Whats not to love about it. In this guide I will go step by step to install and set up Kali on a Raspberry Pi Zero 2. The products you find here are mostly affiliateed to help keep my site up and running.
All the requirements below are essential but not necessarily the models I am suggesting. Just use what ever works for you. Most of them i have reused many times in other projects so they are quite useful.
|Monitor||You need to be able to see what your doing and when using a pi a portable monitor is really useful.|
|Mini HDMI Cable||Monitor to Pi requires a mini hdmi cable.|
|Raspberry Pi Zero 2||Essential|
|Pi Zero Case||Flirc make the coolest looking cases.|
|OTG cable with USB and Ethernet||This is needed so you can connect over LAN so you wifi is free for something else. Also it gives you 3 powered usb ports.|
|32Gb SD Card||These are cheap and cheerful on Amazon. But pay for a faster one to improve performance.|
|Linux Laptop or PC||You need something to work with. Jut make sure you have a sd card reader.|
|Wireless Keyboard and Mouse||Levonvo Keyboard and Mouse I happen to have. But any would do.|
|Power Supply||To power this raspberry pi and the USB-C monitor I used Aukey 5 port fast charger. It doesn’t seem to be available anymore so I liked an updated version|
Wire it All Up
Now its time to put it all together. It should seem obvious how all the parts go together but one thing of note. As the OTG cable in included is powered, you might think it can also power the raspberry pi zero, don’t do this, you will have wifi issues as there is not enough power. Make sure you plug it into a powered usb slot on the brick that has enough watts and then into the correct power port on the pi zero 2.
Cables get messy when using so small a computer. I’m sure with enough patience they can be tucked away neater than I did.
There are many different versions of Kali linux. For the Pi Zero two we have to chose the right one. Otherwise there will be trouble with the wifi drivers. Head on over to the get-kali site and download the right one.
Download the one called Raspberry Pi Zero 2 W. Its 2G in size and the download is fast if you have a good internet connection.
Create SD Card
If you are using windows then use the tool called “Etcher” to create a sd card from the file you downloaded.
If like me you are using Linux then we can use the command line and the “dd” command to create the sd card.
The file name at the time of writing this is called “kali-linux-2022.2-raspberry-pi-armhf.img.xz”. Its a compress image file in the xz format. It must be uncompressed before installing. This can be done with the “xz” command. Which might need to be installed, the package is called “xz-utils”.
xz -d kali-linux-2022.2-raspberry-pi-armhf.img.xz
This will create a image file called “kali-linux-2022.2-raspberry-pi-armhf.img” which can be used by “dd”. If not already done insert the sd card into your pc/laptop and use “dmesg” to identify the device. Normally its something like /dev/mmcblk0.
Run the “dd” command.
dd if =./kali-linux-2022.2-raspberry-pi-armhf.img of=/dev/mmcblk0 -bs 1M
Boot it up
All going well you should insert the sd card into the pi zero 2 and boot it up.
The default login is Username: kali and Password: kali
Reduce the load
As the pi zero is not exactly a power house of a system, it’s better to reduce the load so you get better results when using it. In this case I would recommend only access it over the network via ssh. However you can use the desktop if you like.
You can disable the Graphical login completely if you use the following command and reboot.
sudo systemctl set-default multi-user
It can be reenabled at any time by running.
sudo systemctl set-default graphical
If configuring Ethernet with the OTG cable then its just a matter of plugging it in with a network and the DHCP server will do the rest.
To configure the Wifi over the command line we can use the wpa package. First its required to create a configuration file.
wpa_passphrase "Wifi_SSID" "password" > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
Replace “Wifi_SSID” with the name of your wifi access point and replace “password” with the password of your wifi.
Delete the line that starts with “psk=”. At the top of the file add the following
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 update_config=1
So the file should look like,
Now start the wpa_supplicant service.
systemctl enable --now wpa_supplicant
Or restart it with
systemctl restart wpa_supplication
Now set up the network service,
sudo vi /etc/systemd/network/wlan.network
[Match] Name=wlan0 [Network] DHCP=ipv4
Enable the network services,
sudo systemctl enable --now systemd-networkd.service sudo systemctl enable firstname.lastname@example.org
Use the below command to get the ipaddress of the wlan0 interface
ip a show wlan0
Now you have the ip, its just a matter of using putty to ssh over to the host to access it remotely.
And with Username: kali and Password: kali
Now reboot and make sure its all working.
I found that the wifi card in the pi zero 2 kept going into low power mode. The solution I found was to put the following into the file “/etc/rc.local”
/sbin/iwconfig wlan0 power off exit 0
The final step in all of this is the case. So shutdown the pi zero 2 with the command.
sudo shutdown -h now
Once shutdown, safely disconnect all the cables attached and put the case one. Then if all the steps above were followed you can just put the usb power into the pi zero and it should boot up and in a few min available on the network via ssh.
Kali Linux is an amazing product when its running on a pi zero 2 it’s just fantastic. After you have it installed you can head on over to some of my other Kali Linux posts