REPORT
CEPATO Technical Note2025.08.22

Flashing OpenWRT onto the Xiaomi Router 3A

The complete Xiaomi Router 3A OpenWRT flashing process, from disassembly to flashing, including how to recover from a brick.

Chongxi
Author:Chongxi
steam: —·spotify: —
Tags:#Xiaomi#Custom ROM#OpenWrt
ANALYSIS

INTRO#

As of 2025/08/22, this router costs between ten and thirty yuan, which makes it an excellent cheap pickup for flashing into a soft router.

PREPARATION#

Firmware you need to download: 123684

Tools you need: termius, winSCP

Flashing the modified official firmware#

  1. Open the MIWIFI admin panel and manually upload the upgrade firmware miwifi_r3a_all_da132_2.18.40.bin on the system maintenance page
  2. Wait for the upgrade to finish.

Checking your Windows version#

  • Windows 10, at least 2004, build 19041 or later.
  • Windows 11

Enable Windows Subsystem Linux and Virtual Machine Platform, then restart Windows.

  1. Run PowerShell as administrator.
  2. Enter
PRTCL // BASH
Terminal window
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

You’ll get the following output

PRTCL // BASH
Terminal window
部署映像服务和管理工具
版本: 10.0.26100.1150
映像版本: 10.0.26100.4652
启用一个或多个功能
[==========================100.0%==========================]
操作成功完成。

Next

PRTCL // BASH
Terminal window
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
PRTCL // BASH
Terminal window
Path :
Online : True
RestartNeeded : False

You need to restart Windows.

Installing WSL#

Enter

PRTCL // BASH
Terminal window
wsl --install

What follows is just a normal Ubuntu setup: set up the account and password. It’s normal for the password not to be displayed.

PRTCL // BASH
Terminal window
正在下载: Ubuntu
正在安装: Ubuntu
已成功安装分发。可以通过 “wsl.exe -d Ubuntu” 启动它
正在启动 Ubuntu...
Provisioning the new WSL instance Ubuntu
This might take a while...
Create a default Unix user account: xi
New password:
Retype new password:
passwd: password updated successfully
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
xi@SKYCHOW:/mnt/c/Users/33960$

The Ubuntu environment is now deployed successfully.

Deploying the unlock tool#

  1. In File Explorer, enter \\wsl.localhost\Ubuntu to open the Ubuntu file manager, then open home//
  2. Move OpenWRTInvasion-0.0.10.tar.gz and setup_openwrt_invasion.sh into that directory.
  3. Use the cd /home/xi command to switch to that directory (change xi to your own username)
  4. Grant execute permission
PRTCL // BASH
Terminal window
sudo chmod +x setup_openwrt_invasion.sh
  1. Enter the following command
PRTCL // BASH
Terminal window
cd OpenWRTInvasion-0.0.10
  1. Change the repository address
PRTCL // BASH
Terminal window
nano script.sh

Since the original mirror is dead, we need to edit the download section to the following

PRTCL // BASH
Terminal window
download_file_from_github() {
# Rationale for using --insecure: https://github.com/acecilia/OpenWRTInvasion/issues/31#issuecomment-690755250
curl -L "https://gitee.com/juserzhang/OpenWRTInvasion/tree/master/script_tools$1" --insecure --output "$2"
}

Then press ctrl x to exit

  1. Run
PRTCL // BASH
Terminal window
python3 remote_command_execution_vulnerability.py

The following output appears

PRTCL // BASH
Terminal window
Router IP address [press enter for using the default 'miwifi.com']: 192.168.31.1
Enter router admin password: 12345678

Just enter your IP and admin password Next you’ll see

PRTCL // BASH
Terminal window
There two options to provide the files needed for invasion:
1. Use a local TCP file server runing on random port to provide files in local directory `script_tools`.
2. Download needed files from remote github repository. (choose this option only if github is accessable inside router device.)
Which option do you prefer? (default: 1)

We type 2 and press Enter to run it

PRTCL // BASH
Terminal window
****************
router_ip_address: 192.168.31.1
stok: a80675f22f75d3281445ea2c2638f97e
file provider: remote github repository
****************
start uploading config file...
start exec command...
done! Now you can connect to the router using several options: (user: root, password: root)
* telnet 192.168.31.1
* ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc -o UserKnownHostsFile=/dev/null [email protected]
* ftp: using a program like cyberduck

If you see the output above, congratulations — this part of the process succeeded.

Flashing breed#

  1. Open termius and connect to your router over telnet; both the username and password are root
  2. Check and back up the partitions
PRTCL // BASH
Terminal window
cat /proc/mtd

Back up the partitions, paying attention to the mtd partitions corresponding to factory and BootLoader — the ones you need to back up are factory and BootLoader

PRTCL // BASH
Terminal window
dd if=/dev/mtd4 of=/tmp/eeprom.bin
dd if=/dev/mtd1 of=/tmp/Bootloader.bin
  1. Open WinSCP, select FTP as the protocol, set the host name to the router’s IP, and use root for both the username and password.
  2. Find the tmp directory, copy Bootloader.bin and eeprom.bin to your PC, and copy breed into tmp
  3. Go back to the terminal, cd into the tmp directory, and start flashing breed
PRTCL // BASH
Terminal window
mtd write breed.bin Bootloader

Flashing openwrt#

  1. Make sure your computer is connected to the router’s LAN, then unplug the router’s power. Hold down the reset button, plug the power back in, and release once the indicator light blinks.
  2. Enter 192.168.1.1 to get into the breed admin panel. Check the MAC address here first; if the MAC address is abnormal, flash the eeprom you backed up earlier.
  3. Select openwrt as the firmware and flash it. Here we’re using the openwrt firmware compiled by bilibili@ 小渔学长.

Success#

Wait a moment, enter 10.32.0.1 with the password admin, get into the openwrt admin panel — done.

Special Thanks#

@ 没了钱咋办 @Lonny_Lee @ 正在摸鱼的 Liaronce @acecilia @hackpascal @ 小渔学长

This is Chongxi, looking forward to seeing you next time.

Thanks for watching.

—Chongxi 2025-08-22

Chongxi
CHONGXIAuthor
Steam—
Spotify—
Published at:2025.08.22
Classified
Distribution Notice

Flashing OpenWRT onto the Xiaomi Router 3A

Author CHONGXI/2025.08.22/CEPATO-2025-0822-MIWIFI

This work is licensed under CC BY-NC-SA 4.0. Redistribution, remixing and adaptation are allowed for non-commercial use, provided the same license is used and the original author is credited.

SubscribeDonate
Discussion
Archive_Ref
Copyright © 2011–2026 Chongxi & CEPATO
Powered by Astro & CEPATO-NEXT
StatusNon-Collaborative_Entity // CEPATO_NEXT_v27.0

Type a keyword to search