Created
November 21, 2015 06:05
-
-
Save budanthara/b94ba5560f604f42c1d6 to your computer and use it in GitHub Desktop.
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
""" | |
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