[Wargame] basic_exploitation_002
1. 실습 코드 #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } void get_shell() { system("/bin/sh"); } int main(int argc, char *argv[]) { char buf[0x80]; initialize(); read(0, buf, 0x80); printf(buf); exit(0); } 2. 코드 분석 initialize..
[Wargame] rop
해당 문제는 강의에 기반한 문제로, 자세한 풀이는 아래 주소를 참고하세요. 2022.07.02 - [Dreamhack/Lecture & Practice] - [Practice] ROP - GOT Overwrite 1. 실습 코드 // Name: rop.c // Compile: gcc -o rop rop.c -fno-PIE -no-pie #include #include int main() { char buf[0x30]; setvbuf(stdin, 0, _IONBF, 0); setvbuf(stdout, 0, _IONBF, 0); // Leak canary puts("[1] Leak Canary"); printf("Buf: "); read(0, buf, 0x100); printf("Buf: %s\n", buf..