Created
July 28, 2017 11:29
-
-
Save fabsrc/d6ad8a2b8b90144d8ff78523648eefa0 to your computer and use it in GitHub Desktop.
Restart Technicolor TC7200 router
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 | |
IP="192.168.0.1" | |
USERNAME= | |
PASSWORD="admin" | |
# Create Basic Auth Credentials | |
CREDENTIALS="$(printf "$USERNAME:$PASSWORD" | base64)" | |
# Get CSRF token | |
CSRF=$(curl http://$IP/RgSecurity.asp --header "Authorization: Basic $CREDENTIALS" | grep CSRFValue | sed -e 's/.*value=\(.*\)>/\1/') | |
# Restart Router | |
curl "http://$IP/goform/RgSecurity" \ | |
-H "Content-Type: application/x-www-form-urlencoded" \ | |
-H "Authorization: Basic $CREDENTIALS" \ | |
--data "CSRFValue=$CSRF&HttpUserId=&Password=&PasswordReEnter=&RestoreConfirmPop=0&RestoreFactoryNo=0x00&mCmReset=1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment