Despite the setup process is pretty easy, it requires some problem solving which takes time. Additionally, the official guide https://www.kali.org/docs/arm/raspberry-pi-zero-2-w-pi-tail/ is outdated, so I decided to make my own.
Refer to https://github.com/Re4son/RPi-Tweaks/blob/master/pi-tail/Pi-Tail.HOWTO for some general tips. But keep in mind that the values may vary.
- Raspberry Pi Zero 2 W
- microSD card (32 GB and higher)
- Micro USB cable to power Raspberry Pi
- OTG adapter and cable to connect to a smartphone
- Android smartphone
- [optional] Laptop/PC (with Linux preferably)
- Kali Linux ARM image https://www.kali.org/get-kali/#kali-arm I used
Raspberry Pi Zero 2 W (PiTail) - Your favourite tool to write an image to microSD card. Both, Rufus and Raspberry Pi Imager work well.
- Smartphone applications:
- Any SSH client. For example, ConnectBot, JuiceSSH, Termux with SSH installed.
- [optional] VNC client. For example, RealVNC
- [optional] Hacker's Keyboard
- Download Kali Linux ARM image and write it to microSD card
- Enable WiFi hotspot on the smartphone and connect to it from a laptop. Say, we have a hotspot HomeWiFi and R4t4m4h4tt4 as a password.
- On the laptop execute
ip ato get assigned IP address and IP mask. For example,192.168.123.x/24(or255.255.255.0as IP mask) - On the laptop execute
route -vto get Gateway IP address. For example,192.168.123.173 - Go to
BOOTpartition on the microSD card and editinterfacesfile:- Rename
iface sepultura inet statictoiface HomeWiFi inet static - Change IP address from
192.168.43.254to192.168.123.254 - Change gateway IP address from
192.168.43.1to192.168.123.173 - [optional] Remove entries for
mobile-1andmobile-2interfaces.
- Rename
- [optional] If you want to keep the hotspot password in secret, use the command
wpa_passphrase <SSID> <PASSWORD>. In our case the command will bewpa_passphrase HomeWiFi R4t4m4h4tt4. This will generate a config. DON'T FORGET TO REMOVE PLAIN TEXT PASSWORD!
network={
ssid="HomeWiFi"
psk=5c69230fd516a10840baf62eff26449e7edd6b821b5bdec86ca2086457674ca4
}
- At
BOOTpartition find and editwpa_supplicant.conffile:- Add
id_str="HomeWiFi"string to the config and write it to the file. The larger number inpriority=parameter, the higher the priority. - [optional] Remove the other entries in the file.
- Add
- Insert microSD card to Raspberry Pi. Plugin power cable to the Raspberry Pi. The first boot may take some time (~10 min)
- [optional] You can connect Raspberry Pi directly to smartphone via OTG adapter and micro-USB cable.
OTG adapter in smartphone, standard cable in Pi-Tail power (USB is free for dongles). More details are here: https://github.com/Re4son/RPi-Tweaks/blob/master/pi-tail/Pi-Tail.README - Wait until the Raspberry Pi connects to your hotspot (you can check the number of connected devices).
- Connect from smartphone via installed SSH-client to SSH server
kali@192.168.123.254default passwordkali - Launch an update in terminal
sudo apt update && sudo apt upgrade