Python script that enables persistent root SSH on Redmi AX6000 (RB06 1.0.67) routers via a smartcontroller command-injection flaw, setting the root password to the web admin password.
One-click root SSH for Redmi Router AX6000 (miwifi RB06) 1.0.67.
SSH password = web admin password, automatically restored after reboot.
One-click root SSH for Redmi Router AX6000 (miwifi RB06) 1.0.67.
The SSH password equals the web admin password, and SSH is restored automatically after reboot.
redmi_wifi_ssh.py is a cross-platform Python script: enter the router IP and the web admin password to enable root SSH for the Redmi AX6000 (RB06) 1.0.67.
uid=0(root)), and a real reboot verification was performed.| Item | Content |
|---|---|
| Device | Redmi Router AX6000 (model RB06 / Xiaomi firmware miwifi_rb06) |
| Firmware | 1.0.67 |
| Firmware download | https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rb06/miwifi_rb06_firmware_de54d_1.0.67.bin |
| Firmware MD5 | 9adc67d8b5bd6dce8bff80cc0b5de54d |
stok (compatible with the SHA-256 flow of newEncryptMode=1 and the legacy SHA-1 flow).name (CVE-2023-26319 class)./data/xq_ssh/boot.sh + the include hook of /etc/config/firewall./data), so clients will not repeatedly prompt about host key changes after reboot.sshpass is available) and checks the persistence configuration./api/xqsystem/login to log in and obtain stok./api/xqsmarthome/request_smartcontroller, injects name into the scenario $(command), and executes commands as root./data/xq_ssh/boot.sh and executes it once immediately./etc/config/firewall, which executes the script as root on every boot.boot.sh resets the root password hash, restores the host keys, patches dropbear's release channel check, and starts dropbear.The
/etcof RB06 1.0.67 is a ramfs (lost on reboot), so the password hash and init script modifications must be reapplied on every boot by the boot script in/data.
0.0.0.0 for the router to download the configuration script.
sshpass (Linux/macOS), used to automatically verify password login. Windows does not have sshpass by default, so the script will only check port 22 and provide a manual connection command.# 两个位置参数:IP + 后台密码
python3 redmi_wifi_ssh.py <路由器IP> '<后台管理密码>'
# 或用 --password
python3 redmi_wifi_ssh.py <路由器IP> --password '<后台管理密码>'
# 不传密码则交互输入
python3 redmi_wifi_ssh.py <路由器IP>
示例:
python3 redmi_wifi_ssh.py 192.168.31.1 'my-password'
python3 redmi_wifi_ssh.py 10.0.0.142 --password 'my-password'
python3 redmi_wifi_ssh.py 10.0.0.142 --no-verify
The last two lines of output after success:
ssh -o HostKeyAlgorithms=+ssh-rsa root@<路由器IP>
# 以上为 SSH 连接命令,SSH 密码 = Web 后台管理密码
| Parameter | Description |
|---|---|
ip | Router management address (required, positional parameter 1) |
password_pos | Admin panel password (positional parameter 2, optional) |
--password | Admin panel password (alternative to positional parameter 2) |
--user | SSH username, default root |
--port | SSH port, default 22 |
--no-verify | Only check port 22, do not automatically verify password login |
--listen-ip | Local IP used to let the router download the script (auto-detected by default) |
Modern OpenSSH disables ssh-rsa host keys by default; you need to explicitly allow them when connecting:
ssh -o HostKeyAlgorithms=+ssh-rsa root@<路由器IP>
Password = Web backend management password.
It can also be written to ~/.ssh/config:
Host <路由器IP>
HostKeyAlgorithms +ssh-rsa
Then simply:
ssh root@<路由器IP>
/data/xq_ssh/boot.sh (UBI, survives reboot).firewall.xq_ssh include in /etc/config/firewall (/etc/config is on UBI)./data/xq_ssh/dropbear_rsa_host_key.uid=0(root), host key unchanged.ssh root@<路由器IP> "/sbin/uci delete firewall.xq_ssh; /sbin/uci commit firewall; killall dropbear; rm -rf /data/xq_ssh"
/data 或防火墙配置被重置,重新运行脚本即可。本项目仅用于合法的安全研究、教学和已授权设备的测试。请勿用于未经授权的设备或网络。使用者需自行承担因使用本工具产生的一切后果,作者不承担任何责任。
redmi_wifi_ssh.py is a cross-platform Python script that enables root SSH on a Redmi AX6000 (RB06) running firmware 1.0.67. Pass the router IP and the web admin password; the script does the rest.
uid=0(root)) on a real RB06 1.0.67 and validated across a real reboot.| Item | Value |
|---|---|
| Device | Redmi Router AX6000 (model RB06 / Xiaomi firmware miwifi_rb06) |
| Firmware | 1.0.67 |
| Firmware download | https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rb06/miwifi_rb06_firmware_de54d_1.0.67.bin |
| Firmware MD5 | 9adc67d8b5bd6dce8bff80cc0b5de54d |
stok (supports both newEncryptMode=1 SHA-256 and legacy SHA-1 flows).name command injection (CVE-2023-26319 class)./data/xq_ssh/boot.sh plus a /etc/config/firewall include hook./data).sshpass is available) and checks the persistence configuration./api/xqsystem/login to obtain a stok./api/xqsmarthome/request_smartcontroller, injecting $(command) into the scene name, which is executed as root./data/xq_ssh/boot.sh and runs it immediately.boot.sh resets the root password hash, restores the host key, patches the dropbear release-channel check, and starts dropbear.