> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/pt-br/web/information-disclosure/information-disclosure-via-version-control-history.md).

# Divulgação de informações via histórico de controle de versão

### Divulgação de Informações no Histórico de Controle de Versão

**Descrição do laboratório**

Este laboratório expõe informações sensíveis por meio do histórico de um repositório de controle de versão. / O objetivo é recuperar a senha do usuário **administrador**, depois fazer login com essa conta para excluir o usuário **carlos**.

**Análise inicial**

Ao explorar a aplicação, vemos a presença de um diretório **`.git`** acessível diretamente pelo servidor web.

<figure><img src="/files/82e00e8a0d948be548a3d4014407a5949d8d80af" alt=""><figcaption></figcaption></figure>

Isso indica que o repositório Git completo está exibido publicamente, podendo permitir a recuperação do código-fonte e do histórico das alterações.

**Exploração**

**Extração do Repositório Git**/ A ferramenta git-dumper é usada para baixar o conteúdo do `.git` diretório:

```bash
git-dumper https://0a7800030384626580b39ee5001e00b1.web-security-academy.net/.git .git
```

<figure><img src="/files/36f9b70cfd8dbe48554ae0f092de77f10c27371c" alt=""><figcaption></figcaption></figure>

**Análise do histórico de commits**/ Uma vez que o repositório tenha sido reconstruído localmente, o histórico do commit é consultado:

```bash
git log
```

A análise revela que um commit contém a remoção de uma senha de administrador.

<figure><img src="/files/49294278302d0fe9a41378359839758db32394b0" alt=""><figcaption></figcaption></figure>

**Inspeção das diferenças**/ O conteúdo exato deste commit é revisado para identificar a informação excluída:

```bash
git log -p ab875bcd9cf3ea84ad6af9471521aea4c3a1852d
```

As diferenças exibidas permitem encontrar a senha do usuário **administrador**.

* q0b3xu3ko6pqcqdjofrq

<figure><img src="/files/a2beb5806a639a0905b93c1d47b8eaacde425548" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/pt-br/web/information-disclosure/information-disclosure-via-version-control-history.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
