GDB-PEDA使用方法
ssooking Lv5

简介

PEDA(Python Exploit Development Assistance for GDB)是一个强大的GDB插件。它提供了更多功能,如高亮显示反汇编代码、寄存器等信息。PEDA提供了一些实用新的命令,比如checksec、aslr等
https://blog.csdn.net/SmalOSnail/article/details/53149426

一键安装:

1
2
3
4
5
6
7
8
git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit
wget -O ~/.gdbinit-gef.py -q https://github.com/hugsy/gef/raw/master/gef.py
echo "source ~/.gdbinit-gef.py" >> ~/.gdbinit

git clone https://github.com/scwuaptx/peda.git ~/peda
git clone https://github.com/scwuaptx/Pwngdb.git ~/Pwngdb
cp ~/Pwngdb/.gdbinit ~/

安装GDB插件

peda

1
2
git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit

gef

官方文档地址

1
2
wget -O ~/.gdbinit-gef.py -q https://github.com/hugsy/gef/raw/master/gef.py
echo "source ~/.gdbinit-gef.py" >> ~/.gdbinit

pwndbg

1
2
3
4
5
git clone https://github.com/pwndbg/pwndbg
cd pwndbg && sudo ./setup.sh
cd ..
mv pwndbg ~/pwndbg-src
echo "source ~/pwndbg-src/gdbinit.py" > ~/.gdbinit_pwndbg

确认插件生效

使用gdb -q xxx命令启动调试程序,出现类似字符串,说明已经成功安装

1
2
3
4
GEF for linux ready, type `gef' to start, `gef config' to configure
75 commands loaded for GDB 7.11.1 using Python engine 3.5
[*] 5 commands could not be loaded, run `gef missing` to know why.
Reading symbols from execve...done.

分别启用插件

修改.gdbinit文件的内容为如下配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
define init-peda
source ~/peda/peda.py
end
document init-peda
Initializes the PEDA (Python Exploit Development Assistant for GDB) framework
end

define init-gef
source ~/.gdbinit-gef.py
end
document init-gef
Initializes GEF (GDB Enhanced Features)
end

define init-pwndbg
source ~/.gdbinit_pwndbg
end
document init-pwndbg
Initializes PwnDBG
end

Additionally, create the following 3 files in your /usr/bin folder:

First create /usr/bin/gdb-peda and paste the following:

1
2
#!/bin/sh
exec gdb -q -ex init-peda "$@"

Then /usr/bin/gdb-pwndbg

1
2
#!/bin/sh
exec gdb -q -ex init-pwndbg "$@"

And lastly, /usr/bin/gdb-gef

1
2
#!/bin/sh
exec gdb -q -ex init-gef "$@"

使用方法

https://blog.csdn.net/gatieme/article/details/63254211

  • Post title:GDB-PEDA使用方法
  • Post author:ssooking
  • Create time:2019-12-31 17:35:00
  • Post link:https://ssooking.github.io/2019/12/gdb-peda使用方法/
  • Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.