wargame
-
Dreamhack - simple_sqliwargame/Dreamhack 2024. 2. 21. 21:23
[LEVEL 1 - simple_sqli - web] SQL Injection 문제 중에서도 가장 간단한 문제로 보인다. 문제 환경에 접속한 첫 화면이다. 로그인 페이지로 가서 userid를 admin으로 하되 더블쿼트와 --를 써서 데이터베이스 상의 비밀번호 조건을 없애버린다. 따라서 userid 칸에는 admin"--를 입력하고 password 칸에는 아무거나 1234라고 써준다. 그러면 화면에 flag가 아래와 같이 출력된다. 플래그를 획득했다!
-
Dreamhack - xss-2wargame/Dreamhack 2024. 2. 7. 18:18
[LEVEL 1 - xss-2 - web] 문제 환경에 접속해보면 이전 xss-1 문제와 똑같지만 한 가지 다른 점이 있다. /vuln에 가보면 아까 1이라고 뜨던 창이 아예 뜨지 않는다. 태그가 실행이 안되는 것을 알 수 있다. vuln.html을 보면 innerHTML로 처리하기 때문에 자바스크립트가 외부에서 삽입되는 것이 차단되어 있다는 걸 알 수 있다. 문제 해결 위해 필요한 xss 우회 관련 사전 지식이 없어서 공부를 먼저 시작하고 워게임을 풀었다. 우선 iframe 태그는 원래 알고 있던 것이긴 한데, 간단히 설명을 적자면 iframe은 inline frame의 약자로, 현재 렌더링되고 있는 문서 안에 또 다른 페이지를 삽입할 수 있는 기능을 제공한다. xss 우회하는 방법에는 여러 가지가 있..
-
Dreamhack - xss-1wargame/Dreamhack 2024. 2. 7. 16:45
[LEVEL 1 - xss-1 - web] XSS 취약점을 이용해 플래그를 획득하는 문제이다. 문제 환경에 접속하면 나오는 첫 화면이다. 플래그 값을 얻기 위해서는 /vuln 엔드포인트에서 발생하는 XSS 취약점을 통해 임의 이용자의 쿠키를 탈취해야 한다. 탈취한 쿠키를 전달받기 위해서는 외부에서 접근 가능한 웹 서버를 사용하거나 문제에서 제공하는 memo 엔드포인트를 사용하면 된다. 공격에 사용할 수 있는 속성으로는 location.href(전체 URL 반환 or URL 업데이트할 수 있는 속성값)와 document.cookie(해당 페이지에서 사용하는 쿠키를 읽고 쓰는 속성값)가 있다. memo 페이지를 사용하여 쿠키를 탈취해 보겠다. flag 엔드포인트에서 익스플로잇 코드를 작성하고 제출을 누르면 ..
-
Dreamhack - session-basicwargame/Dreamhack 2024. 1. 31. 19:04
[LEVEL 1 - session-basic - web] 이 문제는 쿠키와 세션으로 인증 상태를 관리하는 간단한 로그인 서비스이며, admin 계정으로 로그인에 성공하면 플래그를 획득할 수 있다. 문제 파일을 먼저 다운로드 받으면 app.py가 있다. 일단 아까 코드 중 users에 있던 아이디 guest, 비밀번호 guest로 로그인을 해보고 개발자도구를 열었다. 일단 Application 탭의 Cookies로 넘어와 sessionid 값을 복사해서 메모장에 붙여놓고 우클릭해서 삭제해본다. 그런데 아까 코드에 /admin 페이지가 있는 걸 보긴 했는데 들어가보니까 저렇게 admin의 sessionid값도 다 나와있다. admin의 sessionid 값이 필요할테니 이를 메모장에 복사해놓는다. 좀전에 삭..
-
Dreamhack - cookiewargame/Dreamhack 2024. 1. 31. 18:07
[Beginner - cookie - web] 이 문제는 쿠키로 인증 상태를 관리하는 간단한 로그인 서비스이며, admin 계정으로 로그인에 성공하면 플래그를 획득할 수 있다. 웹해킹 문제 환경에 접속하고 나면 문제 파일을 다운로드 받는다. users에 등록되어 있는 건 guest와 admin 사용자이고, guest의 비밀번호는 guest이며, admin의 비밀번호는 파일에서 읽어온 FLAG인 것을 알 수 있다. 로그인 화면에서 아이디 guest, 비밀번호 guest로 로그인하고 개발자도구를 열어 Application 탭의 Cookies를 보면 Value값이 guest로 바뀐 것을 볼 수 있다. 익스플로잇 하이라이트된 Value값 guest를 admin으로 바꾸어 다시 새로고침을 하면 admin 계정으로..
-
Dreamhack - Carve Partywargame/Dreamhack 2024. 1. 23. 22:48
[Beginner - Carve Party - web] 문제 설명에 호박을 10000번 클릭하고 플래그를 획득하라고 되어있다. 문제 파일 jack-o-lantern.html을 다운로드 받으면 아래와 같은 화면이 나온다. 호박 눌러보면 밑에 10000 숫자가 1씩 감소하면서 호박의 입 형태가 조금씩 진해진다. 진짜 10000번 클릭하면 정답이 나올 것 같긴 한데 너무 노가다니까 html 코드를 vs code로 열어서 살펴본다. 중요한 부분만 캡처했는데, 위의 함수는 호박을 클릭할 때마다 점점 호박의 눈, 코, 입이 진해지게 만든다. 이 호박 클릭 함수 자체를 10000번 반복하면 되는 거니까 원래의 코드 밑에 for문을 추가해준다. 수정한 코드를 저장하고 다시 웹 페이지를 열면 호박의 눈, 코, 입이 완전..