Hi,
do you have experience with talking to managed switches from Zyxel via web ui, with Curl? Mine doesn't have CLI and I'm trying to create script with enable/disable PoE on ports with simple HTTP post. I tried to catch some traffic on Firefox console and finally I got following curl command:
curl 'http://192.168.2.201/port_state_set.cgi' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:65.0) Gecko/20100101 Firefox/65.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: pl,en-US;q=0.7,en;q=0.3' --compressed -H 'Referer: http://192.168.2.201/Port.html' -H 'Content-Type: application/x-www-form-urlencoded' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' --data 'g_port_state=31&g_port_flwcl=0&g_port_poe=15&g_port_speed0=0&g_port_speed1=0&g_port_speed2=0&g_port_speed3=0&g_port_speed4=0'
When I set POST param g_port_poe=XXX to bit combination of ports (i.e. enabling ports 1, 2 and 4 will be 1 + 2 + 8 = 11) it works fine from my computer and curl. However I can't find any credentials in uri, cookie or post data for this request. It always works, even when I log out from browser (maybe some ip cache?). Any idea how this switch authorizes my curl requests?
No comments:
Post a Comment