Robot Hacking
Robot Hacking
Robot Hacking
HTTPS
Xiaomi
WiFi
Cloud
ZigBee
Gateway
Dennis Giese and Daniel Wegemer – 34C3 5
Xiaomi Ecosystem
HTTPS
Xiaomi
Cloud
ZigBee
Gateway
Dennis Giese and Daniel Wegemer – 34C3 6
Device Overview
• Hardware Access
– Micro USB Port ?
– Serial Connection on PCB ?
• Network Based
– Portscan ?
– Sniff Network traffic ?
512 MB RAM
STM32 MCU
4GB
R16 eMMC
SOC Flash
WiFi Module
LIDAR UART
R16 UART
(115200 baud)
STM UART Tx
(921600 baud) Rx
Tx
• Maps
– Created by player
– 1024px * 1024px
– 1px = 5cm
<-commands,
Miio_client AES encrypted
reports->
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp)
iPhone App
Robot intern IPC
plain json (tcp)
enc(key) json (tcp/udp)
enc(token) json (udp)
system_b
Download
Data
2. Download [app_url]
system_b
Download
Data
2. Download [app_url]
system_b
Download
Data
system_b
Download
Data
MD5 ok?
system_b
Download
Data
system_b
Download
Data
system_b
Download
Data
Unpack + dd
system_b
Update root pw
Download
in /etc/shadow
Data
system_b
Download
dd
Data
system_b
Download
Data
system_b
Download
Data
rebooting
…
Download
Data
rebooting
…
Download
Data
Download
Data
player
0.0.0.0:6665
wifimgr ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
RoboController
<-commands,
MyMiio_client
cloud client
reports->
AppProxy (local):54322 (tcp)
Android/
https, mqtt, etc…
0.0.0.0:54321 (udp)
iPhone App
Robot intern IPC
plain json (tcp)
enc(key) json (tcp/udp)
enc(token) json (udp)
player
0.0.0.0:6665
wifimgr
RoboController
<-commands,
reports->
AppProxy
player
0.0.0.0:6665
wifimgr
RoboController
<-commands,
My cloud client
reports->
AppProxy (local):54322 (tcp)
FHEM
https, mqtt, etc…
Home Assistant
Robot intern IPC
plain json (tcp)
enc(key) json (tcp/udp)
enc(token) json (udp)
player
0.0.0.0:6665
wifimgr
RoboController
<-commands,
My cloud client
reports->
AppProxy (local):54322 (tcp)
FHEM
https, mqtt, etc…
Home Assistant
/etc/hosts
Robot intern IPC
127.0.0.1 awsbj0... plain json (tcp)
127.0.0.1 aswbj0-files… enc(key) json (tcp/udp)
127.0.0.1 cdn.cnbj0….
enc(token) json (udp)
<-commands,
Miio_client reports->
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp)
iPhone App
Robot intern IPC
plain json (tcp)
enc(key) json (tcp/udp)
enc(token) json (udp)
<-commands,
Miio_client reports->
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp)
iPhone App
Robot intern IPC
/etc/hosts plain json (tcp)
enc(key) json (tcp/udp)
130.83.x.x ot.io.mi.com
enc(token) json (udp)
130.83.x.x ot.io.mi.com
www.dontvacuum.me
Dennis Giese and Daniel Wegemer – 34C3 52
One word of warning…
B D7 D5 D3 D1 D3 D1 CMD RX
D RX TX CMD SCL
E
Recov Confir
F ery m UART2
G RX TX
Line
H IN L
LINE
J IN R
PHO
K NE IN
PHO
L NE IN
PHO MIC1
M NE P
PHO MIC2
N NE P
R
USB- USB-
T LCD9 LCD7 LCD5 LCD3 LCD1 DM0 DP0 USB 1
USB USB- USB-
U LCD8 LCD6 LCD4 LCD2 LCD0 DRV DM1 DP1 USB 2
boot-res a 8 0x00008000
env b 16 0x0000c000
app c 16 0x00014000
recovery d 512 0x0001c000
system_a e 512 0x0011c000
system_b f 512 0x0021c000
Download g 528 0x0031c000
reserve h 16 0x00424000
UDISK i ~1900 0x0042c000
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 61
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 62
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 63
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 64
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 65
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 66
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 67
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 68
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 69
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 70
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 71
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 72
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 73
Communication relations
compass uart_lds uart_mcu
awsbj0.fds.api.xiaomi.com (https)
File:gridmap
File:player_server_*.log <-soundpackages,logs->
player File:SLAM_*.log awsbj0-files.fds.api.xiaomi.com (https)
0.0.0.0:6665 (udp) File:NAV_*.log
maps->,logs->
0.0.0.0:6665 (tcp)
wifimgr cdn.cnbj0.files.fds.api.xiaomi.com (https)
<-firmware
RoboController ot.io.mi.com:80(tcp)
ott.io.mi.com:8053(udp)
<-commands,
rrlogd reports->
File:gridmap
sqlite:robot.db
sqlite:blackbox.db Miio_client
AppProxy (local):54322 (tcp)
Android/
0.0.0.0:54321 (udp) <-commands, iPhone App
reports->
SysUpdate
IPC
Miio_client_helper_nomqtt.sh plain json (tcp)
File:device.conf Miio_send_line enc(key) json (tcp/udp)
File:device.token enc(token) json (udp)
Miio_recv_line
Dennis Giese and Daniel Wegemer – 34C3 74