aboutsummaryrefslogtreecommitdiffstats
path: root/csci5271/ho2/crack6.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 /csci5271/ho2/crack6.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 'csci5271/ho2/crack6.py')
-rw-r--r--csci5271/ho2/crack6.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/csci5271/ho2/crack6.py b/csci5271/ho2/crack6.py
new file mode 100644
index 0000000..e17aca2
--- /dev/null
+++ b/csci5271/ho2/crack6.py
@@ -0,0 +1,21 @@
+import requests
+from requests.packages.urllib3.exceptions import InsecureRequestWarning
+import string
+
+requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
+
+actual = ""
+for n in range(19, -1, -1):
+ C = "Z" * n
+ res2 = requests.get("https://192.168.14.1/mac-cookie?username="+C,
+ verify=False).text.replace(".", "").split(" ")[-1].split('\n')[0]
+ for c in string.printable:
+ test = C + c + actual
+ res1 = requests.get("https://192.168.14.1/mac-cookie?username="+test,
+ verify=False).text.replace(".", "").split(" ")[-1].split('\n')[0]
+ print(test, res1, C, res2)
+ if res1 == res2:
+ actual = c + actual
+ break
+
+print("Key is", actual)