figured out token works, next up firstnouse

This commit is contained in:
Shihaam Abdul Rahman 2023-05-22 18:03:24 +05:00
parent c43fa8968e
commit 09f05b2874
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

19
routerapi.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
token=$(curl -c .cookie $ROUTER_ADDRESS/api/webserver/token -s | xmlstarlet sel -t -v "/response/token")
echo $token
token_start=$(echo "${token::${#token}-32}")
token_end=$(echo ${token:32})
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 "<?xml version="1.0" encoding="UTF-8"?><request><username>admin</username><firstnonce>58eb18b0cf49b69cb2b5b6204d32394a464ca082c0cb5a80b51811883cf4f076</firstnonce><mode>1</mode></request>" \