Skip to content

Instantly share code, notes, and snippets.

@lgzarturo
Last active March 2, 2022 15:19
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 lgzarturo/ea72eb8bd3670efac28fe06b128fdfef to your computer and use it in GitHub Desktop.
Save lgzarturo/ea72eb8bd3670efac28fe06b128fdfef to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#_*_ coding:utf-8 _*_
import requests
import argparse
parser = argparse.ArgumentParser(description='Data:')
parser.add_argument('-u', '--url', help='url', required=True)
parser = parser.parse_args()
dict_headers = {}
def main():
if parser.url:
url = parser.url
try:
headers = requests.get(url).headers
dict_headers = dict(headers)
for key in headers:
print(key + ': ' + headers[key])
except Exception as e:
print(e)
if __name__ == '__main__':
try:
main()
print("*" * 50)
print(dict_headers)
except KeyBoardInterrupt:
print("\n[-] User aborted the scan")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment