aboutsummaryrefslogtreecommitdiffstats
path: root/OLD/csci5271/ho2/crack2.py
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-05-24 11:18:46 -0500
committerMatt Strapp <matt@mattstrapp.net>2022-05-24 11:19:55 -0500
commit7a73162607544204032aa66cce755daf21edebda (patch)
tree58578e01f15f34a855d99c32898db9d7a1603e67 /OLD/csci5271/ho2/crack2.py
parentdo some stuff (diff)
downloadhomework-7a73162607544204032aa66cce755daf21edebda.tar
homework-7a73162607544204032aa66cce755daf21edebda.tar.gz
homework-7a73162607544204032aa66cce755daf21edebda.tar.bz2
homework-7a73162607544204032aa66cce755daf21edebda.tar.lz
homework-7a73162607544204032aa66cce755daf21edebda.tar.xz
homework-7a73162607544204032aa66cce755daf21edebda.tar.zst
homework-7a73162607544204032aa66cce755daf21edebda.zip
Graduate
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'OLD/csci5271/ho2/crack2.py')
-rw-r--r--OLD/csci5271/ho2/crack2.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/OLD/csci5271/ho2/crack2.py b/OLD/csci5271/ho2/crack2.py
deleted file mode 100644
index b24f90e..0000000
--- a/OLD/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