Username: 
Password: 
Restrict session to IP 

My python script cannot send cookie?  Go to the Training: Programming 1 challenge

Global Rank: 11790
Totalscore: 334
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 5y 291d
Last Seen: 5y 208d
The User is Offline
My python script cannot send cookie?
Google/translate1Thank You!0Good Post!0Bad Post! link
First i click the link,page shows the return code. And i get cookie from chrome
I write a python script but cannot get the return code by first request.

GeSHi`ed Plaintext code for requests
1
2
3
headers = {"Cookie":"WC=XXXXXXXXXXXXXX"}
res = requests.get('http://www.wechall.net/challenge/training/programming1/index.php?action=request',
   headers=headers)


but it always return "Please login by sending your cookies in the HTTP Header."

PS: python version 2.7.14
Last edited by T3rry - Jun 13, 2018 - 16:47:53
Global Rank: 1
Totalscore: 760035
Posts: 431
Thanks: 491
UpVotes: 456
Registered: 14y 246d












The User is Offline
RE: My python script cannot send cookie?
Google/translate0Thank You!1Good Post!0Bad Post! link
Works for me. Make sure you are doing this from the same IP as your browser. (And that you copy the cookie correctly.)

B.t.w.: Usually not the best idea to share your own cookie like that. ;)
Global Rank: 11790
Totalscore: 334
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 5y 291d
Last Seen: 5y 208d
The User is Offline
RE: My python script cannot send cookie?
Google/translate0Thank You!1Good Post!0Bad Post! link
Quote from dloser
Jun 13, 2018 - 14:59:04

Works for me. Make sure you are doing this from the same IP as your browser. (And that you copy the cookie correctly.)

B.t.w.: Usually not the best idea to share your own cookie like that. ;)


Thks a lot. I used the proxy.It changed the source ip right?So ip is different between local and browser.
Global Rank: 1
Totalscore: 760035
Posts: 431
Thanks: 491
UpVotes: 456
Registered: 14y 246d












The User is Offline
RE: My python script cannot send cookie?
Google/translate1Thank You!0Good Post!0Bad Post! link
Correct.
Global Rank: 252
Totalscore: 87267
Posts: 1635
Thanks: 1336
UpVotes: 885
Registered: 16y 43d




Last Seen: 10h 25m
The User is Offline
RE: My python script cannot send cookie?
Google/translate0Thank You!0Good Post!0Bad Post! link
I thought of 2 possible errors:

1) http vs https (cookies are treated different between http and https)

2) You used a guest cookie and the challenge wants a real logged in user (doubt that is the problem but can be)

----

I did not reply because i am unsure Smile


EDIT: It seems this challenge needs a member account (no guest allowed) ..... we should fix that?


gizmore
The geeks shall inherit the properties and methods of object earth.
Last edited by gizmore - Jun 14, 2018 - 21:16:24
Redknee, bballMalory, tunelko, silenttrack, n0tHappy, quangntenemy, TheHiveMind, Z, balicocat, Ge0, samuraiblanco, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89, braddie0, SwolloW, dangarbri have subscribed to this thread and receive emails on new posts.
1 people are watching the thread at the moment.
This thread has been viewed 3592 times.