This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 2021:xiaomi_flash [2021/10/20 11:17] – [Finding the stok code on the router] admin | 2021:xiaomi_flash [2021/11/03 15:43] (current) – [Flashing the new firmware] admin | ||
|---|---|---|---|
| Line 64: | Line 64: | ||
| ===== Invading the Router ===== | ===== Invading the Router ===== | ||
| - | * We assume you are on a working | + | * We assume you have an installation of Ubuntu 20.04. |
| * Make sure python3-pip and git is installed | * Make sure python3-pip and git is installed | ||
| <code bash> | <code bash> | ||
| Line 75: | Line 75: | ||
| git clone https:// | git clone https:// | ||
| </ | </ | ||
| - | * Install the requirements and run it. You will need Admin rights to run the program else if will not work. | + | * Install the requirements and run it. You will need Admin rights to run the program else it will not work. |
| <code bash> | <code bash> | ||
| cd OpenWRTInvasion/ | cd OpenWRTInvasion/ | ||
| Line 83: | Line 83: | ||
| </ | </ | ||
| * This will start the program and ask two questions for it to complete the invasion | * This will start the program and ask two questions for it to complete the invasion | ||
| - | * Router IP address. The default as stated and specified will be 192.168.31.1. | + | |
| - | * Stok value. This is the value shown after you went through the initial setup wizard of the router. | + | |
| * Mine was http:// | * Mine was http:// | ||
| * Note that this value is generated on the fly and changes next time the router boots again. | * Note that this value is generated on the fly and changes next time the router boots again. | ||
| - | |||
| <code bash> | <code bash> | ||
| Line 109: | Line 108: | ||
| * As you can see from the snippet above there are a couple ways of reaching the invaded router. | * As you can see from the snippet above there are a couple ways of reaching the invaded router. | ||
| - | * Please note that the router is fairly robust | + | * Please note that the router is fairly robust |
| - | * //So don't be to nervous when flashing the router as you always restore it again.// | + | * //Don't be to nervous when flashing the router as you always restore it again.// |
| * We will | * We will | ||
| * SCP the firmware image onto the router | * SCP the firmware image onto the router | ||
| * SSH into the router | * SSH into the router | ||
| - | * write it to the OS1 flash partition. | + | * Write the firmware |
| - | * Copy the firmware file to the router. Please change the name of the firmware file to match yours. | + | * Copy the firmware file to the router. |
| + | |||
| + | |||
| + | <wrap em> | ||
| <code bash> | <code bash> | ||
| scp -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc -o UserKnownHostsFile=/ | scp -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc -o UserKnownHostsFile=/ | ||
| </ | </ | ||
| * SSH into the device | * SSH into the device | ||
| + | |||
| + | <wrap em>**!! Here also change the name of the firmware file to match yours !!**</ | ||
| + | |||
| <code bash> | <code bash> | ||
| - | system@one: | + | ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc -o UserKnownHostsFile=/ |
| BusyBox v1.19.4 (2019-06-28 10:13:42 UTC) built-in shell (ash) | BusyBox v1.19.4 (2019-06-28 10:13:42 UTC) built-in shell (ash) | ||
| Line 152: | Line 158: | ||
| * Now you can try out your new firmware. | * Now you can try out your new firmware. | ||
| * If things however did now work according to plan the next section is for you. | * If things however did now work according to plan the next section is for you. | ||
| + | |||
| + | ===== De-Bricking The Xiaomi Router ===== | ||
| + | * There is an awesome write-up with some YouTube videos on how to de-brick and restore the router' | ||
| + | * https:// | ||
| + | * One point if interest is if you run a Linux environment you can simply install **Wine** and run the **pxesrv.exe** program as root. | ||
| + | <code bash> | ||
| + | sudo wine pxesrv.exe | ||
| + | </ | ||
| + | |||