pwn常常会用到gdb,看到一篇不错的文章,记录了很多命令:https://www.jianshu.com/p/c3e5f5972b21

gdb

基础调试命令
s step,si步入
n 执行下一条指令 ni步入
b 在某处下断点,可以用
b * adrress
b function_name
info b 查看断点信息
delete 删除所有断点
c 继续
r 执行
disas addr 查看addr处前后的反汇编代码
disas functions 参看fucntion函数的反汇编代码

显示内存数据

p 系列
p system/main 显示某个函数地址
p $esp 显示寄存器
p/x p/a p/b p/s。。。
p 0xff - 0xea 计算器
print &VarName 查看变量地址
p * 0xffffebac 查看某个地址处的值 x系列
命令格式:x/<n/f/u> <addr>
n是一个正整数,表示需要显示的内存单元的个数
f 表示显示的格式(b字符,s字符串,i汇编指令,x十六进制,d十进制)
u 表示从当前地址往后请求的字节数 默认4byte,u参数可以用下面的字符来代替,b表示单字节,h表示双字节,w表示四字 节,g表示八字节
<addr>表示一个内存地址
x/xw addr 显示某个地址处开始的16进制内容,如果有符号表会加载符号表
x/x $esp 查看esp寄存器中的值
x/s addr 查看addr处的字符串
x/b addr 查看addr处的字符
x/i addr 查看addr处的反汇编结果 info系列
info register $ebp 查看寄存器ebp中的内容 (简写为 i r ebp)
i r eflags 查看状态寄存器
i r ss 查看段寄存器
i b 查看断点信息
i functions 查看所有的函数
disas addr 查看addr处前后的反汇编代码
stack 20 查看栈内20个值
show args 查看参数
vmmap 查看映射状况 peda带有
readelf 查看elf文件中各个段的起始地址 peda带有
parseheap 显示堆状况 peda带有

查找数据

find 查找字符串 peda带有
searchmem 查找字符串 peda带有
ropsearch "xor eax,eax;ret" 0x08048080 0x08050000 查找某段的rop peda带有
ropgadget 提供多个pop|ret可行结果 peda带有

pwngdb插件

libc : Print the base address of libc
ld : Print the base address of ld
codebase : Print the base of code segment
heap : Print the base of heap
got : Print the Global Offset Table infomation
dyn : Print the Dynamic section infomation
findcall : Find some function call
bcall : Set the breakpoint at some function call
tls : Print the thread local storage address
at : Attach by process name
findsyscall : Find the syscall
fmtarg : Calculate the index of format string
You need to stop on printf which has vulnerability.
force : Calculate the nb in the house of force.
heapinfo :打印heap的一些信息
default is the arena of current thread
If tcache is enable, it would show infomation of tcache entry
heapinfoall : Print some infomation of heap (all threads)
arenainfo : Print some infomation of all arena
chunkptr : 打印chunk的信息 后面加chunk返回给用户的地址
printfastbin : 打印fastbin的链表信息
tracemalloc on : 追踪程序chunk的malloc和free
parseheap :解析堆的布局
magic : 打印出glibc中一些有用的信息
fp : show FILE structure
fp (Address of FILE)
fpchain: show linked list of FILE
orange : Test house of orange condition in the _IO_flush_lockp
orange (Address of FILE)
glibc version <= 2.23

pwndbg

top_chunk: 显示top chunk的信息
malloc_chunk address:打印出已被分配的chunk的信息
fastbins:显示fastbins链表信息
unsorted:显示unsortedbin 的信息
smallbins:显示smallbins的信息
largebins:显示largebins的信息
bins:显示所有bins的信息
mp:显示一些内存管理用到的全局变量
arena:显示分配区的信息

最新文章

  1. SortedMap基本特性
  2. 系统建设 &gt; 医疗集团CRM系统建设步骤与分析
  3. 在Linux上用自己编译出来的coreclr与donet cli运行asp.net core程序
  4. 我的前端架构之二--统一扩展Js方法
  5. SVN错误及处理
  6. Clipping Magic – 帮助你轻松删除图片背景
  7. 转:java多线程--同步容器
  8. AngularJS学习笔记1
  9. Javascript 笔记与总结(2-10)删除节点,创建节点
  10. href=&quot;#&quot;会导致location.replace(location.href);脚本不工作
  11. C/C++源代码到可执行程序的过程详解
  12. 【英语】Bingo口语笔记(33) - 面部器官系列
  13. (三)跟我一起玩Linux网络服务:DHCP服务配置之主服务器配置
  14. bzoj 1096 [ZJOI2007]仓库建设(关于斜率优化问题的总结)
  15. IIS7的安装详解
  16. Android开发之DatePickerDialog与TimePickerDialog的功能和使用方法具体解释
  17. phome_ecms_news 数据表字段解释(新闻系统模型-主表)
  18. ext2 源代码解析之 “从路径名到目标结点” (一)
  19. C# 相对路径转绝对路径
  20. ●POJ 2983 Is the Information Reliable?

热门文章

  1. webpack理解
  2. Spring-03 依赖注入(DI)
  3. 【HTB系列】靶机Teacher的渗透测试详解
  4. linux 查询登陆成功、失败的用户
  5. 将MacOS Catalina 降级为 Mojave
  6. PAT-1151(LCA in a Binary Tree)+最近公共祖先+二叉树的中序遍历和前序遍历
  7. Java 开发工具
  8. Python爬虫系统化学习(5)
  9. go中waitGroup源码解读
  10. mysql-canal-rabbitmq 安装部署教程