当前位置:网站首页>【软件逆向-自动化】逆向工具大全
【软件逆向-自动化】逆向工具大全
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)
边栏推荐
- Model-Free Prediction
- [CVPR 2022] semi supervised object detection: dense learning based semi supervised object detection
- Three application characteristics of immersive projection in offline display
- 智能运维应用之道,告别企业数字化转型危机
- 陀螺仪的工作原理
- Lombok 同时使⽤ @Data 和 @Builder 的坑,你中招没?
- DAY TWO
- C language input / output stream and file operation [II]
- MySQL learning notes (mind map)
- VTK volume rendering program design of 3D scanned volume data
猜你喜欢
随机推荐
什么是响应式对象?响应式对象的创建过程?
How to set encoding in idea
48页数字政府智慧政务一网通办解决方案
Liuyongxin report | microbiome data analysis and science communication (7:30 p.m.)
What can the interactive slide screen demonstration bring to the enterprise exhibition hall
PostgreSQL highly available repmgr (1 master 2 slave +1witness) + pgpool II realizes master-slave switching + read-write separation
web渗透测试是什么_渗透实战
[vector retrieval research series] product introduction
Basic information of mujoco
Understand the misunderstanding of programmers: Chinese programmers in the eyes of Western programmers
Geo data mining (III) enrichment analysis of go and KEGG using David database
Introduction au GPIO
File and image comparison tool kaleidoscope latest download
DAY FIVE
Are you ready to automate continuous deployment in ci/cd?
沉浸式投影在线下展示中的三大应用特点
Data operation platform - data collection [easy to understand]
Random类的那些事
Three application characteristics of immersive projection in offline display
1000字精选 —— 接口测试基础
https://pythonarsenal.com/







