SystemHacking(95)
-
[2] iron_golem -> dark_eyes ( RET Sleding )
iron_golem / blood on the fedora [ dark_eyes.c ]1234567891011121314151617181920212223242526/* - hint : RET sleding*/ int main(int argc, char *argv[]){ char buffer[256]; char saved_sfp[4]; if(argc 다음 실행할 명령어를 EIP 레지스터에 넣고 해당 명령어의 주소로 이동하여 실행한다 [ Stack 구조 ]saved ebp 0xfeea51e8saved eip &ret&ret&ret&execl ret가 3번 수행되고 마지막에는 pop &execl , jmp &execl 에 의해서 execl()함수가 실행되어진다 [ Shellcode 작성 ]12345678910..
2017.11.28 -
[1] gate -> iron_golem ( Fake EBP )
FC3 ( Fedora Catle )FTZ나 LOB와는 다르게 여기에는 메모리 보호 기법이 적용되어 있고, 이를 우회해야합니다메모리 보호기법 종류1> DEP ( Data Excution Prevention )스택메모리에서의 실행권한을 제거하여 스택에 Shellcode를 올려서 실행시킬 수 없습니다2> 아스키 아머모든 라이브러리 주소가 0x00 으로 시작하게 됩니다 => 0x00 값으로 인해 함수를 연속적으로 호출할 수 없게 되었다(gdb) p system$4 = {} 0x007507c0 (gdb) p strcpy$5 = {} 0x00783880 3> 랜덤 메모리 ( Address Space Layout Randomization )스택 메모리의 주소들이 실행 할 때마다 랜덤하게 바뀐다Data Section..
2017.11.28 -
[20] xavius -> death_knight ( Remote BOF )
xavius / throw me away [xavius@localhost xavius]$ /bin/bash2[xavius@localhost xavius]$ export SHELL=/bin/bash2 [ death_knight.c ]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 #include #include #include #include #include #include #include #include #include main(){ char buffer[40]; int server_fd, client_fd; struct sockaddr_in se..
2017.11.25 -
[19] nightmare -> xavius
nightmare / beg for me[nightmare@localhost nightmare]$ /bin/bash2[nightmare@localhost nightmare]$ export SHELL=/bin/bash2 [ xavius.c ] 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#include #include #include main(){ char buffer[40]; char *ret_addr; // overflow! fgets(buffer, 256, stdin); printf("%s\n", buffer); if(*(buffer+47) == '\xbf') { printf("stack ret..
2017.11.25 -
[17] zombie_assassin -> succubus ( Calling Function Continuously )
zombie_assassin / no place to hide/bin/bash2export SHELL=/bin/bash2 [ succubus.c ]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 /* The Lord of the BOF : The Fellowship of the BOF - succubus - calling functions continuously*/ #include #include #include // the ins..
2017.11.25 -
[16] assassin -> zombie_assassin ( Fake EBP & leaveret )
assassin / pushing me away[assassin@localhost assassin]$ /bin/bash2[assassin@localhost assassin]$ export SHELL=/bin/bash2 [ zombieassassin.c ] 123456789101112131415161718192021222324252627282930 #include #include main(int argc, char *argv[]){ char buffer[40]; if(argc EBP: Fake EBP 2> main retpop eip=> EIP: &leaveret 3> leavemov esp,ebp=> ESP: Fake EBP(&buffer+4)pop ebp=> EBP: &buffer+4에 있는 값 4> ..
2017.11.20