1337 Local CTF: July pool 2024 — Dangling Git Commits

159 words
1 minute
1337 Local CTF: July pool 2024 — Dangling Git Commits

July pool 2024#

Challenge Context#

The archive contained a 1337 piscine project repository. The visible files looked normal, but the flag was hidden in Git history rather than the working tree.

Reconnaissance#

The challenge title and project layout pointed at Git forensics. The key commands were:

Terminal window
unzip pool.zip
cd Exams42
find .git -type f | head
git fsck --lost-found
git log --all --oneline

Vulnerability / Core Idea#

Git stores objects even when commits are no longer reachable from a branch. If a secret was committed and then removed or orphaned, it may still exist as a dangling commit/blob.

Exploitation#

git fsck revealed dangling commits. Inspecting each commit recovered five backup secret parts. Combining the parts produced the flag.

Terminal window
git fsck --lost-found
for c in $(git fsck --no-reflogs 2>/dev/null | awk '/dangling commit/ {print $3}'); do
git show --stat --patch "$c"
done

Flag#

leet{d4ngl1ng_c0mm1t5_4r3_1mp0rt4nt}

Lesson Learned#

Deleting a secret from the working tree does not delete it from Git history. In CTFs and in real incidents, always inspect unreachable commits and blobs.


Cover: Wallhaven k81776.

Share Article

If this article helped you, please share it with others!

1337 Local CTF: July pool 2024 — Dangling Git Commits
https://achux21.github.io/posts/1337-local-ctf-july-pool-2024/
Author
ACHUX21
Published at
2026-06-27
License
CC BY-NC-SA 4.0
Profile Image of the Author
ACHUX21
CTF player & security researcher
Notice
CTF writeups and security research. New posts coming soon.
Music
Cover

Music

No playing

0:00 0:00
No lyrics available
Categories
Tags
Site Statistics
Posts
28
Categories
3
Tags
81
Total Words
26,137
Running Days
0 days
Last Activity
0 days ago

Table of Contents