9.3 KiB
DOCUMENT 0 - INITIAL INFORMATION GATHERING
Installation of Custom Software
TODO:
- Check if CFW is installable
0.1 Services Running on the Device
0.2 Hardware and Software Specifications
0.3 Known Vulnerabilities / Problems / Hacks
No known vulnerabilities or hacks were found during research or on CVE.
Common issues for consumers include:
- Touch display glitches/freezing
- Fast battery depletion
- Insufficient motor power/jams
- No response from lock/bridge disconnections
0.4 Collecting APKs
Using the rooted Google Pixel and adb, I was able to obtain the Shelly app.:
adb pull $(adb shell pm path cloud.shelly.smartcontrol | tr -d '\r') ./shelly.apk
Additionally, I found out that there is a specific LOQED app as well, which I also obtained:
adb pull $(adb shell pm path com.loqed.keychain | grep base.apk | tr -d '\r') ./loqed.apk
1.1 && 2.1 Unpacking
The packaging contains:
- A user and safety guide
- The guide explains installation without any pictures but uses pictures to explain the app setup - why?
- Video installation guide
- 8 AA batteries for power supply
- An outdoor module (touch)
- Mounting HW (screws, rings, screwdrivers, ...)
- A lock cylinder
- A bridge
- A motor module
- An indoor module (the lock)
- The shell
The lock is surrounded by a plastic packaging with molds for eah component. Within the box it is kept in place with some cardboard. The box itself is held shut by a small magnet.
1.2 || 2.2 Outer Inspection
Outer Module
The outer module is a touch sensor surrounded by a plastic shell with two screws and one cable inside.
During installation, the cable is supposed to connect to the motor module.
Inner Module
The inner module includes the motor module, which is connected using cables to:
- the power supply
- the touch module
Unopened, it is surrounded by a metal shell which can easily be removed by pulling a plastic strap, as this is necessary during installation.
Bridge
The bridge is to be placed within 3 meters of the lock. It is used to connect the lock to the app. It features a reset button.
1.3 && 1.4 Open Casing / HW Inspection
Bridge
The plastic enclosure of the bridge can be opened by unscrewing two screws, revealingthe PCB.
What you can spot immediately is:
- UART
- ESP32 WROVER B
- WiFi & Bluetooth/BLE capable
- Datasheet
Under the PCB is HW for the power supply.
Outer Module
There are three screws on the back of the touch module, however, it's additonally glued together. It can't be opened without being (probably) permanently damaged.
Inner Module
As I'm working with an already opened device, I'm not interiley sure hw many screws were intially needed to open the motor module, but I'm assuming it were four. After unscrewing these the plastic shell can be removed by gently wiggling it until it comes loose.
Once again you can immedatiely spot UART.
After unplugging all cables, the PCB can be leveraged out of the shell with a flat screwdriver, without causing any damage.
Here you can see:
- UART
I^2C- SoC and access pins
- A buzzer and a button
1.5 Software Components from Firmware Analysis
#TODO
1.6 Collect "Fresh" Firmware Dump
The device has been tampered with before, therefore there is no "fresh" dump available.
1.7 && 2.3 Initial setup
The initial setup is done using the LOQED app, the lock can then be integrateed into the Shelly app. The capture can be found here.
Additionally, the Shelly app offers to download the data stored on the device, which you can find here.
Unsure which IP address is most relevant, here are all Shelly-like or LOQED-like addresses:
34.62.47.252: changelog-backend.shelly.cloud034.95.90.149: control.shelly.cloud104.155.32.247: shelly-120-eu.shelly.cloud34.155.200.196: integrations.loqed.com35.205.173.252: app-ratings.shelly.cloud, paypal.shelly.cloud, shelly-infra1-eu.shelly.cloud34.79.5.199: shelly-101-eu.shelly.cloud35.241.201.25: repo.shelly.cloud
For the PreTester analysis, I chose control.shelly.cloud, as I suspect the lock to communicate to a cloud via the bridge. As the bridge has a built in ESP32 supporting WiFi, I suspect the communication looks as follows:
The PreTester report didn't find anything unusual. It reported no critical or high findings.
Old Initial Setup Capture
You can also find an older initial setup capture made by Manu here. I tested this in the PreTester as well using integrations.loqed.com, as this seemed to be the most present IP in the capture.
The report can be found here. Once again, it reported no critical or high findings.
The old init capture supposedly was the first real fresh setup. As mentioned, the lock has been tempered with before.
2.6 Port Scan
I used the PreTester to probe all URLs and endpoints, here are some (interesting) findings:
While most of ports are common for HTTPS and SSH, there are a few interesting ones:
- 31234 onshelly-101-eu.shelly.cloud: Nmap scan revealed no more information
- 6113 on shelly-120-eu.shelly.cloud: Nmap scan found ports 6115, 6022, 8007, 6114
- It may be important to note that scan took significantly more time (almost 1h) and was eventually aborted
- #TODO: RESCAN
- 9443 on shelly-infra1-eu.shelly.cloud: widely recognized as an alternative or administrative HTTPS port
- 8883 on mqtt.production.loqed.com: official standard port designated for MQTT over TLS (MQTTS)
Some playing around with Metasploit's check on these 2 cloud endpoints couldn't find anything either.
2.7 BLE
I ran ToothFairy on the lock. It's advertising name is "Loqed Inside" and it uses a fixed MAC address FF:EC:EE:E7:32:E5.
I obtained the GATT table and a very incomplete test report, due to a lack of HW.
However, ToothFairy labelled WRLS-FUZZ-002 as FAIL, due to the target not recovering after malformed packets were sent.
Sniffing
After obtaining the needed HW, I tried snifing the app connection process and sent a lock/unlock command, none of which showed ATT protocol packets. This could be due to:
- Encryption on the link layer
- The sniffer struggling with frequency hopping (nRF nordic)
1.8 Collect Firmware Dump of Firmware after initial Setup
Bridge
Hooking up the bridge using UART with a baud rate of 15200 revealed its boot process. Using an older version of esptool, I was able to obtain the firmware:
pipx run --spec esptool==3.3.2 esptool.py -p /dev/ttyUSB1 -b 115200 read_flash 0 0x400000 full_firmware.bin
Writing this down in case I need it again.
FW Analysis
I found an IoT FW analysis tool on GitHub, which I used for generating a quick report.
Reverse Engineer Anything
Using REA, we ran the firmware through Claude Code and received a short report.
Inner Module
Using UART with a baud rate of 115200, I was able to log the boot process & runtime traffic. It seems that the UART link is used for displaying text onto the touch module's display, as you can see it writing whatever the touch module is currently showing. E.g.: "Touch To Lock" or "Locking". Inspect the data here.
In picocom, the device didn't react to any text-based commands.
I also wasn't able to obtain the FW using the test clip from the H451 chip (unknown by mini programmer) or the NOR flash (couldn't grab it).
I tried SWD using the j-link mini, but it kept resulting in an error.
It seems the extraction of the motor module FW exceeds this test.
1.9 && 2.4 Firmware Update / 1.10 Collect Updated Firmware Dump
There is no FW update available.