curl-auth-csrf icon indicating copy to clipboard operation
curl-auth-csrf copied to clipboard

Using on windows

Open benohara opened this issue 6 years ago • 3 comments

If I echo a password to this script on windows it doesnt appear to work, it does if it ignored and the password is prompted for...

strangely, i looks as if when echoing the password the initial auth passes and then when it calls the post auth url it gets back a permission denied.

DEBUG:urllib3.connectionpool:https://monitor.example.com:443 "POST /authentication/login HTTP/1.1" 200 None INFO:root:Request result = 200 INFO:root:Result URL after login = https://monitor.example.com/authentication/login INFO:root:Login was successful

Looks like we passed auth...

INFO:root:Making requests of interest ...

Requests the post auth url...

INFO:root:Performing GET on https://monitor.example.com/reporting/report/show?report=Host%20SLA&hostgroup=Customer%20Servers&timeframes=one_week&download=1 ...

DEBUG:urllib3.connectionpool:https://monitor.example.com:443 "GET /reporting/report/show?report=Host%20SLA&hostgroup=Customer%20Servers&timeframes=one_week&download=1 HTTP/1.1" 302 None

DEBUG:urllib3.connectionpool:https://monitor.example.com:443 "GET /authentication/login?redirect=reporting%2Freport%2Fshow%3Freport%3DHost%2520SLA%26hostgroup%3DCustomer%2520Servers%26timeframes%3Done_week%26download%3D1 HTTP/1.1" 200 None INFO:root:Request result = 200

Got back permission denied and redirected to the login page.

This works fine when run on linux (or when the password is prompted for on windows)

benohara avatar May 20 '19 09:05 benohara

I'm not seeing enough detail that would allow me to attempt to reproduce. How exactly are you echo'ing in Windows? What shell are you using? Any chance the method you're using is including unwanted or escaped characters?

JElchison avatar May 20 '19 20:05 JElchison

No worries, yeah, there nothing strange in the password.

Strangely, I seem to get back 200 from /authentication/login with the wrong password so looks like i maybe went down the wrong path.

Anyways, changing the script, so instead of prompting for the password, just setting password = "xyz" and all works fine.

I was doing

echo "password" | script.py options

Which didnt work, however Im not a windows user so probably missing something obvious.

benohara avatar May 20 '19 23:05 benohara

What version of Windows? And what shell?

JElchison avatar May 21 '19 01:05 JElchison