Page cover

CookieAreaSeason1

Note : A JOURNEY TO GAIN KNOWLEDGE

#Bruh AES

Challenge:

import base64
from Crypto.Cipher import AES

#flag = ###FINDME###
algorithm = AES.MODE_CBC
key = 'supersecretkey!?'
iv_part1 = "0xcafedeadbeef"
iv_part2 = ###FINDME###""
iv = iv_part1 + iv_part2
#assert(len(flag)) == 38

def encrypt(payload, key, iv):
    return AES.new(key, algorithm, iv).encrypt(r_pad(payload))

def r_pad(payload, block_size=16):
    length = block_size - (len(payload) % block_size)
    return payload + chr(length) * length

with open('cipher.txt', 'wb') as f:
    f.write(encrypt(flag, key, iv))Lo

Look at this point: iv = iv_part1 + iv_part2 .Hmmm actually iv_part1 = "0xcafedeadbeef" which length is 14 and iv must be 16bytes so that iv_part2 is also 2 bytes we can bruteforce them. Like this

but it's not good, because we got too many answer and the flag .... it does not mean and we can't guess neither

Finally, i got a hint from my brother. It begins by '0x' so maybe it ends by 'x0' ?????? huh?

It's not an interesting chall, but anyway AES.MODE_CBC is fun right ?

#Cry more

Đọc code thấy rõ ta cần có cụm 'product=FLAG' có đủ tiền và đúng signature để có đươc flag. Ở đây ta dùng hash_extender để hỗ trợ thêm cụm '&product=FLAG' vào newstring sau đó thêm cụm '&sign=' cùng với signature mới

Thanks for reading. Have a nice day <3 .

Last updated

Was this helpful?