https://dreamhack.io/wargame/challenges/853
blue-whale
Description 보코가 여러분에게 도움을 요청합니다. "분명 플래그 파일이 있었는데요... 없어졌어요." Docker hub의 dreamhackofficial/blue-whale 레포지토리 (TAG:1) 에서 도커 이미지를 다운받을 수 있습니다.
dreamhack.io
답
https://github.com/wagoodman/dive
GitHub - wagoodman/dive: A tool for exploring each layer in a docker image
A tool for exploring each layer in a docker image. Contribute to wagoodman/dive development by creating an account on GitHub.
github.com
이 gitgub링크로 들어가 dive를 다운받는다.
이러한 부분을 찾고 복사해서 터미널에 붙여넣기 해서 깔아준다.
그리고 문제 파일을 vm으로 옴긴다.
그리고 이 폴더에서 터미널을 연다.
그리고 docker build를 해주면 error가 난다.
먼저 dreamhackofficial/blue-whaler의 이미지 ID를 찾는다.
여기를 보면 dreamhackofficial/blue-whaler이 있고 ID가87a96c7a8db0 이다.
그리고 아까 깔은 dive 를 사용한다.
dive image ID 명령으로 정보를 확인할 이미지를 빌드 한다. ( dive 87a96c7a8db0 )
그럼 이렇게 되는데 여기서 flag를 찾는다.
쭊 내려가다 보면 flag 가 있고
RUN /bin/sh -c touch `python3 -c "print(open('./flag', 'r').read())"` # buildkit 여기로 가서 확인하면 답이 있다.
DH{b06cb27a502a831822f927562258c6f69b5996a9916206cdb8755cc90ebf3b9f}
참고
처음 dive를 써보았고 docker은 익숙하지 않아서 정확한 풀이 방법은 모르다. 다음에 docker을 더 공부해서 이 문제를 다시 풀어보려고 한다.
끝
'hacking > misc' 카테고리의 다른 글
[Dream hack] Exercise: Welcome-Beginners (0) | 2025.03.03 |
---|---|
[Dream hack] 64se64 (0) | 2025.03.02 |
[Dream hack] Exercise: Docker (0) | 2024.04.14 |
[Dream hack] Exercise: SSH (0) | 2024.04.12 |
[Dream hack] baby-linux (0) | 2024.04.11 |