Security/System Hacking6 [System Hacking] Dreamhack - Return to Shellcode 풀이 Return to ShellcodeDescription Exploit Tech: Return to Shellcode에서 실습하는 문제입니다.dreamhack.io 문제 설명 // Name: r2s.c// Compile: gcc -o r2s r2s.c -zexecstack#include #include void init() { setvbuf(stdin, 0, 2, 0); setvbuf(stdout, 0, 2, 0);}int main() { char buf[0x50]; init(); printf("Address of the buf: %p\n", buf); printf("Distance between buf and $rbp: %ld\n", (char*)__builtin_frame_ad.. 2025. 1. 29. [System Hacking] Dreamhack - basic_exploitation_001 풀이 basic_exploitation_001Description 이 문제는 서버에서 작동하고 있는 서비스(basic_exploitation_001)의 바이너리와 소스 코드가 주어집니다. 프로그램의 취약점을 찾고 익스플로잇해 "flag" 파일을 읽으세요. "flag" 파일의 내용dreamhack.io 문제 설명 서버에서 작동하고 있는 서비스(basic_exploitation_001)의 바이너리와 소스 코드가 주어진다. #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1);}void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdo.. 2025. 1. 23. [System Hacking] Dreamhack - basic_exploitation_000 풀이 basic_exploitation_000Description 이 문제는 서버에서 작동하고 있는 서비스(basic_exploitation_000)의 바이너리와 소스 코드가 주어집니다. 프로그램의 취약점을 찾고 익스플로잇해 셸을 획득한 후, "flag" 파일을 읽으세요. "fdreamhack.io 문제 설명 서버에서 작동하고 있는 서비스(basic_exploitation_000)의 바이너리와 소스 코드가 주어진다. #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1);}void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout.. 2025. 1. 23. [System Hacking] Dreamhack - Return Address Overwrite 풀이 Return Address OverwriteDescription Exploit Tech: Return Address Overwrite에서 실습하는 문제입니다.dreamhack.io 문제 설명 // 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().. 2025. 1. 22. [System Hacking] Dreamhack - 1. Shellcode 셸코드 (Shellcode) 해킹에서 상대 시스템을 공격하는 것을 익스플로잇(Exploit)이라고 부른다. 익스플로잇과 관련된 첫 번째 공격 기법 Shellcode에 대해 알아보자. 셸코드는 익스플로잇을 위해 제작된 어셈블리 코드로, 일반적으로 셸을 획득하기 위한 목적으로 사용된다. 해커가 rip를 자신이 작성한 셸코드로 옮길 수 있으면 원하는 어셈블리 코드가 실행되게 할 수 있다.셸코드는 어셈블리어로 구성되므로 공격을 수행할 대상 아키텍처와 운영체제, 셸코드의 목적에 따라 다르게 작성된다. orw 셸코드orw 셸코드는 파일을 열고, 읽은 뒤 화면에 출력해주는 셸코드이다. orw 셸코드의 의사코드 char buf[0x30];int fd = open("/tmp/flag", RD_ONLY, NULL);.. 2025. 1. 14. 이전 1 2 다음