[picoCTF] Time Machine

Description

What was I last working on? I remember writing a note to help me remember… You can download the challenge files here: challenge.zip


First, let’s download the provided .zip file on our terminal by running the following command:

wget https://artifacts.picoctf.net/c_titan/160/challenge.zip

1leewookb-picoctf@webshell:~$ ls
2README.txt  challenge.zip

Let’s unzip the downloaded file by running the following command:

unzip challenge.zip

 1eewookb-picoctf@webshell:~$ unzip challenge.zip
 2Archive:  challenge.zip
 3   creating: drop-in/
 4  inflating: drop-in/message.txt
 5   creating: drop-in/.git/
 6   creating: drop-in/.git/branches/
 7  inflating: drop-in/.git/description
 8   creating: drop-in/.git/hooks/
 9  inflating: drop-in/.git/hooks/applypatch-msg.sample
10  inflating: drop-in/.git/hooks/commit-msg.sample
11  inflating: drop-in/.git/hooks/fsmonitor-watchman.sample
12  inflating: drop-in/.git/hooks/post-update.sample
13  inflating: drop-in/.git/hooks/pre-applypatch.sample
14  inflating: drop-in/.git/hooks/pre-commit.sample
15  inflating: drop-in/.git/hooks/pre-merge-commit.sample
16  inflating: drop-in/.git/hooks/pre-push.sample
17  inflating: drop-in/.git/hooks/pre-rebase.sample
18  inflating: drop-in/.git/hooks/pre-receive.sample
19  inflating: drop-in/.git/hooks/prepare-commit-msg.sample
20  inflating: drop-in/.git/hooks/update.sample
21   creating: drop-in/.git/info/
22  inflating: drop-in/.git/info/exclude
23   creating: drop-in/.git/refs/
24   creating: drop-in/.git/refs/heads/
25 extracting: drop-in/.git/refs/heads/master
26   creating: drop-in/.git/refs/tags/
27 extracting: drop-in/.git/HEAD
28  inflating: drop-in/.git/config
29   creating: drop-in/.git/objects/
30   creating: drop-in/.git/objects/pack/
31   creating: drop-in/.git/objects/info/
32   creating: drop-in/.git/objects/43/
33 extracting: drop-in/.git/objects/43/246218ab4fc7b30e9a9dff073e012316851469
34   creating: drop-in/.git/objects/25/
35 extracting: drop-in/.git/objects/25/16effb8d70e33bdd0023629b164a77225e1ec2
36   creating: drop-in/.git/objects/89/
37 extracting: drop-in/.git/objects/89/d296ef533525a1378529be66b22d6a2c01e530
38  inflating: drop-in/.git/index
39 extracting: drop-in/.git/COMMIT_EDITMSG
40   creating: drop-in/.git/logs/
41  inflating: drop-in/.git/logs/HEAD
42   creating: drop-in/.git/logs/refs/
43   creating: drop-in/.git/logs/refs/heads/
44  inflating: drop-in/.git/logs/refs/heads/master
45leewookb-picoctf@webshell:~$ ls
46README.txt  challenge.zip  drop-in

Inside the drop-in folder, we have one file, message.txt

1leewookb-picoctf@webshell:~$ cd drop-in
2leewookb-picoctf@webshell:~/drop-in$ ls
3message.txt
4leewookb-picoctf@webshell:~/drop-in$ cat message.txt
5This is what I was working on, but I'd need to look at my commit history to know why...

The file didn’t include the flag, we were looking for. Let’s run ls -la command to reveal all the hidden files.

 1leewookb-picoctf@webshell:~/drop-in$ ls -la
 2total 4
 3drwxr-xr-x 3 leewookb-picoctf leewookb-picoctf  37 Mar 12 00:07 .
 4drwxr-xr-x 4 leewookb-picoctf leewookb-picoctf 185 Jul  7 05:04 ..
 5drwxr-xr-x 8 leewookb-picoctf leewookb-picoctf 166 Mar 12 00:07 .git
 6-rw-r--r-- 1 leewookb-picoctf leewookb-picoctf  87 Mar 12 00:07 message.txt
 7leewookb-picoctf@webshell:~/drop-in$ cd .git
 8leewookb-picoctf@webshell:~/drop-in/.git$ ls
 9COMMIT_EDITMSG  HEAD  branches  config  description  hooks  index  info  logs  objects  refs
10leewookb-picoctf@webshell:~/drop-in/.git$ cat COMMIT_EDITMSG
11picoCTF{t1m3m@ch1n3_186cd7d7}

flag: picoCTF{t1m3m@ch1n3_186cd7d7}

#picoCTF