約6KBのファイル re02.exe が与えられた。
exeにしては小さいと思い、file コマンドを用いると、以下の結果が得られた。
A file re02.exe, which is about 6KB, was given.
Thinking that this is too small for exe file, I used the file command, obtaining this result:
その結果、.Netが用いられているようなので、
すると、re02 / re02.exe / - / SymmetricEncryptorに、以下のMain関数およびEncryptString関数などがあった。
It revealed that .Net is used, so I decompiled the file using
As a result, I found these Main function and EncryptString function in re02 / re02.exe / - / SymmetricEncryptor:
EncryptString関数で用いられている配列 array の内容を05123d2c7d22f75a9b95678edbc705e7 となった。
I converted the array array, which is used in the function EncryptString, to hexadecimal using this Recipe on 05123d2c7d22f75a9b95678edbc705e7.
From Decimal, To Hex - CyberChef
EncryptString関数のコードから、AESで暗号化していそうなこと、
aes.CreateEncryptorの引数の鍵とIV両方に array を指定していることは読み取れたが、
AESの暗号利用モードはわからなかった。
とりあえずCyberChefのデフォルトのCBCモードでMain関数で出力している内容の復号を試みると、
復号に成功し、flagが得られた。
I found that AES is used for encryption, and that array is used for both of the key and IV for the function
aes.CreateEncryptor.
However, I coundn't found which mode of operation is used for AES.
I tried to decrypt using the CBC mode, which is default on CyberChef, what is printed in the Main function.
It succeeded and I obtained the flag.
From Base64, AES Decrypt - CyberChef