WriteUp

Forensics Git 1

1 分鐘
約 156 字

工具 #

過程 #

  1. 該題提供一個 .img.gz 檔,將其解壓縮後得到一個 .img 檔。
  2. Windows 可直接使用 7-Zip 解壓縮對 .img 右鍵 -> 7-Zip -> 開啟壓縮檔,然後檢查 2.img 發現 /home/ctf-player/Code/secrets/ 有個 .git

然後嘗試在 Secrets 資料夾下使用 git log

git log
commit 5fb8194539c770a830b8ba089a50778c07072b03 (HEAD -> master)
Author: ctf-player <ctf-player@example.com>
Date:   Wed Nov 19 09:20:05 2025 +0000

    Remove flag

commit 177789af0b300e043ea8f54ea57d6cee352291ae
Author: ctf-player <ctf-player@example.com>
Date:   Wed Nov 19 09:20:05 2025 +0000

    Add flag

發現曾有 commit 新增 flag,那就嘗試查看該 commit,使用 git show 177789af0b300e043ea8f54ea57d6cee352291ae 查看 flag

git show 177789af0b300e043ea8f54ea57d6cee352291ae

或是 checkout 到該 commit

git checkout 177789af0b300e043ea8f54ea57d6cee352291ae

就會發現目錄下有 flag.txt

picoCTFForensics