All Projects → acecilia → Openwrtinvasion

acecilia / Openwrtinvasion

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

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Openwrtinvasion

xiaomi-r3g-openwrt-builder
OpenWrt builder for any supported routers using Docker. Scheduled to run weekly
Stars: ✭ 25 (-93.17%)
Mutual labels:  firmware, openwrt, xiaomi
YAWAC
Yet Another Wifi Auto Connect (YAWAC) is a shell script to connect to a dataset of wireless connection and free hotspot like FreeWifi. It's works on OpenWrt.
Stars: ✭ 22 (-93.99%)
Mutual labels:  router, openwrt
openwrt
OpenWrt Stable 1907 with lean's package
Stars: ✭ 55 (-84.97%)
Mutual labels:  router, openwrt
firmware-core
nodewatcher firmware.
Stars: ✭ 26 (-92.9%)
Mutual labels:  firmware, openwrt
source
Onion's fork of OpenWRT's source build system. The firmware for the Omega2, Omega2+, and Omega2 Pro is based on the openwrt-18.06 branch.
Stars: ✭ 73 (-80.05%)
Mutual labels:  firmware, openwrt
linksys-wrt54g
Exploiting Linksys WRT54G using a vulnerability I found.
Stars: ✭ 31 (-91.53%)
Mutual labels:  firmware, openwrt
slim-wrt
Armor for Openwrt
Stars: ✭ 66 (-81.97%)
Mutual labels:  router, openwrt
Ac2100 Openwrt Guide
Install OpenWrt on the AC2100 (black cylinder)
Stars: ✭ 80 (-78.14%)
Mutual labels:  xiaomi, openwrt
firmware
The Firmware for the Freifunk Bielefeld Community
Stars: ✭ 23 (-93.72%)
Mutual labels:  firmware, openwrt
TG799VAC-XTREME-17.2-MINT
My personal unique wiki for hacking the router firmware used by (Telia)TG799vac Xtream v17.2-MINT delivered from Technicolor
Stars: ✭ 71 (-80.6%)
Mutual labels:  router, openwrt
Asuswrt Merlin.ng
Third party firmware for Asus routers (newer codebase)
Stars: ✭ 3,400 (+828.96%)
Mutual labels:  firmware, router
ancistrus
Netgear's D7000 Nighthawk Router Experience Distributed Project
Stars: ✭ 61 (-83.33%)
Mutual labels:  firmware, openwrt
openlumi.github.io
OpenWrt for Xiaomi Zigbee gateway with imx6 SoC DGNWG05LM, ZHWG11LM
Stars: ✭ 134 (-63.39%)
Mutual labels:  openwrt, xiaomi
Phicomm-K2P-K3-OpenWrt-Firmware
Phicomm K3 OpenWrt firmware Compile by Github Actions,(K2P firmware update,see my mood)
Stars: ✭ 42 (-88.52%)
Mutual labels:  firmware, openwrt
wrt-hisicam
OpenWrt based HiSilicon`s System-On-a-Chip ip camera firmware
Stars: ✭ 21 (-94.26%)
Mutual labels:  firmware, openwrt
HandsomeMod
IOT freedom for end users!
Stars: ✭ 39 (-89.34%)
Mutual labels:  firmware, openwrt
Xiaomi Flashable Firmware Creator
Xiaomi Flashable Firmware Creator
Stars: ✭ 74 (-79.78%)
Mutual labels:  xiaomi, firmware
Open Desk Lamp Firmware
Open source firmware for the xiaomi desk lamp
Stars: ✭ 78 (-78.69%)
Mutual labels:  xiaomi, firmware
Mi Firmware Updater
Auto generates Xiaomi firmware flashable zip files every MIUI new update
Stars: ✭ 322 (-12.02%)
Mutual labels:  xiaomi, firmware
Iotgoat
IoTGoat is a deliberately insecure firmware created to educate software developers and security professionals with testing commonly found vulnerabilities in IoT devices.
Stars: ✭ 275 (-24.86%)
Mutual labels:  firmware, openwrt

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

How to run

NOTE: FROM VERSION 0.0.2 THE ROUTER NEEDS INTERNET ACCESS. If you require to run the exploit without internet access please try version 0.0.1. Find the versions here: https://github.com/acecilia/OpenWRTInvasion/releases

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

You will be asked for the router IP address and for the stok. You can grab the stok from the router URL after you log in to the admin interface:

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

telnet <router_ip_address>
  • User: root
  • Password: root

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

Supported routers and firmware versions

  • MiRouter 4A Gigabit: user ksc91u claims that this method also works on firmware version 2.28.62 and 2.28.132: OpenWrt forum. It is also working on the latest 3.0.24 firmware: OpenWrt forum.
  • MiRouter 4A 100M (non gigabit): user morhimi claims that this method works on firmware version 2.18.51: OpenWrt forum. User Jeffpeng claims that this method works on firmware version 2.18.58: OpenWrt forum.
  • MiRouter 4C: user Jeffpeng claims that this method works on firmware version 2.14.81: OpenWrt forum.
  • Mi Router 3Gv2: user Massimiliano Mangoni claims that this method also works on firmware version 2.28.8 (message posted in Slack).
  • Mi Router 4Q (aka R4C): user cadaverous claims that this method also works on firmware version 2.28.48 (message posted in Slack), but because the router is mips architecture (not mipsel), he needed to use version 0.0.1 of the script (the other versions use a busybox binary built for the mipsel architecture that is used to start a telnet sever).
  • MiWifi 3C: works on firmware versions 2.9.217, 2.14.45 and 2.8.51_INT: OpenWrt forum, OpenWrt forum.
  • Mi Router 4: user Firef0x claims that exploit version 0.0.1 works on firmware version 2.26.175.
  • Xiaomi Mi R3P: user lukasz1992 claims that the exploit works with the Xiaomi Dev firmware.
  • Xiaomi 3Gv1: user krumelmonster claims that exploit works with the stock firmware coming with the router.
  • AC2350 AIOT: user dobosz23 claims that exploit version 0.0.6 works on firmware version 1.3.8CN.

Xiaomi 4A Gigabit Global Edition

Firmwares

This repository contains the following firmwares:

If you have a pending update in your Xiaomi stock firmware, you can check its md5 hash and the download url by navigating to:

http://192.168.31.1/cgi-bin/luci/;stok=<stok>/api/xqsystem/check_rom_update

Install OpenWrt

When installing OpenWrt on the Xiaomi 4A Gigabit, there are several options. Note that there isn't a stable release for it yet, which means that the firmware may be unstable:

  • One of the images listed in the official OpenWrt wiki page

  • Build your own image with imagebuilder, using the latest source code on master:

    docker pull openwrtorg/imagebuilder:ramips-mt7621-master
    docker run --rm -v "$(pwd)"/bin/:/home/build/openwrt/bin -it openwrtorg/imagebuilder:ramips-mt7621-master
    make PROFILE=xiaomi_mir3g-v2 image
    
  • Wait until there is a stable release of OpenWrt

If after reading above text you still want to proceed, after login to the router through telnet run the following commands:

cd /tmp
curl https://raw.githubusercontent.com/acecilia/OpenWRTInvasion/master/firmwares/OpenWrt/06-06-2020/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin --output firmware.bin # Put here the URL you want to use to download the firmware
./busybox sha256sum firmware.bin # Verify the firmware checksum before flashing, very important to avoid bricking your device!
mtd -e OS1 -r write firmware.bin OS1 # Install OpenWrt

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).

Performance:

Some users have reported worse WIFI performance in OpenWrt than in the stock firmware. See the following links:

For more info and support go to:

If you brick your device

You can find solutions in the following links:

Acknowledgments

  • Original vulnerabilities and exploit: UltramanGaia
  • Instructions to install OpenWrt after exploit execution: rogerpueyo
  • Testing and detailed install instructions: hey07
  • Checking the URL of pending updates: sicklesareterrible

Demo

Version 0.0.2 and higher: telnet

Alt Text

Version 0.0.1: netcat (legacy)

Alt Text

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].