Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
redmi_wifi_ssh — 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. | Kitploit
Tools/GitHubGitHub/ejfkdev/redmi_wifi_ssh
Embedded Systems SecurityIoT SecurityPersistence MechanismsExploitationPost-ExploitationPenetration TestingCommand and ControlHardware & IoT SecurityRemote Access ToolFirmware Analysis
GitHub
10h 18m agoNot yet reviewed
Share
ejfkdev/redmi_wifi_ssh

redmi_wifi_ssh

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.

View Repository

Redmi WiFi SSH

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.

中文 | English


Chinese Documentation

Project Overview

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.

  • Takes effect immediately: no router reboot required.
  • Persistent: SSH is automatically restored after the router reboots, and the password remains the web admin password.
  • Pure standard library: runs on Windows / Linux / macOS, with no dependency on OpenSSL or third-party Python packages.
  • Verified: SSH login was completed on a real RB06 1.0.67 device (uid=0(root)), and a real reboot verification was performed.

Supported Devices and Firmware

ItemContent
DeviceRedmi Router AX6000 (model RB06 / Xiaomi firmware miwifi_rb06)
Firmware1.0.67
Firmware downloadhttps://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rb06/miwifi_rb06_firmware_de54d_1.0.67.bin
Firmware MD59adc67d8b5bd6dce8bff80cc0b5de54d

Features

  • Automatically logs in to the router web API and obtains stok (compatible with the SHA-256 flow of newEncryptMode=1 and the legacy SHA-1 flow).
  • Executes root commands via command injection in the smartcontroller scenario name (CVE-2023-26319 class).
  • Sets the system root login password to the web admin password.
  • Starts dropbear immediately, making SSH available right away.
  • Persistence: /data/xq_ssh/boot.sh + the include hook of /etc/config/firewall.
  • Preserves the dropbear host keys (backed up in /data), so clients will not repeatedly prompt about host key changes after reboot.
  • Automatically verifies SSH password login (when sshpass is available) and checks the persistence configuration.

How It Works

  1. The script calls /api/xqsystem/login to log in and obtain stok.
  2. It creates and starts a scenario via /api/xqsmarthome/request_smartcontroller, injects name into the scenario $(command), and executes commands as root.
  3. The router downloads the configuration script from a temporary local HTTP service and executes it.
  4. The configuration script writes the persistent boot script /data/xq_ssh/boot.sh and executes it once immediately.
  5. It registers an include hook in /etc/config/firewall, which executes the script as root on every boot.
  6. On every boot, boot.sh resets the root password hash, restores the host keys, patches dropbear's release channel check, and starts dropbear.

The /etc of 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.

Requirements

  • Python 3.7+ (Windows / Linux / macOS).
  • The local machine must be reachable from the router: the script temporarily starts an HTTP service on 0.0.0.0 for the router to download the configuration script.
    • On the Windows firewall popup, please allow "Private networks".
  • Optional: 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.

Usage

# 两个位置参数: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

ParameterDescription
ipRouter management address (required, positional parameter 1)
password_posAdmin panel password (positional parameter 2, optional)
--passwordAdmin panel password (alternative to positional parameter 2)
--userSSH username, default root
--portSSH port, default 22
--no-verifyOnly check port 22, do not automatically verify password login
--listen-ipLocal IP used to let the router download the script (auto-detected by default)

SSH Login

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>

Restart Persistence

  • Boot script: /data/xq_ssh/boot.sh (UBI, survives reboot).
  • Boot hook: the firewall.xq_ssh include in /etc/config/firewall (/etc/config is on UBI).
  • Host key: /data/xq_ssh/dropbear_rsa_host_key.
  • Verified with a real reboot: SSH automatically recovers after reboot, uid=0(root), host key unchanged.

Disabling SSH

ssh root@<路由器IP> "/sbin/uci delete firewall.xq_ssh; /sbin/uci commit firewall; killall dropbear; rm -rf /data/xq_ssh"

注意事项

  • 脚本会重启 dropbear 服务,不要通过 SSH 会话运行本脚本(会断开当前连接);在本机直接运行即可。
  • 后台密码连续错误会触发路由器登录锁定,脚本只尝试一次登录。
  • 修改后台密码后,重新运行脚本即可同步 SSH 密码。
  • 固件升级后如果 /data 或防火墙配置被重置,重新运行脚本即可。
  • 仅用于你拥有或已获得明确授权的设备。

免责声明

本项目仅用于合法的安全研究、教学和已授权设备的测试。请勿用于未经授权的设备或网络。使用者需自行承担因使用本工具产生的一切后果,作者不承担任何责任。


English

Overview

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.

  • Takes effect immediately — no router reboot required.
  • Persistent — SSH comes back automatically after reboot, with the same password (the web admin password).
  • Standard library only — runs on Windows, Linux, and macOS without OpenSSL or third-party Python packages.
  • Tested — verified root login (uid=0(root)) on a real RB06 1.0.67 and validated across a real reboot.

Supported Device and Firmware

ItemValue
DeviceRedmi Router AX6000 (model RB06 / Xiaomi firmware miwifi_rb06)
Firmware1.0.67
Firmware downloadhttps://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rb06/miwifi_rb06_firmware_de54d_1.0.67.bin
Firmware MD59adc67d8b5bd6dce8bff80cc0b5de54d

Features

  • Logs in to the router web API and obtains a stok (supports both newEncryptMode=1 SHA-256 and legacy SHA-1 flows).
  • Executes root commands through a smartcontroller scene name command injection (CVE-2023-26319 class).
  • Sets the system root password to the web admin password.
  • Starts dropbear immediately; SSH is usable right away.
  • Persistence via /data/xq_ssh/boot.sh plus a /etc/config/firewall include hook.
  • Keeps the dropbear host key stable (backed up under /data).
  • Verifies SSH password login (when sshpass is available) and checks the persistence configuration.

How It Works

  1. Logs in via /api/xqsystem/login to obtain a stok.
  2. Creates and starts a scene via /api/xqsmarthome/request_smartcontroller, injecting $(command) into the scene name, which is executed as root.
  3. The router downloads a setup script from a temporary local HTTP server and runs it.
  4. The setup script writes the persistent boot script /data/xq_ssh/boot.sh and runs it immediately.
  5. It registers a firewall include hook, which runs the boot script as root at every boot.
  6. On each boot, boot.sh resets the root password hash, restores the host key, patches the dropbear release-channel check, and starts dropbear.
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    974
  • 2

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    760
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    728
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    483
  • 5

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    438
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    397

Explore all tools

Browse our collection of tools

View all tools →