Git Happens

Date: 24, May, 2021

Author: Dhilip Sanjay S


Click Herearrow-up-right to go to the TryHackMe room.

Enumeration

Nmap

nmap -sC -sV -oN nmap-initial 10.10.57.41
Nmap scan report for 10.10.57.41
Host is up (0.18s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE VERSION
80/tcp open  http    nginx 1.14.0 (Ubuntu)
| http-git: 
|   10.10.57.41:80/.git/
|     Git repository found!
|_    Repository description: Unnamed repository; edit this file 'description' to name the...
|_http-server-header: nginx/1.14.0 (Ubuntu)
|_http-title: Super Awesome Site!
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Mon May 24 20:34:18 2021 -- 1 IP address (1 host up) scanned in 15.89 seconds
Git Happens - Home

Git folder

  • By running common scripts, nmap found that .git folder is being exposed.

Git Happens - .git folder

Downloading .git folder

  • Previously I used some git related tools to download the contents of .git folder.

  • But I found a fancy one liner using wget (recursive download):


Analysing Git logs

  • By seeing the logs, we find a commit which performs SHA-512 hashing and Obfuscation.


Analysing to commited code

  • Let's look through the code using git log --patch, we could find the SHA 512 hash of admin password.

  • May be if we scroll further, we can find unhashed commit too!

  • We can find the password of the admin:

Find the Super Secret Password

  • Answer: SUPER_SECRET_PASSWORD


Last updated