#!/bin/bash home_html=$(curl -s $ROUTER_ADDRESS/html/home.html) csrf_token1=$(echo $home_html | htmlq 'meta[name="csrf_token"]' --attribute content | head -n1) csrf_token2=$(echo $home_html | htmlq 'meta[name="csrf_token"]' --attribute content | tail -n1) token=$(curl -c .cookie $ROUTER_ADDRESS/api/webserver/token -s | xmlstarlet sel -t -v "/response/token") token_start=$(echo "${token::${#token}-32}") token_end=$(echo ${token:32}) echo $token echo $token_start$token_end echo $token_start echo $token_end curl -s -b .cookie "$ROUTER_ADDRESS/api/user/challenge_login" \ -H "Origin: $ROUTER_ADDRESS" \ -H "Referer: $ROUTER_ADDRESS/html/home.html" \ -H "_ResponseSource: Broswer" \ -H "__RequestVerificationToken: $token_end" \ --data-raw "admin58eb18b0cf49b69cb2b5b6204d32394a464ca082c0cb5a80b51811883cf4f0761" \