Last active
November 29, 2020 15:23
-
-
Save sn1p3r46/47edb21a131e24b1e66ad92cb70e0dde to your computer and use it in GitHub Desktop.
This bash script reboots TP-Link routers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This software comes without any kind of warranty or license, use it at your own risk. | |
# | |
# Author: Andrea Galloni | |
# E-mail: andreagalloni92[at]gmail{dot}com | |
# | |
# Works on TP-Link 300M Wireless N ADSL2+ Modem Router TD-W8960N | |
# Firmware Version: 1.3.6 Build 100825 Rel.68770n | |
# | |
# Parameters setup | |
username='username' | |
password='password' | |
uri_containing_sessionKey='192.168.1.1/resetrouter.html' | |
baseURI='192.168.1.1/rebootinfo.cgi?' | |
# takes the sessionKey from the router rebooting web page (192.168.1.1/resetrouter.html) | |
sessionKey=$(curl -ks --user $username:$password $uri_containing_sessionKey | awk '/sessionKey/{ print substr($3,2,20);exit}') | |
echo $sessionKey | |
echo 'REBOOTING' | |
# performs the get request to reboot the router and flush away the output | |
curl -ks --user $username:$password $baseURI$sessionKey > /dev/null | |
echo 'REBOOTED' |
I think so! The device info page reads:
Firmware Version: 1.4.0 Build 110620 Rel.52053n
Hardware Version: TD-W8960N v3 0x00000002
@Prime-Nobel have you tried using @pablen solution?
PLEASE Lemmie know which was the issue if solved! (maybe it was a credential issue?)
p.s.: I don't have this router anymore, thus I can't test. :S
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot for the contribution @pablen! Is the router the same model?