Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sferrini/9e4f815521323174f4ee8efa7b12226d to your computer and use it in GitHub Desktop.
Save sferrini/9e4f815521323174f4ee8efa7b12226d to your computer and use it in GitHub Desktop.
GynvaelEN - Hacking Livestream - Mission 001
#!/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