JarvisOJ RE Classical CrackMe2 wp

Classical CrackMe2

Really learned a lot .... First look at PEID is written in C #, so decompile with dnspy, found the key categories:

And then go find the key function, that is, if the comparison function:

Text is not equal to a null and text2 xxxx, where breakpoint is found the input text data, an error pop text2 is given inside each string of base64, when the value is equal to the string behind text2 when pop will appear flag. Then take a look at how the formation of text2:

And then found Rijndae1Managed AES encryption process is then converted at base64, key bytes is an array, where the breakpoint is found bytes array 'pctf2016' * 4:

What then could look if statement text2 should be equal to, if at breakpoint at the statement, look at the value of the return of debugging:

Finally, the logic is relatively clear, that is, the user's input to AES base64 encryption and then base64 encoded and then given the title of comparison, the script:


import base64


from Crypto.Cipher import AES


cipher = base64.b64decode("x/nzolo0TTIyrEISd4AP1spCzlhSWJ    XeNbY81SjPgmk=")

key = "pctf2016pctf2016pctf2016pctf2016"

aes = AES.new(key.encode('utf-8'), AES.MODE_ECB)

msg = aes.decrypt(cipher)

print(msg)

Here there have been a small problem, the beginning of the script is written,

aes = AES.new(key, AES.MODE_ECB)

An error has occurred ...... then go to Baidu search to find the cause of the final commissioning find reasons:

key is the beginning of str type, make it into bytes can be AES.new () ..... python came true what is not ....

the above.

 

Published 14 original articles · won praise 2 · Views 335

Guess you like

Origin blog.csdn.net/weixin_43876357/article/details/104079933
WP2