# Expose .git OR version control systems

{% hint style="info" %}
It should check on suspicious directory, that is used as a complete project.
{% endhint %}

## Types of version control system (VCS)

1. git
2. [SVN (Apache Subversion)](https://subversion.apache.org/)&#x20;
3. [HG (Mercurial)](https://mercurial.selenic.com/)
4. [Bazaar](http://bazaar.canonical.com/en/)
5. [CVS (Concurrent Versions System)](http://savannah.nongnu.org/projects/cvs)
6. [BitKeeper](http://www.bitkeeper.com/)

## For GIT

{% hint style="info" %}
if directory listing enabled then check    .git&#x20;

otherwise,

try some default file for confirmation. such as&#x20;

.git/config

.git/refs/heads/master
{% endhint %}

### Objects in git

* Blob - The actual data (e.g. sourcecode)
* Tree - Grouping blobs together
* Commit - A specific state of a tree with more meta information (e.g. author/date/message)

### Structure of .git file

* HEAD
* objects/info/packs
* description
* config
* COMMIT\_EDITMSG
* index               //contains all file name  in a repository. to list this first **`git init`**  then **`git ls-files --stage`**
* packed-refs
* refs/heads/master
* refs/remotes/origin/HEAD
* refs/stash
* logs/HEAD
* logs/refs/heads/master
* logs/refs/remotes/origin/HEAD
* info/refs
* info/exclude

### Unpacking git object:

```
git unpack-objects -r < .git/objects/pack/pack-e38660e6be24bb79d8d929ddea3d194e0dd3cd13.pack
```

## Tools

1. goop                                //<https://github.com/nyancrimew/goop>
2. [GitHack](https://github.com/captain-noob/GitHack)&#x20;
3. &#x20;[GitHacker](https://github.com/captain-noob/GitHacker)                             //<https://github.com/WangYihang/GitHacker>
4. [GitTools](https://github.com/internetwache/GitTools)        &#x20;

## Useful git command for sensitive data export.

**1.Restore full repository from .git file:**

```bash
git reset --hard
git restore filename            #used for specific file
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shahidulandshamim.gitbook.io/web-application/scanning-and-uncategorized-items/expose-.git-or-version-control-systems.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
