curl "http://192.168.0.1/goform/login" -H "Connection: keep-alive" -H "Cache-Control: max-age=0" -H "Origin: http://192.168.0.1" -H "Upgrade-Insecure-Requests: 1" -H "DNT: 1" -H "Content-Type: application/x-www-form-urlencoded" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "Referer: http://192.168.0.1/login.asp" -H "Accept-Language: en-US,en;q=0.9" -H "Cookie: alertWindowStatus=donotshow" --data-raw "loginChallenge=censored just in case&loginUsername=censored&loginPassword=censored" --insecure --location
This is the code for curl that google gave me using networking monitoring when I logged in to my router. I would want curl to login to my router and change a few settings (cmd curl) in a batch file. However, even when I use what chrome gave me when I logged in, I still end up at the login screen. Why does it not curl back the home screen for my router instead of the login screen? I got this method from: https://superuser.com/questions/1423850/how-can-i-use-curl-to-login-into-non-digest-login-sites