System/Linux

Pwnable을 위한 Tools 정리

Tribal 2017. 4. 14. 15:18

Peda : gdb 업그레이드

$ git clone https://github.com/zachriggle/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit
cs



Peda-heap : Peda에 heap 분석용 커맨드 추가

$ git clone https://github.com/Mipu94/peda-heap ~/peda-heap
echo "source ~/peda-heap/peda.py" >> ~/.gdbinit
cs



pwndbg : Peda 옆그레이드, Peda나 pwndbg 중 택1
how to install

1
2
git clone https://github.com/pwndbg/pwndbg; cd pwndbg
./setup.sh
cs


※ 위와 같이 disas 명령어가 잘 안 될 때의 경우

echo "alias -a disas = disassemble" >> ~/.gdbinit
cs



QIRA : Web을 통해 분석할 수 있는 Timeless Debugger
참고 : http://tribal1012.tistory.com/85



pwntools : python 모듈, 64bit Ubuntu용
how to install

$ sudo apt-get install libssl-dev libffi-dev pip
$ pip install pwntools
cs

※ 만약 설치 중 #include <@@@.h>와 같은 오류가 난다면 apt-get install lib@@@-dev로 라이브러리를 설치하면 됨

※ 굳이 pwntools이 아니라도 위와 같은 오류가 난다면 위와 동일하게 하면 됨



ROPgadget : find gadget for ROP Exploit
how to install

$ sudo pip install ropgadget
cs

사용방법
$ ROPgadget --binary binary명



xrop : RDPgadget으로 나온 gadget이 부족하다고 생각될 때, 사용 추천(더 많은 패턴으로 gadget을 뽑아냄)

how to install

$ git clone https://github.com/acama/xrop
$ cd rop; git submodule update --init --recursive
$ make
cs



mipsrop : mips 바이너리에서 gadget을 뽑아내고자 할 때, 사용(IDA plugin)

how to install(IDA 7.0 미만)

$ git clone https://github.com/devttys0/ida
cs

how to install(IDA 7.0 이상)(패치됨)

$ git clone hhttps://github.com/SeHwa/mipsrop-for-ida7
cs

사용방법

link : https://github.com/devttys0/ida/tree/master/plugins/mipsrop



checksec : 바이너리 방어기법 확인, 쉘 스크립트 기반
how to install

$ git clone https://github.com/slimm609/checksec.sh
$ cp checksec /usr/local/bin/
cs

사용방법
$ checksec --file binary명

 


libc-database : Memory leak(Info leak)을 통해, libc의 특정 함수 offset 획득
how to install

$ git clone https://github.com/niklasb/libc-database; cd libc-database
$ ./get
cs

사용방법
$ ./get
$ ./find __libc_start_main_ret `RET hex 값 중 하위 3바이트`
$ ./dump id


 

one_gadget : find one shot gadget for fast Exploit
how to install

$ gem install one_gadget
cs

사용방법
$ one_gadget [libc file] [options]
$ one_gadget /lib/i386-linux-gnu/libc.so.6 -s 'echo "offset ->"'


shellnoob : 

how to install

$ git clone https://github.com/reyammer/shellnoob; cd shellnoob
$ ./shellnoob.py --install
cs

사용방법

$ snoob --from-asm [asm file] --to-bin [bin file]

$ snoob --from-asm shell.asm --to-bin shell.bin



기타(pwnable 이외 포함) : https://github.com/zardus/ctf-tools