Skip to content

Instantly share code, notes, and snippets.

@fabsrc
Created July 28, 2017 11:29
Show Gist options
  • Save fabsrc/d6ad8a2b8b90144d8ff78523648eefa0 to your computer and use it in GitHub Desktop.
Save fabsrc/d6ad8a2b8b90144d8ff78523648eefa0 to your computer and use it in GitHub Desktop.
Restart Technicolor TC7200 router
#! /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