워게임
-
Dreamhack - Exercise : Dockerwargame/Dreamhack 2023. 11. 14. 03:07
[Beginner - Exercise: Docker - misc] 주어진 Dockerfile을 빌드하여 이미지를 생성하고 컨테이너를 실행해서 플래그를 획득하는 Docker 실습문제이다. 먼저 문제에서 주어진 Dockerfile이 있는 디렉토리로 이동한다. ls로 뭐가 들어있는지 봤더니 deploy와 Dockerfile이 있다. docker build .를 통해 일단 이미지를 빌드한다. 빌드가 다 되면 docker images로 생성된 이미지를 확인한다. 여기서 빌드된 IMAGE ID를 주목해야 한다. docker run -it (이미지 ID) /bin/bash를 입력하여 이미지 ID로부터 컨테이너를 생성하고 이를 실행해서 bash셸을 연다. 문제 환경에 접속하고 나서 ls를 입력하면 chall과 flag..
-
Dreamhack - dreamhack-tools-cyberchefwargame/Dreamhack 2023. 11. 3. 18:19
[Beginner - dreamhack-tools-cyberchef - misc] 드림핵에서 제공하는 것들 중에 dreamhack-tools 라는 것도 있는지 몰랐는데, 이번 워게임을 통해 사용법을 알게 되었다. 일단 문제 파일을 다운로드 받았다. 폴더 안에는 index.html 파일이 있는데 열어보면 다음과 같은 문자열이 적혀있다. 첫 줄 아래에 적힌 걸 보아, 플래그값을 Rail Fence → Base64 → ROT13 순서대로 암호화를 하여 저러한 문자열이 된 것 같다. 그래서 원래의 플래그를 얻으려면 다시 역순으로 복호화를 해야 할 것 같다. 애초에 문제에서 드림핵에서 제공하는 dreamhack-tools 중에서도 Cyber Chef를 이용해서 풀으라고 되어있다. 따라서 아래 페이지에 접속한다. ..
-
Dreamhack - blue-whalewargame/Dreamhack 2023. 11. 3. 17:49
[Beginner - blue-whale - misc] Docker를 이용해 푸는 문제이고, 문제 설명에 플래그 파일이 원래 있었는데 없어졌다고 한다. Docker hub의 dreamhackofficial/blue-whale 레포지토리 (TAG:1)에서 도커 이미지를 다운 받을 수 있다. 그런데 docker만 이용해서 푸는게 아니라 문제에서 힌트라고 제공해준 사이트를 함께 이용해야 풀이가 가능했다. 우선 이 문제를 풀기 전에, VirtualBox 우분투에서 풀이하고 싶기 때문에 내 윈도우 바탕화면에 share 폴더를 만들고 이 폴더를 VirtualBox 우분투랑 같이 공유하기 위해 VirtualBox에서 공유폴더 설정을 해준다. 그러고나서 Docker hub에 들어가지는 않고 바로 문제 파일 받기를 눌러..
-
Dreamhack - Exercise : SSHwargame/Dreamhack 2023. 10. 10. 23:58
[Beginner - Exercise : SSH - misc] ssh 문제를 어떻게 푸는지 몰랐는데 이 문제를 통해 알게 되었다. 먼저 우분투를 열어서 ssh with 형식으로 넣어주어야 하는데, 이때 with은 문제 접속 정보에 있는 id@host 형식으로 넣으면 된다. 그러면 비밀번호를 치라고 나오는데 비밀번호도 문제에 나와있는대로 쳐준다. ls를 통해 뭐가 있는지 살펴보고 cat을 통해 flag 안의 값을 출력해냈다. 플래그를 획득했다!
-
Dreamhack - Exercise : Welcome-Beginnerswargame/Dreamhack 2023. 10. 10. 23:54
[Beginner - Exercise : Welcome-beginners - misc] 드림핵을 영어로 입력하면 플래그를 얻을 수 있다는 간단한 문제이다. 이거 풀기 전에는 nc 문제 푸는 법을 몰랐는데 이 문제를 통해서 알게 되었다. 먼저 윈도우에 설치해놓았던 우분투를 열어서 드림핵 문제 접속 정보에 있는 정보를 그대로 복사해서 넣어준다. 그러면 Dreamhack을 그대로 치라고 나오는데 진짜 그대로 치면 된다. 플래그를 획득했다!
-
Dreamhack - phpregwargame/Dreamhack 2023. 10. 3. 16:32
[beginner - phpreg - web] 이 문제는 php로 작성된 페이지이고, 알맞은 Nickname과 Password를 입력하면 Step2로 넘어갈 수 있다. Step2에서 system() 함수를 이용해 플래그를 획득하면 된다. 플래그는 ../dream/flag.txt에 위치한다고 한다. 접속 정보로 접속하면 나오는 첫 화면이다. 요구되는 Nickname와 Password를 제대로 입력해야 하는데 정보가 없으므로 문제 파일을 다운로드 해준다. 파일을 다운로드하면 index.php와 step2.php 총 두 개의 php 파일을 얻을 수 있다. 먼저 index.php를 살펴보면 닉네임과 패스워드를 입력받아 step2.php로 넘기는 걸 볼 수 있다. 그리고 step2.php를 열어보면 위와 같이 이..
-
Dreamhack - ex-reg-exwargame/Dreamhack 2023. 10. 3. 15:36
[beginner - ex-reg-ex - web] 접속 정보로 접속하면 나오는 첫 화면이다. 정규표현식 조건 이용하여 이메일 치고 답 얻는 걸로 추정 플래그는 flag.txt파일과 FLAG 변수에 있다고 한다. 문제 파일에서 다운로드 받은 app.py는 위와 같다. 파이썬의 re 모듈을 이용하여 이메일 정규표현식 조건을 걸어놓은 걸로 보인다. 여기서 가장 중요해 보이는 코드인 m = re.match(r'dr\w{5,7}e\d+am@[a-z]{3,7}\.\w+', input_val) 를 해석해보면 dr은 문자열 dr \w{5,7}은 문자 5개 이상 7개 이하 e는 문자 e \d+는 숫자 1개 이상 am@는 문자열 am@ [a-z]{3,7}은 소문자 알파벳 문자 3개 이상 7개 이하 \. 마침표 문자 \w..
-
Dreamhack - baby-linux, 64se64wargame/Dreamhack 2023. 9. 27. 06:48
[beginner - baby-linux - misc] 문제 설명에 리눅스 명령어를 실행하는 웹 서비스라고 나와있다. 일단 접속 정보로 접속한다. 접속하면 뜨는 초기 화면이다. 리눅스 명령어를 저기에 치면 될듯 뭐가 있는지 모르니까 먼저 ls를 쳐본다. hint.txt라는 이름의 파일 발견 cat hint.txt로 파일 읽어오기 이 문제가 flag.txt 찾는 건데 저 경로에 있다고 알려준다. 따라서 cat ./dream/hack/hello/flag.txt 를 친다. No!라고 출력된다. 소스코드 봐야할듯 cmd에 'flag'가 있을 경우 No!가 출력되도록 필터링이 되어있다. 따라서 cat ./dream/hack/hello/f*ag.txt 로 바꿔서 쳐본다. (리눅스의 와일드 카드 이용, *은 a-z,..