【NSSCTF刷题】《ezbroke》

CTF

Posted by Corax on December 24, 2023

ezbroke

image-20231225223655382

解法

下载下来 一个exe,点开看看

image-20231225223723880

无法运行,exeinfo看看

长这样,可能损坏了,winhex看看

image-20231225223737725

发现dos头和pe的文件偏移都有问题,修改。

image-20231225224125854

发现可以正常打开了

image-20231225224134863

但是发现仍然有upx壳

image-20231225224151831

脱壳,发现失败了

image-20231225224227431

继续winhex看看,发现都修改了

image-20231225224256155

修改后

image-20231225224322610

再去脱壳,成功

image-20231225224349960

打开ida32,发现好像是个VM题奥

image-20231225224636586

不过还是比较友好,直接给了我有啥操作

image-20231225224658558

一个一个看过之后,应该就是这了,异或0x17

image-20231225224718995

然后进check比较

image-20231225224736726

所以逆向思路就是,把encflag先dump出来,然后再异或回去

Enc = [
  0x51, 0x44, 0x54, 0x43, 0x51, 0x6C, 0x4E, 0x27, 0x62, 0x37, 
  0x64, 0x62, 0x74, 0x74, 0x72, 0x64, 0x64, 0x71, 0x62, 0x26, 
  0x26, 0x6E, 0x37, 0x75, 0x65, 0x27, 0x7C, 0x24, 0x37, 0x7A, 
  0x6E, 0x37, 0x67, 0x65, 0x27, 0x63, 0x24, 0x74, 0x63, 0x26, 
  0x27, 0x79, 0x36, 0x36, 0x36, 0x6A, 0x00
]
cFlag = ""

for i in range(len(Enc)):
    cFlag += chr(Enc[i] ^ 0x17)

print(cFlag)

image-20231225225014018

出了

image-20231225225031473