Post

GlacierCTF – GetResetHard

GlacierCTF – GetResetHard

Description

  1. Kevin joined our company.
  2. Kevin took a s**t on the carpet.
  3. Kevin git reset --hard the entire repo.
  4. Kevin force pushed.
  5. Kevin left the company.

Now it’s your turn to fix the mess. You get the compressed disk with the repository.

Note: The repo is completely safe.

Downloadable file: gitresethard.tar.gz


Process

  1. Download the gitresethard.tar.gz.

  2. Extract the compressed file using the command below.
    1
    
     tar -xzvf gitresethard.tar.gz
    
  3. After decompressing the file, change the directory to gitresethard/repo.

  4. Type in the following command to reveal any hidden/dangling commits:
    1
    
     git fsck --lost-found
    

    Dangling Commit Found

  5. A hidden/dangling commit is present. Let’s see the contents using the git show command.
    1
    
     git show <dangling commit_id>
    

    Git Show Output

  6. The dangling commit shows a connection using openssl and also includes a password which is being encrypted. I chose to use echo to pipe it directly. Decryption Process

  7. After running the command, we got the flag!

Flag: gctf{0113_wh0_g1t_r3s3t3d_th3_c4t_4789}


Summary

StepAction
1Extract the repo archive
2Run git fsck to detect orphaned objects
3Identify dangling commit 6a81c76e…
4View its contents with git show
5Find OpenSSL encryption clues
6Recreate decryption using echoopenssl
7Recover the flag
This post is licensed under CC BY 4.0 by the author.