GDB] Combining all in One

노션으로 옮김·2020년 4월 20일
1

uitility

목록 보기
6/18
post-thumbnail

개요

gdb를 사용하는데 gef나 peda를 나눠서 사용하고 싶을 때 유용한 방법을 정리한다.


설치

pwndbg

git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh
cd ..
mv pwndbg ~/pwndbg-src
echo "source ~/pwndbg-src/gdbinit.py" > ~/.gdbinit_pwndbg

peda

git clone https://github.com/longld/peda.git ~/peda

gef

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

설정

~/.gdbinit

define init-peda
source ~/peda/peda.py
end
document init-peda
Initializes the PEDA (Python Exploit Development Assistant for GDB) framework
end

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

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

/usr/bin/gdb-peda

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

/usr/bin/gdb-pwndbg

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

/usr/bin/gdb-gef

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

실행

권한 추가

root@kali:~#chmod +x /usr/bin/gdb-*

실행

root@kali:~# gdb-peda
gdb-peda$ 

출처

https://medium.com/bugbountywriteup/pwndbg-gef-peda-one-for-all-and-all-for-one-714d71bf36b8

0개의 댓글