Sharing the Secrets: Pwning an industrial IoT router
The web interface of an industrial IoT router encrypted stored secrets such as user passwords and the VPN private certificate character by character, so each character could be recovered independently. An attacker who could reach the web interface and authenticate could decrypt the stored VPN private key and connect to the user's VPN as a device to reach internal networks.
pentestpartners.com
Published on pentestpartners.com
I get involved in a lot of IoT and ICS pen tests and found an interesting device on one of them. I didn’t have enough time on the job to go as deep as I wanted, so got PTP to buy a couple to play with. eBay FTW!
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 application encrypted each character of a secret independently with a deterministic scheme, so identical characters produced identical ciphertext and each position could be brute-forced separately.
Impact
An attacker with local or public IP access and valid credentials could decrypt the stored VPN private key and connect to the user's VPN as a device, reaching internal networks if connected; using Talk2M and changing the default password greatly mitigates the risk.
What the attacker needed
Network access to the web interface; valid credentials (defaults may work); ability to add a user account
The fix
The vendor released updated firmware that should fix the bug, and users should update and avoid exposing the device to the internet.
How it was found
- Authenticate to the router's web interface, for example with default credentials or another route.
- Add a user with a short password and observe the encrypted value returned by the web interface.
- Change one character at a time and compare the encrypted output to map each character.
- Build a lookup for the full password length with a script.
- Apply the same method to the encrypted VPN private certificate.
- Use the recovered private key to connect to the user's VPN as a device.
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.
The router stored secrets in an encrypted form, but the encryption worked one character at a time. That means someone could guess each character separately and check the result, which is far easier than guessing the whole secret at once. With the recovered VPN key, an attacker could join the victim's private network.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.