BlueBoy Space

picoCTF Writeup

chevron_left 回上頁

2024-07-20

[General Skills] Time Machine

題目內容

Description:
What was I last working on? I remember writing a note to help me remember...

Hint:
1. The cat command will let you read a file, but that won't help you here!
2. Read the chapter on Git from the picoPrimer here.
3. When committing a file with git, a message can (and should) be included.

解題方法

打開題目提供的資料夾 drop-in 後,會發現裡面有個 .git 的資料夾,和 message.txt 文件放在一起,這是在使用 Git 的時候會生成的、用來儲存相關資訊檔案的資料夾,而題目說他忘記上次工作到哪了,推測應該是要查日誌,所以我們可以用一些方式取得紀錄。

解法一:直接找檔案

我們可以直接在 .git 資料夾裡面找到 logs 的資料夾,直接打開裡面的 HEAD 檔案,或者接續點進 refs 、 heads 兩個資料夾,打開 master 檔案,都能得到 flag。

解法二:使用 git bash

我們需要先下載 git 這個工具,然後在 drop-in 資料夾中右鍵開啟 git bash ,輸入 git log 命令來取得我們的日誌,這樣就可以得到 flag。

git bash

解法三:使用 git GUI

這個解法同樣需要下載 git 這個工具,然後在 drop-in 資料夾中右鍵開啟 git GUI ,在選單點選 Repository ,選擇 Visualize master's History 或 Visualize All Branch History 都可以得到 flag。

git GUI

相關連結

Git 下載