The Asus router reboot script

On old router firmware Asus often noticed that the web interface is not fully open, not all the menus are displayed, so it can not be configured accordingly and can not be restarted if remote access is also available, since the reset button is not displayed.
So he took the Asus RT-N12E router, ran the Wireshark sniffer, opened the web interface of the router and pressed the reboot button.
In the intercepted packets, you could see that the Reboot.asp file is being rebooted in the root directory.

This resulted in a script for rebooting Asus routers:

#!/bin/sh
ROUTER_IP="192.168.1.1"
USERNAME="admin"
PASSWORD="admin"

# exit if router is down
ping -q -c 1 "$ROUTER_IP" > /dev/null || exit

curl --basic --user "$USERNAME:$PASSWORD" -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" --refer "http://$ROUTER_IP" "$ROUTER_IP/Reboot.asp"

The contents of the script will be placed in a new file, for example, using the nano editor (“CTRL+X” to exit and “y” to save the changes):

nano file.sh

Let’s make it executable:

chmod 777 file.sh

After this, we execute:

./file.sh

You can also manually open the link http://192.168.1.1/Reboot.asp in the browser if you need to reboot the router once.

Leave a comment

Leave a Reply