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