Skip to main content

Commitment Issues

  • Description: I accidentally wrote the flag down. Good thing I deleted it!
  • Difficulty: Easy

🔎 Solution

Upon discovering the .git directory, we can infer that this is a Git repository. Running the git log command reveals the commit history, allowing us to trace the author's actions. From the log, it appears that the author initially committed a file containing the flag. A subsequent commit seems to have modified or removed some part of that content - indicating a significant change occurred between the 2 commits.

┌──(kali㉿kali)-[~/Desktop/drop-in]
└─$ git log
commit e1237df82d2e69f62dd53279abc1c8aeb66f6d64 (HEAD -> master)
Author: picoCTF <ops@picoctf.com>
Date: Sat Mar 9 21:10:14 2024 +0000

remove sensitive info

commit 3d5ec8a26ee7b092a1760fea18f384c35e435139
Author: picoCTF <ops@picoctf.com>
Date: Sat Mar 9 21:10:14 2024 +0000

create flag

To investigate further, we use git show on the later commit. This reveals that the original flag content was deleted and replaced with the string "TOP SECRET". By analyzing the diff, we can recover the original flag that was intentionally hidden.

┌──(kali㉿kali)-[~/Desktop/drop-in]
└─$ git show
commit e1237df82d2e69f62dd53279abc1c8aeb66f6d64 (HEAD -> master)
Author: picoCTF <ops@picoctf.com>
Date: Sat Mar 9 21:10:14 2024 +0000

remove sensitive info

diff --git a/message.txt b/message.txt
index 96f7309..d552d1e 100644
--- a/message.txt
+++ b/message.txt
@@ -1 +1 @@
-picoCTF{s@n1t1z3_30e86d36}
+TOP SECRET

🚩Flag

picoCTF{s@n1t1z3_30e86d36}