Xiongmai IoT Exploitation
The write-up examines several memory-corruption and command-execution flaws in Xiongmai IoT devices, including a login credential buffer overflow and an RTSP parsing overflow, and shows how an attacker could gain code execution or open a telnet shell. It also describes a honeypot-captured upgrade-protocol payload that runs shell commands to start telnetd.
vulncheck.com
Published on vulncheck.com
There are a number of reasons Xiongmai devices are interesting targets. The first reason is there are a lot of them on the internet.
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 login handler copies the username and password into fixed global buffers with an unbounded string copy, letting a long value overwrite a function pointer.
Impact
An attacker could achieve remote code execution on affected devices, though newer firmware disables data execution and the shellcode space is tight, so exploitation is harder there.
What the attacker needed
Network access to the device; device runs vulnerable firmware; no firewall blocking the port
The fix
Xiongmai should replace the unbounded copies with bounded string functions and remove the debug interfaces, and the text notes the upgrade logic was changed to block telnetd commands.
How it was found
- Send a login request with an overly long username or password to the HTTP interface.
- The long value overwrites the global password buffer and then the function pointer.
- Place shellcode in the password buffer and point the function pointer at its predictable address.
- Trigger the overwritten function pointer so the device jumps into the shellcode.
- Optionally use the path traversal flaw to download Sofia and learn the buffer address.
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.
These are cheap internet-connected cameras and recorders whose software has memory bugs. When a program copies more text into a fixed-size memory area than it can hold, nearby data gets overwritten, and a clever attacker can use that to make the device run their own commands. The article shows how researchers turn such crashes into a working remote shell.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.