본문 바로가기
[ ★ ]Study/PWNABLE

[Tip] /bin/sh 주소 찾기

by nroses-taek 2018. 11. 6.

pwtools  를 이용해서 /bin/sh 찾기


from pwn import *



ex) /bin/sh 함수 주소 가져오기

라이브러리 지정 및 변수 명 선언


libc= ELF('./라이브러리')

leak_binsh = base_addr + list(local_libc.search('/bin/sh'))[0]  / libc.search("/bin/sh").next()


------------------------


기본 gdb 에서


find &system, +99999999,"/bin/sh"


--------


ldd로 어떤 라이브러리 쓰는지 체크 후


strings -tx /lib/libc.so.6 | grep "/bin/sh"

출처: http://shayete.tistory.com/entry/Lv1-Gate [샤의 공간]
strings -tx /lib/libc.so.6 | grep "/bin/sh"

출처: http://shayete.tistory.com/entry/Lv1-Gate [샤의 공간]

strings -tx [사용라이브러리] | grep "/bin/sh"



------

find 명령어


gdb-peda$ find /bin/sh libc

'[ ★ ]Study > PWNABLE' 카테고리의 다른 글

Calling Convention  (0) 2018.12.05
함수 에필로그 leave ret;  (0) 2018.11.16
[Tip] pwntool 함수 offset/plt/got 주소 찾기(pwntools)  (0) 2018.11.06
Double Free Bug(DFB)  (0) 2017.09.18
Use After Free 취약점  (0) 2017.09.16

댓글