Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save komang4130/a2df326e214af87eb1c72c81d10ddf90 to your computer and use it in GitHub Desktop.
Save komang4130/a2df326e214af87eb1c72c81d10ddf90 to your computer and use it in GitHub Desktop.
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