Username: 
Password: 
Restrict session to IP 

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

Global Rank: 9946
Totalscore: 266
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 2y 141d
Last Seen: 2y 57d
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: 748527
Posts: 408
Thanks: 457
UpVotes: 405
Registered: 11y 95d












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: 9946
Totalscore: 266
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 2y 141d
Last Seen: 2y 57d
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: 748527
Posts: 408
Thanks: 457
UpVotes: 405
Registered: 11y 95d












The User is Offline
RE: My python script cannot send cookie?
Google/translate1Thank You!0Good Post!0Bad Post! link
Correct.
Global Rank: 233
Totalscore: 85396
Posts: 1390
Thanks: 1222
UpVotes: 739
Registered: 12y 257d




Last Seen: 18h 12m
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, n0tHappy, TheHiveMind, Z, 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 1670 times.