PEDA用法总结
一个强大的GDB插件
PEDA是为GDB设计的一个强大的插件,全称是Python Exploit Development Assistance for GDB。它提供了很多人性化的功能,比如高亮显示反汇编代码、寄存器、内存信息,提高了debug的效率。同时,PEDA还为GDB添加了一些实用新的命令,比如checksec可以查看程序开启了哪些安全机制等等,后续会介绍。
安装
可以通过pip直接安装,也可以从github上下载安装
$ pip install peda
$ git clone https://github.com/longld/peda.git ~/peda
$ echo "source ~/peda/peda.py" >> ~/.gdbinit
命令
aslr
– 显示/设定GDB的ASLR(地址空间配置随机加载)设置
checksec
– 检查二进制文件的各种安全选项
dumpargs
– 函数将要被调用时,显示将要被传入函数的所有参数(默认会在反汇编代码下方自动显示)dumprop
– 在给定内存范围中Dump出所有ROP gadgets
elfheader
– Get headers information from debugged ELF fileelfsymbol
– 获取non-debugging symbol信息(plt表)
lookup
– Search for all addresses/references to addresses which belong to a memory rangepatch
– Patch memory start at an address with string/hexstring/intpattern
– 生成字符串模板 写入内存 用于定位溢出点pattern create size
生成特定长度字符串pattern offset value
定位字符串
procinfo
– Display various info from /proc/pid/pshow
– Show various PEDA options and other settingspset
– Set various PEDA options and other settingsreadelf
– 获取elf头信息
ropgadget
– Get common ROP gadgets of binary or library
ropsearch
– Search for ROP gadgets in memorysearchmem|find
– 在内存中查找字符串,支持正则表达式
shellcode
– 生成shellcode
skeleton
– Generate python exploit code templatevmmap
– 可以用来查看栈、bss段是否可以执行
xormem
– XOR a memory region with a key