Created
July 18, 2018 17:54
-
-
Save komang4130/a2df326e214af87eb1c72c81d10ddf90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from requests import * | |
from base64 import * | |
block_size = 16 | |
url = "http://167.99.161.30:8080" | |
def get_cookies(name): | |
data = {"name": name} | |
s = Session() | |
r = s.post(url + "/please-let-me-in" ,data=data) | |
return s.cookies["state"] | |
def get_flag(payload): | |
cookie = {"state":b64encode(payload)} | |
r = get(url,cookies=cookie) | |
return r.text | |
cookie = get_cookies("a"*29) | |
print "Cookie: ",cookie | |
payload = b64decode(cookie)[0:47] + chr( ord(b64decode(cookie)[47]) ^ ord("0") ^ ord("1") ) + b64decode(cookie)[48:] | |
print get_flag(payload) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment