Skip to content

Root shell exploit for several Xiaomi routers: 4A Gigabit, 4A 100M, 4, 4C, 3Gv2, 4Q, miWifi 3C...

Notifications You must be signed in to change notification settings

acecilia/OpenWRTInvasion

Repository files navigation

Root shell exploit for the router Xiaomi 4A Gigabit Global Edition, firmware version 2.28.132

How to run

# Install requirements
# pip3 install -r requirements.txt
# Run the script
# python3 remote_command_execution_vulnerability.py

After that, a letnet server will be up and running on the router. You can connect to it by running:

telnet <router_ip_address>
  • User: root
  • Password: none (just hit enter)

Install OpenWrt

After login to the router through telnet, run:

cd /tmp
wget http:https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin
mtd -e OS1 -r write openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin OS1

OpenWrt will be installed (without Luci). You can now use ssh to connect to the router (and install Luci if you prefer it).

Demo

Version 0.0.2: telnet

Alt Text

Version 0.0.1: netcat (legacy)

Alt Text

For more info and support go to:

Acknowledgments

  • Original vulnerabilities and exploit: UltramanGaia
  • Instructions to install OpenWrt after exploit execution: rogerpueyo
  • Testing and detailed install instructions: hey07