본문 바로가기

전체 글

(87)
[드림핵/워게임] out_of_bound_000 https://dreamhack.io/wargame/challenges/9
[드림핵/워게임] off_by_one_001 https://dreamhack.io/wargame/challenges/10
[드림핵/워게임] off_by_one_000 https://dreamhack.io/wargame/challenges/9 30초 후 실행 종료 2. 전역 변수 cp_name에 read로 입력 3. cpy 함수 호출 4. 지역 변수 real_name에 strcpy로 cp_name 값 복사 5. cp_name 값 출력 -> 실행 종료 디버깅 해 보면 256개의 A를 넣었을 때, SFP의 하위 1바이트가 덮이는 것을 볼 수 있다. 이렇게 SFP의 하위 1바이트가 덮이면 어떻게 될까? 하위 1바이트가 덮인 것과 안 덮인 것이다. 하위 1바이트가 덮이면 변수 한 가운데의 0x41414141을 가리키는 것을 볼 수 있는데, 이를 통해 get_shell 함수를 반복적으로 넣어 256만큼 채워 주면 궁극적으로 get_shell 함수의 주소로 간다는 것을 유추할 수..
[드림핵/워게임] sint https://dreamhack.io/wargame/challenges/25 sint Description 이 문제는 서버에서 작동하고 있는 서비스(sint)의 바이너리와 소스 코드가 주어집니다. 프로그램의 취약점을 찾고 익스플로잇해 get_shell 함수를 실행시키세요. 셸을 획득한 후, "flag" 파 dreamhack.io 문제 파일을 다운 받으면 sint.c와 실행 파일이 있다. #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); sign..
[드림핵/워게임] ssp_001 https://dreamhack.io/wargame/challenges/33 ssp_001 Description 이 문제는 작동하고 있는 서비스(ssp_001)의 바이너리와 소스코드가 주어집니다. 프로그램의 취약점을 찾고 SSP 방어 기법을 우회하여 익스플로잇해 셸을 획득한 후, "flag" 파일을 읽으세 dreamhack.io 문제 파일을 다운 받으면 ssp_001.c와 실행 파일이 있다. #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); s..
[드림핵/워게임] ssp_000 https://dreamhack.io/wargame/challenges/32 ssp_000 Desciption 이 문제는 작동하고 있는 서비스(ssp_000)의 바이너리와 소스코드가 주어집니다. 프로그램의 취약점을 찾고 SSP 방어 기법을 우회하여 익스플로잇해 셸을 획득한 후, "flag" 파일을 읽으세요 dreamhack.io 문제 파일을 다운 받으면 ssp_000.c와 실행 파일이 있다. #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); s..
[드림핵/워게임] Return to Shellcode https://dreamhack.io/wargame/challenges/352 Return to Shellcode Description Exploit Tech: Return to Shellcode에서 실습하는 문제입니다. dreamhack.io 문제 파일을 다운 받으면 r2s.c와 실행 파일이 있다. // 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("Di..
[드림핵/워게임] web-ssrf https://dreamhack.io/wargame/challenges/75/ web-ssrf flask로 작성된 image viewer 서비스 입니다. SSRF 취약점을 이용해 플래그를 획득하세요. 플래그는 /app/flag.txt에 있습니다. 문제 수정 내역 2023.07.17 css, html 제공 Reference Server-side Basic dreamhack.io 입력 칸에 바로 /flag.txt를 넣으니 뭐가 뜨긴 한다. 이게 뭔가 하고 보니 404... 에러였다. 코드를 보자 @app.route("/img_viewer", methods=["GET", "POST"]) def img_viewer(): if request.method == "GET": return render_template(..