Last active
March 2, 2022 15:19
-
-
Save lgzarturo/ea72eb8bd3670efac28fe06b128fdfef 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
#!/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