Kernel Exploit/Theory

kernel debuging with pwndbg - pwndbg 설치

wyv3rn 2023. 8. 27. 13:17
728x90
반응형

서론

gef가 익숙하고 편해서 사용하고 있었으나, 무슨 이유인지 모르겠지만 kernel debuging 시 register, stack, code 모든 영역의 값이 제대로 나오지 않는 문제가 발생했다.

지원은 하긴 할텐데 정확히 이유를 알 수 없어 어쩔 수 없이 pwndbg를 설치하였다.

 

설치 방법

아래를 차례로 실행하면 끝.

git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh

 

kernel debuging 기본 셋팅

아래 스크립트를 기준으로 실행하면 된다.

#! /bin/sh

gdb \
	-ex "add-auto-load-safe-path $(pwd)" \
	-ex "file vmlinux" \
	-ex 'set arch i386:x86-64' \
	-ex 'target remote localhost:1234' \
	-ex 'gef config gef.debug 1' \
	-ex 'break start_kernel' \
	-ex 'continue' \
	-ex 'disconnect' \
	-ex 'set arch i386:x86-64' \
	-ex 'target remote localhost:1234' \

 

728x90
반응형