1
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

oh no
  • 118
  • 6
  • That would break the command – oh no Sep 10 '20 at 02:33
  • @shellter, the `batch-file` tags means they are using the Windows cmd.exe shell. – Squashman Sep 10 '20 at 04:54
  • @Squashman : Ah! right! I missed that detail. Happy to say that [^ is the bat file continuation char](https://stackoverflow.com/questions/69068/split-long-commands-in-multiple-lines-through-windows-batch-file). Will glady up-vote a Q I can read ;-) . Good luck to all! – shellter Sep 10 '20 at 13:15

0 Answers0