RFID scanner Reconnaissance
The RFID scanner had a path traversal in its web interface and command injection in both the web CGI and an unauthenticated Bluetooth RFCOMM service, allowing an attacker to read files and execute commands as root. An attacker could use these flaws to gain SSH access and pivot into the corporate network.
blackarrow.net
Published on blackarrow.net
More than a year ago, BlackArrow’s Red Teamers conducted a security analysis of an RFID scanner used by one of its customers. These kind of devices entail serious risks when integrated into the company’s network.
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
User-supplied input was concatenated directly into shell commands without sanitisation in both the web CGI script and the Bluetooth RFCOMM service.
Impact
An attacker could gain root access to the device and use it to pivot into the corporate network or extract WiFi credentials.
What the attacker needed
Network access to the device; Bluetooth range for RFCOMM attack; ability to crack weak WiFi PSK
How it was found
- Connect a laptop to the device and scan exposed services.
- Exploit the path traversal in the web interface to download configuration files and source code.
- Analyse the source code to find command injection points.
- Use the web command injection to create a new sudo user.
- Log in via SSH using the new user.
- Use the device as a pivot or extract WiFi certificates to access the corporate network.
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 device runs a small web server and a Bluetooth service that accept input from users without checking it properly. Because the input is passed directly to system commands, someone can trick the device into running their own commands, even as the administrator. This lets an attacker take full control of the device and use it to reach the company's internal network.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.