Anatomy of an IoT Exploit, from Hands-On to RCE
The Wavlink AC1200 router's web interface contains CGI binaries that fail to check authentication before processing user input, and one binary passes the 'ip' query parameter directly to a system command. An attacker on the LAN could exploit this to execute arbitrary commands without authentication.
Published on klogixsecurity.com
This post breaks down a real-world IoT exploitation chain targeting a consumer router, from firmware analysis to unauthenticated RCE.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the CGI binary live_api.cgi does not call the authentication check function before processing the 'ip' parameter, and then passes that parameter unsanitised to a system command.
Impact
An attacker on the LAN could achieve remote command execution on the router without authentication, leading to full device takeover.
What the attacker needed
Access to the LAN interface; router with vulnerable firmware
How it was found
- Obtain the router firmware from the vendor's support site and extract it with binwalk.
- Use Ghidra to decompile the CGI binaries and identify those that do not call check_valid_user.
- Find that live_api.cgi passes the 'ip' query parameter to a system command without authentication.
- Send a crafted request to /cgi-bin/live_api.cgi with a malicious 'ip' parameter to execute commands.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This router's web management interface has a flaw: some of its programs run before checking whether the person making the request is logged in. One of these programs takes a value from the web address and uses it as part of a system command, so an attacker on the same local network can run their own commands on the router without needing a password.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.