아래의 소스를 이용한다.
#include <stdio.h>
int main()
{
long shell= 0x40058ae0; //system 함수의 주소
while(memcmp((void*)shell, "/bin/sh", 8)) //system함수의 주소에서 8바이트씩 /bin/sh를 비교해서 찾는다.
shell++; //못찾으면 다음 주소로
printf("/bin/sh = %p\n",shell); //"/bin/sh" 주소 출력
}
'System hacking > linux exploit 관련' 카테고리의 다른 글
checksec 사용 (0) | 2016.05.27 |
---|---|
file 디스크립터(다른 프로세스 간 통신) (0) | 2016.03.09 |
gdb 내 값 전달 (0) | 2016.03.08 |
C언어 주소 값 brute force 방법 (0) | 2016.01.05 |
gdb 내에서 인자 값 전달(fgets 등으로 인해) (0) | 2015.12.18 |