[드림핵] Return Address Overwrite
예제 // Name: rao.c // Compile: gcc -o rao rao.c -fno-stack-protector -no-pie #include #include void init() { setvbuf(stdin, 0, 2, 0); setvbuf(stdout, 0, 2, 0); } void get_shell() { char *cmd = "/bin/sh"; char *args[] = {cmd, NULL}; execve(cmd, args, NULL); } int main() { char buf[0x28]; init(); printf("Input: "); scanf("%s", buf); return 0; } A를 여러개 입력했을 때, Segmentation fault라는 에러가 출력되며, 프로그램이 비정..
System Hacking
2024. 3. 11. 19:28