Created
November 2, 2015 17:44
-
-
Save averagesecurityguy/c4060c4763abee94b1b2 to your computer and use it in GitHub Desktop.
Calculate Hashes for HTML Structure
This file contains hidden or 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/env/bin python3 | |
import requests | |
import re | |
import hashlib | |
import sys | |
tag_re = re.compile(r'<.*?>') | |
if len(sys.argv) != 2: | |
print('USAGE: html_structure_hash.py url') | |
sys.exit() | |
resp = requests.get(sys.argv[1]) | |
tags = tag_re.findall(resp.content) | |
html = ''.join(tags) | |
print('MD5: {0}'.format(hashlib.md5(html).hexdigest())) | |
print('SHA1: {0}'.format(hashlib.sha1(html).hexdigest())) | |
print('SHA256: {0}'.format(hashlib.sha256(html).hexdigest())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment