Dockerflag
Challenge Overview
We received a tar archive containing multiple tar.gz files. After extraction, we obtained a copy of a Docker image for a Flask project.
Analysis & Solution
- Extracted all archives to reconstruct the Docker image filesystem.
- Navigated to the
appfolder, which contained a basic Flask project under git version control. - Noticed that the
.gitdirectory was present, but theHEADfile was missing.- Manually recreated
.git/HEADwith the content:ref: refs/heads/main
- Manually recreated
- Ran
git logand observed several commits. One commit stood out:- Commit message: "Last commit before week-end !"
- Other commits had descriptive messages about added features.
- Checked out the suspicious commit:
git checkout <commit-hash>
- Found a
.envfile present at this commit, which contained the flag.
Flag:
404CTF{492f3f38d6b5d3ca859514e250e25ba65935bcdd9f4f40c124b773fe536fee7d}