repcsi / OpenWRTInvasion

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

The script also starts an ftp server at port 21, so you can get access to the filesystem using a GUI (for example cyberduck).

Install OpenWrt

After login to the router through telnet, run:

cd /tmp
curl -O https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin # Download firmware
./busybox sha256sum openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin # Verify the firmware checksum before flashing, very important to avoid bricking your device!
mtd -e OS1 -r write openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin OS1

This will install the snapshot version of OpenWrt (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

About

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


Languages

Language:Lua 63.1%Language:Python 22.4%Language:Shell 14.5%