wargame
-
Dreamhack - proxy-1wargame/Dreamhack 2024. 10. 8. 10:57
[LEVEL 1 - proxy-1 - web] 문제 설명에 나와있는 그대로 Raw Socket Sender가 구현된 서비스가 주어진다.플래그는 flag.txt, FLAG 변수에 있다고 한다. 문제 파일부터 다운로드 받으면 위와 같은 코드를 볼 수 있는데 중요한 부분만 캡처했다.host는 127.0.0.1port는 8000data 부분에는 나머지 요구 조건을 만족시키면서 직접 HTTP 헤더 구조를 정확히 작성해야 한다.HTTP 헤더 구조는 아래 링크를 참고했다.https://raonctf.com/essential/study/web/http RAON CTF - WEB EssentialHTTP, HTTPS Secure Protocol HTTP 평문 전송과 암호화 HTTP Header / HTTP 헤더 HT..
-
Dreamhack - simple-web-requestwargame/Dreamhack 2024. 10. 8. 10:46
[Beginner - simple-web-request - web] STEP 1과 STEP 2를 거쳐 FLAG 페이지에 도달하면 플래그가 출력되는 문제이다. 문제 환경에 접속하면 나오는 페이지다. 문제 파일을 다운로드 받으면 위와 같은 코드들을 볼 수 있는데, 자세히 보면 문제의 답이 다 나와있다. STEP 1 페이지로 들어가면 위와 같이 나오는데 첫 번째 코드 사진에 있던 prm1과 prm2에 맞는 값을 각각 넣어준다. 제출을 누르면 바로 STEP 2 페이지로 리다이렉트된다.마찬가지로 두 번째 코드 사진에 있던 prm1과 prm2에 맞는 값을 각각 넣어준다. 제출을 누르면 FLAG 페이지로 이동해 플래그값을 바로 확인할 수 있다. 플래그를 획득했다!
-
Dreamhack - sessionwargame/Dreamhack 2024. 9. 25. 23:58
[Beginner - session - web] 쿠키와 세션으로 인증 상태를 관리하는 간단한 로그인 서비스가 주어진다.admin 계정으로 로그인에 성공하면 플래그를 획득할 수 있다고 한다. 문제 파일을 다운로드 받으면 위와 같이 app.py가 있다.여기서 가장 중요한 코드는 os.urandom(1).hex()인데 1바이트의 랜덤값을 생성한 후 이를 16진수로 바꾸는 코드이다.즉, session_storage에 저장되는 admin의 session_id값은 두자리다.(1바이트는 8비트고, 4비트가 16진수 하나로 표현됨) 문제 환경에 접속하면 가장 처음 나오는 페이지다. BurpSuite로 프록시 탭에서 intercept on으로 바꿔준 뒤 open browser 해주고 아까 위에 코드에서 본 ..
-
Dreamhack - php7cmp4rewargame/Dreamhack 2024. 9. 25. 13:32
[Beginner - php7cmp4re - web] php 7.4로 작성된 문제이다.알맞은 Input값을 입력하면 플래그값을 얻을 수 있다고 한다. 문제파일을 다운로드 받으면 3개의 php파일이 들어있는데, 그중 index.php파일이다. flag.php파일이다. check.php이다. 알아야 하는 정보는 여기에 다 들어있다.위 php 코드를 보면 input_1의 값은 최대 3자리 문자열이어야 하고, 문자열 "7.9"보다 크면서 문자열 "7.A"와 문자열 "8"보다는 작아야 한다.참고로 php는 문자열끼리 비교할 때 문자열의 각 문자를 ASCII Code 값을 기준으로 비교하고, 이는 사전적 순서로 이루어진다.즉, 문자열 "7.9"와 문자열 "7.A" 사이에 있는 값들이 가능하므로, 아스키..
-
Dreamhack - web-misconf-1wargame/Dreamhack 2024. 9. 24. 22:48
[Beginner - web-misconf-1 - web] 기본 설정을 사용한 서비스라고 한다.로그인한 후 Organization에 플래그를 설정해 놓았다고 되어있다. 문제 환경에 접속하면 가장 처음 보이는 페이지 문제 파일 다운로드하면 설정 파일 들어있는데 그거 열어서 쭉 보다보니까 default인 admin_user랑 admin_password가 나오길래 참고했다. 저걸로 진짜 로그인이 된다. organization 페이지에 들어가서 누가봐도 플래그처럼 보이는 값을 찾았다. 플래그를 획득했다!
-
Dreamhack - Simple Crack Mewargame/Dreamhack 2024. 8. 24. 21:23
[LEVEL 1 - Simple Crack Me - reversing] 문제 파일을 다운로드 받으면 "simple_crack_me"라는 파일이 하나 들어있다. start 함수를 IDA로 디컴파일하고 sub_401AD5 함수 내부를 들어가본다. 위에서 볼 수 있듯 sub_40BB20()은 scanf()로 추정된다.(&unk_4B6004가 %d를 가리키고 있으며, 해당 함수 내부에서 va_start로 va argument를 가져옴)그리고 이 입력값 v11이 위에 하이라이트 표시한 값과 같을 때 "Correct!"를 출력하고 있는 것도 볼 수 있다.문제에서 correct를 출력하는 10진수 양수값을 찾으라고 했기 때문에 이 값이 정답이다. 플래그를 획득했다!
-
Dreamhack - [CodeEngn] Malware L08wargame/Dreamhack 2024. 8. 24. 21:09
[LEVEL 1 - [CodeEngn] Malware L08 - reversing, misc] 문제 파일을 다운로드 받으면 이전 문제들처럼 pdf가 하나 들어있다. 앞서 풀었던 문제들보다 주어진 악성코드의 flow가 조금 더 복잡해 보인다. 위에서부터 쭉 보다가 중간쯤에서 위와 같이 수상해 보이는 함수를 발견했다. 위와 같이 msdn에 ShellExecuteExA()에 대한 친절한 설명이 나와있다. 따라서 앞서 하이라이트 표시한 부분이 문제 설명에 나와있던 "다른 악성코드를 실행하여 추가 감염을 일으키는 함수의 주소"임을 알 수 있다.PE 파일이 익숙한 사람들에게는 당연한 것이겠지만, 정답은 Ex) 00401000과 같은 형태임을 유의해야 한다. 플래그를 획득했다!