The Xiaomi Firmware Lockout
Xiaomi routers feature powerful MediaTek and Qualcomm hardware at rock-bottom prices, but their stock MiWiFi firmware locks out advanced networking options. Using the automated OpenWRT-InVasion Python script, we exploit a command injection in the stock web interface to obtain root shell access.
Step 1: Running the OpenWRT-InVasion Exploit
git clone https://github.com/0-kaladin/OpenWRT-InVasion.git
cd OpenWRT-InVasion
pip install -r requirements.txt
python remote_command_execution_vulnerability.py
Enter the router's stock IP (192.168.31.1) and your web admin token (from the browser address bar).
Step 2: Flashing OpenWrt via Telnet / FTP
Connect via Telnet to 192.168.31.1:21, upload your OpenWrt image to /tmp, and flash directly to OS partition:
cd /tmp
mtd -e OS1 -r write openwrt-ramips-mt7621-xiaomi_mi-router-4a-gigabit-squashfs-sysupgrade.bin OS1
Discussion & Insights