Xiaomi Mi Router 4A Gigabit Edition (R4AG/R4A Gigabit) -- fully supported and flashable with OpenWRTInvasion

Here is the modified url (sorry, I'm not allowed to post a functional link here:
http://#ip-of-eu.api.miwifi.com#/rs/grayupgrade?countryCode=EU&rom=2.28.132&serialNumber=12345%2C20009910&rootfs=0.0.1&cfe=1.0.2&deviceID=53662a45-0fa5-3278-637b-4575a6eb2b31&ispCode=&linux=0.0.1&sqafs=0.0.1&hardware=R4A&locale=en_US&ramfs=0.0.1&channel=release&s=0b6118b2342546d44f2ccbb65cebd796&time=2020-03-14--18:24:08&token=8001233f-a1d6-4827-ac81-449395ad6a65

deviceID and serialNumber have been modified!
It contains my deviceid and a timestamp.
The field s= seems to contain a md5sum.
When I've changed any parameter (except the token), the request was answered with HTTP-401

1 Like

@micky0867 can you please join slack to stop spamming the forum

1 Like

Why do you consider this as spamming? This is the purpose of the forum and especially this thread to discuss what's needed in order to support OpenWrt on this router

1 Like

It is very slow to help people here with the script because developing requires a more fluent conversation. For example, all issues in the last 10-15 messages could have been resolved in 10 to 15 minutes in a fluent conversation in Slack.

Because of that, it is very common during development in many open source projects to have a Slack/IRC channel for developers. You can see OpenWrt already has IRC channels for such purpose: https://openwrt.org/contact#irc_channels. IRC channels do not keep a history of the conversation, that is why I prefer Slack.

I am not proposing anything new.

3 Likes

Understandable. Still, the conversation was being interesting :slight_smile: (speak for myself). Don't forget to announce here if anything new comes from your research please, and if you're stuck don't hesitate to ask here. Good job guys.

3 Likes

@rogerpueyo : I would like to update to openwrt.
Do you think that simply using "mtd write xy.bin OS1" should do the trick?
Which image should I use?
Thanks for your support!

1 Like

I have not been following the discussion in this thread since I don't have access to the device anymore. The whole OpenWrt flashing process I followed is described in the first posts.

I don't know if your command will work. 10 days ago, user Double-G kindly wrote this:

1 Like

Guys, I got openwrt install and work properly (without SPI flashing) using OnperWRTInvasion by @acecilia to gain root access; and flash snapshots version of mir3g-v2-squashfs-sysupgrade.bin using @rogerpueyo method found here. after auto reboot, openwrt.

7 Likes

thank you , please make a youtube video Tutorial how you flash openwrt on mi4a gigabit edition ,special thanks to all ppl made this happen great news.

That's super good news, @hey07!

Could you tell us what was the stock firmware version you performed OpenWRTInvasion successfully on? 2.28.132? Was it the one that came with the device, or did you download it from somewhere else?

I'll be adding it to the ToH in the wiki (or, please, feel free to do it).

2 Likes

it is the latest stock 2.28.132. just run OpenWRTInvasion on it directly.

3 Likes

It is easy. or you can follow my summary below. Please thanks @acecilia for his root access script. and flash command by @rogerpueyo

  1. gain root using OpenWRTInvasion (mine running stock 2.28.132)
    you can follow his guide (very clear) or
    -download OpenWRTInvasion here
    -install requirement (I use pi4 raspbian, python ready)
    -open terminal and run "python3 remote_command_execution_vulnerability.py"
    -put your mir4a ip
    -put your mir4a stok (can be found in your router web url, just type router ip your browser)
    the script will upload exploit to your router now you can access using telnet with login "root" without password

  2. Flash openwrt (i used snapshots version of mir3g-v2)
    -telnet using your router ip
    -login with "root"
    -cd /tmp/
    -wget http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin
    (it will download bin file to router tmp folder (wget not recognize https))
    -mtd -e OS1 -r write openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin OS1
    It will say:
    Unlocking OS1 ...
    Erasing OS1 ...

Writing from openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin to OS1 ...
Rebooting ...
-Done (it will reboot and come back with openwrt)

6 Likes

thank you i flashed openwrt after reboot i can't access router gui what should i do ?

edit :i can confirm it works on my router with firmware 2.28.132

but when i connect to 2.4G WIFI it show me no internet connection !!

edit:after flash it again 2.4 ghz wifi works

2 Likes

Hello does anyone have to share original firmware 4th gigabit global ROM: 2.28.132. PLEASE PLEASE.

1 Like

Not that I know, firmware has not been released

1 Like

you can dump your firmware using a ch341a programmer but i didnt backup my original firmware and running openwrt now i dont need stock firmware anymore i'm enjoying openwrt thanks to @acecilia

1 Like

I got a bunch of dumps right here, because I flashed 20+ devices this way. So it should be no problem, to send you one of them.

But the problem could be, that the mac-address of your device would change to that one in the dump.
Also I don´t know, if there is some kind of device-specific calibration data in the dump of if calibration processes are done while booting the device (I think I read something about calibration in the console while the device was booting...).

2 Likes

Can you upload a dump somewhere please? :slight_smile: or even better, two or three dumps, so we can compare them and check what you are saying about the mac address.

1 Like

Of course - any suggestions for a hoster to choose?

1 Like

MEGA
media fire