type
status
date
slug
summary
tags
category
icon
password
这道题是最经典的天堂之门
简单查一下壳

32位程序

里面应该是有花指令的,导致无法进行反编译,但是找了一圈没有找到花指令,那么我们直接动调吧。

这个函数应该是scanf函数
然后我们在scanf函数后面下一个硬件断点

然后F9
然后我们发现断在的第一处是对输入的字符串进行了处理


接下来就是调试我们的天堂之门,我们发现有多处使用天堂之门
我们在天堂之门函数里面下个条件断点

然后我们发现还有两个地方调用了天堂之门
0x4011d0,0x401290
这些地方都是64位的,32位IDA识别不了
这个时候我们把这个32位的exe丢进010中

我们改变它的magic_number,10B为32位,20B为64位
然后放在64位IDA里面进行分析,我们一定要设置好它的基址

我们跳到0x4011d0这个地址

这里是一个反调试手段:BeingDebugged反调试技巧。gs:60h 获得 PEB 结构(进程环境块):

调试状态和非调试状态的加密是不一样的

以八个字符为一组,然后进行左移操作
之后我们跳转另一处地址0x401290

这里对接下来参与加密异或的密钥进行了初始化。这部分执行完后,我发现程序仍然没法调试,说明仍处于 64 位的工作模式,再加上一开始审视主函数代码时发现,这里跳转回去后后几行出现无法被正常解析的数据,猜测这里仍处于 64 位模式工作,我们用 64 位 ida 静态分析其代码:

由此我们分析出程序的加密逻辑:
由此我们写出解题脚本:
有关复现上的问题,欢迎您在底部评论区留言,一起交流~
- Author:5m10v3
- URL:https://5m10v3.top/article/d99ee465-7456-4986-94c3-6385de998807
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts