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 a
to get assigned IP address and IP mask. For example,192.168.123.x/24
(or255.255.255.0
as IP mask) - On the laptop execute
route -v
to get Gateway IP address. For example,192.168.123.173
- Go to
BOOT
partition on the microSD card and editinterfaces
file:- Rename
iface sepultura inet static
toiface HomeWiFi inet static
- Change IP address from
192.168.43.254
to192.168.123.254
- Change gateway IP address from
192.168.43.1
to192.168.123.173
- [optional] Remove entries for
mobile-1
andmobile-2
interfaces.
- 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
BOOT
partition find and editwpa_supplicant.conf
file:- 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
[email protected]
default passwordkali
- Launch an update in terminal
sudo apt update && sudo apt upgrade