Pwnable KR - unlink

문제 unlink 취약점을 공부하는 문제. unlink@prowl:~$ ls -l total 20 -r--r----- 1 root unlink_pwn 49 Nov 23 2016 flag -rw-r----- 1 root unlink_pwn 543 Nov 28 2016 intended_solution.txt -r-xr-sr-x 1 root unlink_pwn 7540 Nov 23 2016 unlink -rw-r--r-- 1 root root 749 Nov 23 2016 unlink.c #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct tagOBJ{ struct tagOBJ* fd; struct tagOBJ* bk; [Read More]

Pwnable KR - asm

문제 asm@prowl:~$ ls -l total 28 -rwxr-xr-x 1 root root 13704 Nov 29 2016 asm -rw-r--r-- 1 root root 1793 Nov 29 2016 asm.c -rw-r--r-- 1 root root 211 Nov 19 2016 readme -rw-r--r-- 1 root root 67 Nov 19 2016 this_is_pwnable.kr_flag_file_please_read_this_file.sorry_the_file_name_is_very_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo0000000000000000000000000ooooooooooooooooooooooo000000000000o0o0o0o0o0o0ong asm@prowl:~$ cat readme once you connect to port 9026, the "asm" binary will be executed under asm_pwn privilege. make connection to challenge (nc 0 9026) then get [Read More]

FC4 cruel -> enigma

ret 영역 다음에 canary가 있다는 걸 생각하야 한다. fake ebp를 이용해서 stdin의 임시버퍼 영역을 공략한다. 이 영역의 주소가 계속 바뀌긴 하지만 경우의 수 [Read More]

FC3 evil_wizard -> dark_stone

dark_stone 코드 /* The Lord of the BOF : The Fellowship of the BOF - dark_stone - Remote BOF on Fedora Core 3 - hint : GOT overwriting again - port : TCP 8888 */ #include <stdio.h> // magic potion for you void pop_pop_ret(void) { asm("pop %eax"); asm("pop %eax"); asm("ret"); } int main() { char buffer[256]; char saved_sfp[4]; int length; char temp[1024]; printf("dark_stone : how fresh meat you are!\n"); [Read More]

FC3 hell_fire -> evil_wizard

pop pop ret을 어떻게 쓰는 건지 이 문제를 풀고 알게 됐다. 리턴을 이용해서 인자가 2개 필요한 함수를 호출할 때 스택에 아래와 같이 배치시킨다. [함수주소] [ㅁㄴㅇ [Read More]