当前位置:网站首页>【软件逆向-自动化】逆向工具大全
【软件逆向-自动化】逆向工具大全
2022-07-06 16:50:00 【黑色地带(崛起)】
目录
一、逆向工具大全
二、IDAPython
2.1、简介:
IDAPython集成了Python解释器,提供了Python功能,使用这个插件还可以编写实现IDC脚本语言的所有Python脚本
优势:拥有Python强大的数据处理能力及所有的Python模块,具有IDA SDK的大部分功能,与IDC相比,使用它可以编写功能更加强大的脚本
IDAPython由三个独立模块组成:
idc,它是封装IDA的IDC函数的兼容性模块
idautils,这是IDA里的一个高级实用功能模块
idaapi,它允许访问更加底层的数据
2.2、使用:
默认安装的IDA中已经内置了IDAPython插件,因此我们只需要通过菜单栏选择File→Script file,然后选择要执行的Python脚本即可运行
能调用到的接口位于idaapi、idautils和idc三个模块中
三、PythonGdb
3.1、简介:
Gdb本来就支持自定义脚本辅助调试,但因为自定义脚本的语法比较老,借助Python,可以把数据变得更好看,可以将重复的工作变成一个命令,可以更快的调试bug
3.2、使用:
断点功能
class OnBreakpoint(gdb.Breakpoint):
def __init__(self, loc, callback):
if isinstance(loc, int):
loc = '*'+hex(loc)
super(OnBreakpoint, self).__init__(loc, gdb.BP_BREAKPOINT, internal=False)
self.callback = callback
def stop(self):
self.callback()
return False寄存器和内存操作
def get_reg(reg):
return int(gdb.parse_and_eval("$"+reg))
def set_reg(reg, value):
return gdb.execute("set $"+reg+" "+str(value))
def read_mem(address, length):
inferior = gdb.selected_inferior()
return inferior.read_memory(address, length)
def write_mem(address, value):
inferior = gdb.selected_inferior()
return inferior.write_memory(address, value)文档:
PythonGdbTutorial - GDB Wiki (sourceware.org)
https://sourceware.org/gdb/wiki/PythonGdbTutorial
四、pydbg
4.1、简介:
基于Python实现的一个Windows调试器框架,可以实现对Windows下程序的自动化调试。
使用PyDbg只需要构建一个用户模式的回调函数,当收到一个调试事件的时候,回调函数执行我们定义的操作。操作完成后,再将权限交还给调试器,回复被调试的进程
4.2、使用:
一个pydbg的模板如下,通过bp_set可以在程序的任意点设置断点,并添加对应的处理函数
from pydbg import *
from pydbg.defines import *
def handler1(dbg):
# some code here
return DBG_CONTINUE
def main():
target = './reverse0.exe'
dbg = pydbg()
dbg.load(target, create_new_console=True)
#set a break point
dbg.bp_set(0x00415fad, handler=handler1)
dbg.run()
main()
五、Angr
5.1、简介:
是一个多架构的二进制分析平台,具备对二进制文件的动态符号执行能力和多种静态分析能力
文档
5.2、使用:
Angr脚本步骤:
(1)使用angr.Project加载要分析的二进制程序
通常会将选项auto_load_libs设置为false,使angr不加载动态链接库:
p = angr.Project('./vul', load_options={"auto_load_libs": False})(2)建立程序的一个初始化状态
使用factory.entry_state直接在程序入口点建立一个初始化状态
如果程序需要传递符号化的输入,还需要在建立初始化状态时,进行符号化:
argv1 = claripy.BVS("argv1", 100 * 8)
initial_state = p.factory.entry_state(args=["./program", argv1])也可使用factory.black_state在程序的任意指定地址建立一个状态。可以通过memory.store对状态中的部分内存进行符号化:
s = p.factory.blank_state(addr=0x401084)
s.memory.store(0x402159, s.solver.BVS("ans", 8*40))(3)从初始化状态开始进行动态符号执行,使用explore进行路径的探索,通过find参数指定需要到达的地址,avoid参数则指定不要到达的地址:
sm = proj.factory.simulation_manager(initial_state)
sm.explore(find=0x400830, avoid=0x400850)(4)找到之后,通过约束求解器得到flag:
found = sm.found[0]
flag = found.solver.eval(argv1, cast_to=bytes)
边栏推荐
- Mujoco second order simple pendulum modeling and control
- DAY THREE
- Encryption algorithm - password security
- ldap创建公司组织、人员
- Interface master v3.9, API low code development tool, build your interface service platform immediately
- Why should a complete knapsack be traversed in sequence? Briefly explain
- DAY ONE
- What can the interactive slide screen demonstration bring to the enterprise exhibition hall
- Data analysis course notes (III) array shape and calculation, numpy storage / reading data, indexing, slicing and splicing
- SQL的一种写法,匹配就更新,否则就是插入
猜你喜欢
2022/2/11 summary
Imeta | Chen Chengjie / Xia Rui of South China Agricultural University released a simple method of constructing Circos map by tbtools
Devops can help reduce technology debt in ten ways
Are you ready to automate continuous deployment in ci/cd?
37頁數字鄉村振興智慧農業整體規劃建設方案
Designed for decision tree, the National University of Singapore and Tsinghua University jointly proposed a fast and safe federal learning system
沉浸式投影在线下展示中的三大应用特点
[2022 the finest in the whole network] how to test the interface test generally? Process and steps of interface test
Win10 startup error, press F9 to enter how to repair?
DAY FIVE
随机推荐
Interface master v3.9, API low code development tool, build your interface service platform immediately
How to use vector_ How to use vector pointer
DAY TWO
《LaTex》LaTex数学公式简介「建议收藏」
Value Function Approximation
pytest多进程/多线程执行测试用例
Racher integrates LDAP to realize unified account login
AI超清修复出黄家驹眼里的光、LeCun大佬《深度学习》课程生还报告、绝美画作只需一行代码、AI最新论文 | ShowMeAI资讯日报 #07.06
Mujoco produces analog video
Everyone is always talking about EQ, so what is EQ?
How engineers treat open source -- the heartfelt words of an old engineer
PostgreSQL highly available repmgr (1 master 2 slave +1witness) + pgpool II realizes master-slave switching + read-write separation
准备好在CI/CD中自动化持续部署了吗?
Introduction to GPIO
Model-Free Control
Geo data mining (III) enrichment analysis of go and KEGG using David database
JWT signature does not match locally computed signature. JWT validity cannot be asserted and should
从外企离开,我才知道什么叫尊重跟合规…
2022 PMP project management examination agile knowledge points (9)
沉浸式投影在线下展示中的三大应用特点