diff options
author | Matt Strapp <matt@mattstrapp.net> | 2022-01-11 10:18:56 -0600 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2022-01-11 10:18:56 -0600 |
commit | 6c9b79537f03115c5e2d4883fd407a6ac870bffd (patch) | |
tree | a26cecd37bb254795e8a847ca7235d5e7236ff54 /csci5271/ho2/crack2.py | |
parent | finish 3606 (diff) | |
download | homework-6c9b79537f03115c5e2d4883fd407a6ac870bffd.tar homework-6c9b79537f03115c5e2d4883fd407a6ac870bffd.tar.gz homework-6c9b79537f03115c5e2d4883fd407a6ac870bffd.tar.bz2 homework-6c9b79537f03115c5e2d4883fd407a6ac870bffd.tar.lz homework-6c9b79537f03115c5e2d4883fd407a6ac870bffd.tar.xz homework-6c9b79537f03115c5e2d4883fd407a6ac870bffd.tar.zst homework-6c9b79537f03115c5e2d4883fd407a6ac870bffd.zip |
Resume and rearrange
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'csci5271/ho2/crack2.py')
-rw-r--r-- | csci5271/ho2/crack2.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/csci5271/ho2/crack2.py b/csci5271/ho2/crack2.py deleted file mode 100644 index b24f90e..0000000 --- a/csci5271/ho2/crack2.py +++ /dev/null @@ -1,23 +0,0 @@ -# HTTP Digest Authentication cracker -import hashlib - -username = "travis14" -realm = "Cheese" -nonce = "/DPYEFbSBQA=c06893026441a70acf049b49540e97acd2bdd640" -uri = "/secret/cheese" -qop = "auth" -nc = "00000001" -cnonce = "ZjdlNTk0ZGZmMDQwZTU3OTM2MTIxOGEyNzljNDJlYzc=" -response = "872aafc461761e417d2df47b85e43d2b" - -# Calculate the response -with open("10k-most-common.txt") as f: - for line in f: - line = line.strip('\n').strip() - ha1 = hashlib.md5((username + ":" + realm + ":" + line).encode('utf-8')).hexdigest() - ha2 = hashlib.md5(("HEAD" + ":" + uri).encode('utf-8')).hexdigest() - response = hashlib.md5((ha1 + ":" + nonce + ":" + nc + ":" + cnonce + ":" + qop + ":" + ha2).encode('utf-8')).hexdigest() - # print(line + ":" + response) - if (response == "872aafc461761e417d2df47b85e43d2b"): - print("Password: " + line) - break |