当前位置:网站首页>【逆向】脱壳后修复IAT并关闭ASLR
【逆向】脱壳后修复IAT并关闭ASLR
2022-07-06 09:33:00 【TiggerRun】
0x1 寻找OEP
OEP八大法…这里不具体展开…

0x2 加壳程序的IAT
脱壳后如遇到程序无法正常运行(XP环境),可能是因为导入表破坏,需要手动修复。
通过PC文件格式的学习,可以知道导入表的RVA在可选头的DataDirectory数组中存放

图为加壳程序DESCRIPTOR的偏移 18008,大小64
根据节区头的信息定位IAT在第6个节区 .aspack 中
通过节区已知的虚拟偏移与物理偏移可以计算出DESCRIPTOR在文件中的位置。
offset = A008

找到导出表的位置,可以知道导入了两个DLL文件,可以分别计算出Name和IAT的偏移
NAME(1) = 9FC8
NAME(2) = A044
IAT(1) = 9FB8
IAT(2) = A04F


当然如果对PC头不了解,可以借助PE View进行查看。

这样就清晰的看到加壳后的程序在启动时导入的函数
0x3 运行时压缩的原理

可能存在疑问,为什么脱壳后需要手动修复IAT。
IAT主要用于DLL文件的重定位,IAT的引入相较于 16位dos程序 不再需要包含库文件,而是通过表的形式进行映射。如果IAT不准确,则程序无法执行相关库的函数。
压缩壳对节区进行了压缩,把IAT修改为壳自身的IAT,在解压缩的最后一步会还原IAT使程序可以正常运行,所以脱壳后需要进行IAT的修复。
通过OD查看运行后程序的IAT。
相较于加壳程序的IAT,运行加壳程序后真正的IAT要多的多,如果我们只进行脱壳,而不进行IAT的修复(如下图所示)
程序的IAT是被损坏的
0x4 IAT修复
使用ImportREC工具,加载处于OEP的程序进程
填写正确的IAT信息
获取到内存中的IAT信息,然后删除无效函数后转存到脱壳后程序中,程序即可正常运行。

0x5 脱壳程序无法在WIN7以上平台运行
windows vista / win7 系统就开始使用ASLR技术防止溢出攻击。使得每次加载程序都加载到一个随机虚拟地址。ASLR依赖于重定位表进行定位,对于EXE程序来说,重定位是可选的,通过关闭ASLR即可解决。
将 40 81 改为 00 81
边栏推荐
- 冯诺依曼体系结构
- Login to verify the simple use of KOA passport Middleware
- Activiti目录(四)查询代办/已办、审核
- Only learning C can live up to expectations Top1 environment configuration
- CentOS7上Redis安装
- 汇编语言基础知识
- Which is more important for programming, practice or theory [there are some things recently, I don't have time to write an article, so I'll post an article on hydrology, and I'll fill in later]
- 手把手带你做强化学习实验--敲级详细
- MySQL日期函数
- DS18B20數字溫度計系統設計
猜你喜欢

一个数10年工作经验的微服务架构老师的简历

Flink源码解读(二):JobGraph源码解读

案例:检查空字段【注解+反射+自定义异常】

Introduction to spring trick of ByteDance: senior students, senior students, senior students, and the author "brocade bag"

Activiti目录(五)驳回、重新发起、取消流程

Activiti directory (III) deployment process and initiation process

MySQL string function

ByteDance overseas technical team won the championship again: HD video coding has won the first place in 17 items

JVM之垃圾回收器上篇

Flink 解析(四):恢复机制
随机推荐
TCP的三次握手和四次挥手
DS18B20数字温度计系统设计
控制转移指令
Interpretation of Flink source code (III): Interpretation of executiongraph source code
Flink 解析(五):State与State Backend
QT system learning series: 1.2 style sheet sub control lookup
Fdog series (I): think about it. It's better to write a chat software. Then start with the imitation QQ registration page.
Flink源码解读(三):ExecutionGraph源码解读
After the subscript is used to assign a value to the string type, the cout output variable is empty.
DOS function call
8086 memory
手把手带你做强化学习实验--敲级详细
Flink 解析(六):Savepoints
Coursera cannot play video
Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.
8086 CPU internal structure
1. JVM入门介绍
ByteDance technical Interviewer: what kind of candidate do I want to pick most
GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
唯有学C不负众望 TOP1环境配置