Xiaomi AX9000 Router SSH & ShellClash

Unlocking the Potential: A Guide to Rooting Your Xiaomi Mi Router AX9000

Welcome, tech enthusiasts! Today, we are going to dive into an exciting world of networking, where we will learn how to root a Xiaomi AX9000 Router. Rooting your router is a process that grants you full control over your device, allowing you to modify its software to suit your needs better. However, this process involves a certain level of risk and requires careful attention to details. So, let’s get started!

Disclaimer:
This guide is intended for educational purposes only. Proceed at your own risk. The author is not responsible for any damages that may occur during or after the process.

First things first, downgrade the firmware of your Xiaomi AX9000 router to an earlier version, I used version 1.0.82 (included in the download package I provided). Log in to the management page of your router, click “Manual Upgrade” on the “Common Settings”-“System Status” page to upload the firmware file to flash, and make sure the “Clear Settings” option is checked before flashing.

Step-by-Step Procedure

  1. Preparation: Start by downloading the required file from this link. Then, connect your PC to the router using an ethernet cable plugged into one of the LAN ports.
  2. Back it up: If you have any important configurations set on your router, make sure to back them up because the process may requires a factory reset to activate telnet, which wipes out all existing settings.
  3. Accessing the admin panel: Open your web browser and go to the admin panel by either entering miwifi.com or the local IP address 192.168.31.1.
  4. Deploying the exploit: Open the create_exploit.js file you downloaded earlier, copy its content, and paste it into the console of your browser (you can open the console by pressing F12 and selecting ‘Console’) then hit Enter.
  5. Wait for the magic: A window should appear where you can change the bdata region or leave it as is, it is recommed that you just click ok to accept the default value. Wait for about 10-20 seconds for the patch file to be generated. It should download automatically.
  6. Unpack the downloaded file: After downloading, unpack the contents of the file. You should find three files: 1.bin, 2.bin, and 3.bin.
  7. Upload the files: Go back to your router’s admin panel and upload these files in the same order to the section where you manually update /upload firmware. After each upload, the router should restart.
  8. Find out your password for telnet: Run the calc_passwd.js script in the browser console to get your password for telnet.
  9. Connect via telnet: Try to connect via telnet using the IP address 192.168.31.1 and port 21. If it says the password is wrong, you may need to do the factory reset step until it works.
  10. Factory reset: Perform a factory reset through the router’s webgui at the same page as you update the firmware, if needed.
  11. Enable SSH service: Finally, connect via telnet use the root user and the password you get at the above step and turn on the ssh service by running the following commands:
  12. sed -i 's/channel=.*/channel=\"debug\"/g' /etc/init.d/dropbear
    /etc/init.d/dropbear start
    

And there you have it! You have successfully rooted your Xiaomi AX9000 Router. Now you can connect to your AX9000 by use this command: ssh [email protected], when promted for password, enter the root password you obtain at the above step. If you want to change your root password, use the ‘passwd’ and type a new password twice or run this command directly: echo -e ‘NewPassword\nNewPassword’ | passwd root

Installing ShellClash on Your Rooted Xiaomi AX9000 Router

Adding to our guide on rooting the Xiaomi AX9000 Router, let’s explore the steps on how to install and use the ShellClash program on a Xiaomi router that has already been granted root access or on other routers running the OpenWrt system.

  1. SSH Connection: Connect to your Xiaomi AX9000 using SSH to execute the installation (Note: Do not use telnet for installing ShellClash, as it may cause garbled text). Run the following command:
  2. export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
    
  3. Using the clash command: Once the installation is complete, you can use the ‘clash’ command. Type ‘clash’ to enter the configuration. First, select option 1 for various types of router devices to set up LAN transparent proxy.
  4. Importing Configuration File: Select option 1 to import the configuration file. If you do not have a Clash configuration file but have a subscription link for v2ray, ss, or trojan, you can select option 1 again to “generate a Clash configuration file online.” If you have a clash configuration link, you can select option 2 to directly import the configuration file.
  5. Setting Up Clash to Run on Startup: After generating the configuration file, press 0 to return to the upper menu. You can then press 4 to set Clash to start upon boot.

At this point, you should be able to access the internet freely (often referred to as “Science Internet” in Chinese context, meaning bypassing network restrictions). Enjoy your enhanced networking experience!

Congratulations on making it to the end of this guide! Rooting your router opens up a world of possibilities for customization and control over your home network. However, with great power comes great responsibility, so always be mindful of the risks involved. Stay curious, stay informed, and most importantly, enjoy your newly rooted Xiaomi AX9000 Router!

Security Liability Warning:

Rooting a device is not without its risks. While it provides more control and functionality, it also exposes your router to potential security risk and even bricking your device is a possible outcome if the process is not done correctly, or if the device is not maintained properly after rooting. Always ensure to take necessary precautions when performing such tasks, including backing up your firmware and configuration, and following instructions carefully. If you’re not comfortable with these risks, it may be best to avoid rooting your router or seek help from a professional. Remember, safety first!

Note:
As a safety precaution, I’ve included a copy of MIWIFIRepairTool in the download above, which is Xiaomi’s official router repair flashing tool. In case your router enters an abnormal state, you can use this tool and the official Xiaomi AX9000 firmware included in the download package to repair your router.

Is there another topic you’d like to see covered on our blog? Leave us a comment, and we’ll do our best to create a guide for it. Until then, happy networking!

Leave a Reply

Your email address will not be published. Required fields are marked *