Created
April 28, 2017 16:00
-
-
Save sferrini/9e4f815521323174f4ee8efa7b12226d to your computer and use it in GitHub Desktop.
GynvaelEN - Hacking Livestream - Mission 001
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 | |
# Simone Ferrini | |
import hashlib | |
import sys | |
word_list = [ | |
# ... | |
"ambrosia", | |
# ... | |
"virology", | |
# ... | |
] | |
word_list_len = len(word_list) | |
flag_hash = "76fb930fd0dbc6cba6cf5bd85005a92a" | |
for idx, w1 in enumerate(word_list): | |
for w2 in word_list: | |
md5_w1 = hashlib.md5(w1).hexdigest().decode("hex") | |
md5_w2 = hashlib.md5(w2).hexdigest().decode("hex") | |
xored_md5 = '' | |
for i in xrange(16): | |
xored_md5 += "%02x" % int(int(md5_w1[i].encode("hex"), 16) ^ int(md5_w2[i].encode("hex"), 16)) | |
if xored_md5 in flag_hash: | |
print "w1: " + w1 | |
print "w2: " + w2 | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment