gdb
基礎(chǔ)調(diào)試命令
s step,si步入
n 執(zhí)行下一條指令 ni步入
b 在某處下斷點(diǎn)蓬豁,可以用
b * adrress
b function_name
info b 查看斷點(diǎn)信息
delete 刪除所有斷點(diǎn)
c 繼續(xù)
r 執(zhí)行
disas addr 查看addr處前后的反匯編代碼
disas functions 參看fucntion函數(shù)的反匯編代碼
顯示內(nèi)存數(shù)據(jù)
p 系列
p system/main 顯示某個(gè)函數(shù)地址
p $esp 顯示寄存器
p/x p/a p/b p/s包警。箩张。。
p 0xff - 0xea 計(jì)算器
print &VarName 查看變量地址
p * 0xffffebac 查看某個(gè)地址處的值
x系列
命令格式:x/<n/f/u> <addr>
n是一個(gè)正整數(shù)灵份,表示需要顯示的內(nèi)存單元的個(gè)數(shù)
f 表示顯示的格式(b字符,s字符串,i匯編指令,x十六進(jìn)制,d十進(jìn)制)
u 表示從當(dāng)前地址往后請(qǐng)求的字節(jié)數(shù) 默認(rèn)4byte,u參數(shù)可以用下面的字符來代替甩卓,b表示單字節(jié),h表示雙字節(jié)蕉斜,w表示四字 節(jié)逾柿,g表示八字節(jié)
<addr>表示一個(gè)內(nèi)存地址
x/xw addr 顯示某個(gè)地址處開始的16進(jìn)制內(nèi)容,如果有符號(hào)表會(huì)加載符號(hào)表
x/x $esp 查看esp寄存器中的值
x/s addr 查看addr處的字符串
x/b addr 查看addr處的字符
x/i addr 查看addr處的反匯編結(jié)果
info系列
info register $ebp 查看寄存器ebp中的內(nèi)容 (簡(jiǎn)寫為 i r ebp)
i r eflags 查看狀態(tài)寄存器
i r ss 查看段寄存器
i b 查看斷點(diǎn)信息
i functions 查看所有的函數(shù)
disas addr 查看addr處前后的反匯編代碼
stack 20 查看棧內(nèi)20個(gè)值
show args 查看參數(shù)
vmmap 查看映射狀況 peda帶有
readelf 查看elf文件中各個(gè)段的起始地址 peda帶有
parseheap 顯示堆狀況 peda帶有
查找數(shù)據(jù)
find 查找字符串 peda帶有
searchmem 查找字符串 peda帶有
ropsearch "xor eax,eax;ret" 0x08048080 0x08050000 查找某段的rop peda帶有
ropgadget 提供多個(gè)pop|ret可行結(jié)果 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:顯示一些內(nèi)存管理用到的全局變量
arena:顯示分配區(qū)的信息