decode (), user_pw ) print ( decryption ) returnĬan you crack the password to get the flag? Download the password checker here and you’ll need the encrypted flag and the hash in the same directory too. your flag, user:" ) decryption = str_xor ( flag_enc. Understanding the code and being able to make it do what you want to do is a critical skillset for harder reverse engineering and pwn categories challenges.ĭef level_4_pw_check (): # user_pw = input("Please enter correct password for flag: ") for user_pw in : user_pw_hash = hash_pw ( user_pw ) if ( user_pw_hash = correct_pw_hash ): print ( "Welcome back. If we change this to ans_num != num, then if we don’t put in the right conversion, we will still get the flag!. Line 11 is a basic check to see if the decimal conversion of our 1 and 0 input matches the randomly generated number. Binary numbers contain only 1 \' s and 0 \' s' ) choice ( range ( 10, 101 )) print ( 'If ' str ( num ) ' is in decimal base, what is it in binary base?' ) ans = input ( 'Answer: ' ) try : ans_num = int ( ans, base = 2 ) if ans_num = num : flag = str_xor ( flag_enc, 'enkidu' ) print ( 'That is correct! Here \' s your flag: ' flag ) else : print ( str ( ans_num ) ' and ' str ( num ) ' are not equal.' ) except ValueError : print ( 'That isn \' t a binary number.
0 Comments
Leave a Reply. |