Username: 
Password: 
Restrict session to IP 

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

Global Rank: 8299
Totalscore: 263
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 1y 75d
Last Seen: 356d 18h
The User is Offline
My python script cannot send cookie?
Google/translate0Thank 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: 739582
Posts: 387
Thanks: 415
UpVotes: 359
Registered: 10y 29d












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: 8299
Totalscore: 263
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 1y 75d
Last Seen: 356d 18h
The User is Offline
RE: My python script cannot send cookie?
Google/translate0Thank You!0Good 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: 739582
Posts: 387
Thanks: 415
UpVotes: 359
Registered: 10y 29d












The User is Offline
RE: My python script cannot send cookie?
Google/translate1Thank You!0Good Post!0Bad Post! link
Correct.
Global Rank: 236
Totalscore: 84568
Posts: 1339
Thanks: 1193
UpVotes: 705
Registered: 11y 191d




Last Seen: 14h 26m
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, qdxy, TheHiveMind, Z, Ge0, samuraiblanco, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89 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 1128 times.