Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TowerLeon opened this issue Jul 25, 2021 · 2 comments

Comments

@TowerLeon
Copy link

TowerLeon commented Jul 25, 2021

======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:

https://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.

@TowerLeon
Copy link
Author

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

@acecilia
Copy link
Owner

acecilia commented Jul 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants