Username: 
Password: 
Restrict session to IP 

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

Global Rank: 11071
Totalscore: 347
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 6y 174d
Last Seen: 6y 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: 759063
Posts: 437
Thanks: 496
UpVotes: 469
Registered: 15y 128d












The User is Offline
RE: My python script cannot send cookie?
Google/translate1Thank You!2Good 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: 11071
Totalscore: 347
Posts: 2
Thanks: 1
UpVotes: 1
Registered: 6y 174d
Last Seen: 6y 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: 759063
Posts: 437
Thanks: 496
UpVotes: 469
Registered: 15y 128d












The User is Offline
RE: My python script cannot send cookie?
Google/translate1Thank You!0Good Post!0Bad Post! link
Correct.
Global Rank: 227
Totalscore: 94363
Posts: 1680
Thanks: 1358
UpVotes: 920
Registered: 16y 290d




Last Seen: 5d 16h
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, nonfungiblesecurity, quangntenemy, TheHiveMind, Z, balicocat, Ge0, samuraiblanco, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89, braddie0, SwolloW, dangarbri, csuquvq 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 4038 times.