# Git Happens

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-Mdn8gvYpGq74Il5sUKt%2Fimage.png?alt=media\&token=f80fdb17-dd4a-486a-9e96-6f16758a7b24)

## Scanning

Lets run scans to find open ports and services

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-Mdn9hq72ojnS0MsrkOI%2Fimage.png?alt=media\&token=6cad8122-7e64-402f-9e6a-51c4951f7015)

## Enumeration&#x20;

Lets check the webserver out.

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-Mdn9nv4O7ZYcR636TCI%2Fimage.png?alt=media\&token=c0d7301e-e968-434c-b29c-26bef26de3e1)

We have a login page. In the nmap scan we found the `/.git/` directory, lets check it out.

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-MdnA-SNlY0Xrau-LMA-%2Fimage.png?alt=media\&token=b13ca071-92c5-4ff7-80d1-7295fb2bfa2f)

We have a bunch of directories.

Now we can manually look at all the directories, or we can use a tool called `GitTools`. Lets download it.

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-MdnAq45fQ9pBor2Q4e7%2Fimage.png?alt=media\&token=57e18cba-4ba8-4e51-9374-e8613fe4c482)

Now lets download the directories onto out machine and call it `clone`.

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-MdnBK1m-_TnzXmOeSgH%2Fimage.png?alt=media\&token=b7c8b334-5cb5-4d2d-816e-d3530928154e)

Now we can see all the directories on our machine

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-MdnBYGRw2z48Cicmn_5%2Fimage.png?alt=media\&token=0657ed3e-a193-4d85-8c45-d3ffa5ba3581)

Here, lets look at the logs as they are the most interesting

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-MdnC6k30lJaU8KPZyfr%2Fimage.png?alt=media\&token=60f92d56-0849-4702-afd2-cf7e566a5472)

Looking at all of them , the highlighted one is the most interesting as it might show us interesting information about the login page. Lets look at it in more detail

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-MdnDG2vcGdc1WeQwvpv%2Fimage.png?alt=media\&token=59cef4c6-d80a-4d15-b8fb-243af9db59f8)

Scrolling to the end of the file, we find the flag.

![](https://1569822153-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_-L-NUkJ1mxbddZG2%2F-Mdn6KbjtG-OC78FlbA6%2F-MdnDClsfvP0nDRaHFqR%2Fimage.png?alt=media\&token=3dddb2dd-45a3-4a48-ace1-004e8c0e7160)
