acecilia / OpenWRTInvasion

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't connect to router with telnet or ssh or else, error is 'connection refused', for xiaomi 4c.

TowerLeon opened this issue · comments

======2021.07.26===========
In fact, I kind of solve this issue spending a whole day, I will make a detailed description on how to get rid of this error, my router version:
image

======2021.07.28===========
At first, I used the latest version v0.0.6, the IP addr is find, the stok is fine, then I encountered a probelm: I can't connect to router
via SSH/telnet, although the script said 'done'. I reviewed some guys comments from youtube channel, they also some similar problems like me, so I decide to use a ealier version, e.g. v0.0.2, which turns out a working choice.

In v0.0.2, I encountered some python lib error while installing pycrypto. Becasue pycrypto is using c++ lib and I'm using a win10 desktop(I have virtualbox which support VM centOS and Ubuntu), I downloaded latest microsoft official visuial studio
c++ lib. Then the v0.0.2 throws an error saying 'gbk' .. 'utf-8' .. blah blah, I know this open occurs when opening a file using the wrong encoding method, so in v0.0.2, the author doesn't specify 'encoding=utf8' while opening files, then I added in the 'remote_command_execution_vulnerability.py' file, then I made it, connected to 192.168.31.1 miwifi console successfully!

After checking firmwares compatible with xiaomi 4c, I download and run the version below.

curl https://downloads.openwrt.org/snapshots/targets/ramips/mt76x8/openwrt-ramips-mt76x8-xiaomi_mi-router-4c-initramfs-kernel.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

which proves it's not a good version, because I need to install luci if I want to access 192.168.1.1 web page according to this video https://www.youtube.com/watch?v=1IgwDwoa9yY, seriously the below one should be the one I want:

http://downloads.openwrt.org/releases/21.02.0-rc2/targets/ramips/mt76x8/openwrt-21.02.0-rc2-ramips-mt76x8-xiaomi_mi-router-4c-squashfs-sysupgrade.bin

Finally, after I connect to 192.168.1.1 via SSH: I got
image
but I can't access 192.168.1.1 web page, so as I said I installed opkg update && opkg install luci via command line, then everything is good, the openwrt web console is there for me.
image

Share this experience to all guys who owned a xiaomi wifi 4c.

the author could close this issue or share it the readme document for xiaomi wifi 4c.

Thanks for the detailed description! 🚀 I will update the url of the openwrt image when the stable final version of 21.02 is released. I updated the README linking to this issue