Last active
August 29, 2015 14:08
-
-
Save axot/be958d654fd182e77c26 to your computer and use it in GitHub Desktop.
Revisions
-
axot renamed this gist
Nov 3, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
axot created this gist
Nov 3, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ import random import string import md5 flag = md5.new() flag.update("this_is_not_flag!!") flag_md5 = flag.hexdigest() print "flag_md5:", flag_md5 flag_md5 = [flag_md5[i:i+4] for i in range(0, len(flag_md5), 4)] i = 0 res = [] while True: serial = ''.join(random.choice(string.ascii_lowercase + \ string.ascii_uppercase) for _ in range(4)) m = md5.new() m.update(serial) md = m.hexdigest() if i < len(flag_md5) and md[0:4] == flag_md5[i]: res.append(serial) i += 1 if i == len(flag_md5): print "found serial: ",''.join(res) break