Username: 
Password: 
Restrict session to IP 

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

Global Rank: 11131
Totalscore: 266
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 3y 173d
Last Seen: 3y 90d
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: 763410
Posts: 419
Thanks: 472
UpVotes: 431
Registered: 12y 128d












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: 11131
Totalscore: 266
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 3y 173d
Last Seen: 3y 90d
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: 763410
Posts: 419
Thanks: 472
UpVotes: 431
Registered: 12y 128d












The User is Offline
RE: My python script cannot send cookie?
Google/translate1Thank You!0Good Post!0Bad Post! link
Correct.
Global Rank: 239
Totalscore: 85897
Posts: 1437
Thanks: 1259
UpVotes: 778
Registered: 13y 289d




Last Seen: 1d 10h
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, TheHiveMind, Z, balicocat, Ge0, samuraiblanco, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89, braddie0 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 2403 times.