Skip to content

Instantly share code, notes, and snippets.

@budanthara
Created November 21, 2015 06:05
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 budanthara/b94ba5560f604f42c1d6 to your computer and use it in GitHub Desktop.
Save budanthara/b94ba5560f604f42c1d6 to your computer and use it in GitHub Desktop.
"""
HackDatKiwi CTF 2015 - Phone Lock 1
"""
import hashlib
import random
salt = "abb6f243fb340025d312c2a41cfa8beb"
valid = "00a1e1072212ceae0445dcffde045da4"
def load_number():
result = ""
for i in range(0, 4):
result += str(random.randrange(0,10))
return result
def main():
stat = True
valid_bro = ""
while stat:
v = load_number()
to_md5 = hashlib.md5((salt + v)).hexdigest()
print "%s ( %s ) -> %s" % (to_md5, v, valid)
if to_md5 == valid:
valid_bro = v
stat = False
else:
continue
print "Password matches: %s" % (valid_bro)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment