Skip to content

Instantly share code, notes, and snippets.

@mananpal1997
Last active December 30, 2021 02:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mananpal1997/cf7faf01b641f5e6f86b02cccad91343 to your computer and use it in GitHub Desktop.
Save mananpal1997/cf7faf01b641f5e6f86b02cccad91343 to your computer and use it in GitHub Desktop.
import requests
import httplib
import urllib
httplib._MAXHEADERS = 1000 # Need this becase max headers count is greater than 100(default _MAXHEADERS), and will throw an exception
res = requests.get("http://defcon.org.in:6060/index.php")
headers = res.headers
cookie_data = headers["Set-Cookie"]
cookie_data = cookie_data.split("path=/")
# Only interested in encoded values for each cookie id
for i in range(len(cookie_data)): cookie_data[i] = cookie_data[i][cookie_data[i].find("=")+1 : cookie_data[i].find(";")]
encoded_data = "".join(cookie_data)
decoded_data = urllib.unquote(encoded_data)
print(decoded_data)
@akhilmadhu005
Copy link

good

@evencommit
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment