Last active
December 30, 2021 02:09
-
-
Save mananpal1997/cf7faf01b641f5e6f86b02cccad91343 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
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good