
https://dreamhack.io/wargame/challenges/15
이 문제는 사용자에게 문자열 입력을 받아 정해진 방법으로 입력값을 검증하여 correct 또는 wrong을 출력하는 프로그램이 주어집니다.
해당 바이너리를 분석하여 correct를 출력하는 입력값을 찾는 문제입니다.
드림핵의 rev-basic-0 문제와 매우 유사합니다.
rev-basic-0 문제 풀이 링크 :
https://velog.io/@yunaa/Dreamhack-rev-basic-0-리버스-엔지니어링-기초
제공된 chall1.exe파일을 실행하면 input : 이라는 문자열이 출력되며 사용자의 입력을 받는 프로그램임을 알 수 있습니다. 플래그 값을 입력하면 "Correct"가 뜨는 구조입니다.
x64dbg을 이용해 chall1.exe 파일을 열어봅니다.
우클릭 후 다음을 찾기 > 모든 시스템 모듈 > 문자열 참조 을 통해 "Correct" 문자열을 검색합니다.

"Correct" 문자열이 출력되는 코드 근처에서 다음과 같은 흐름을 확인할 수 있습니다.

input : 을 출력합니다.[rsp+20] 주소에 저장합니다.[rsp+20]을 검사합니다.eax == 0 라면 wrong, 같다면 correct을 출력합니다.cmp 를 통해 플래그로 의심되는 문자를 한 글자씩(C-o-m-p-a-...) 검사함을 확인할 수 있었습니다.
chall1.exe에 입력해보니 correct 메세지가 출력되어 정상적으로 플래그를 얻어냈습니다.chall1.exe) prompts the user with input : and verifies the input string."Correct"; otherwise, "Wrong" is shown.x64dbg and searched for the "Correct" string using string references.call chall1.7FF681ED1000) responsible for input validation.cmp instructions.chall1.exe and confirmed that "Correct" was printed, meaning the flag was successfully retrieved.