> 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/source-code-disclosure-via-backup-files.md).

# Divulgação de Código-Fonte via Arquivos de Backup

### Divulgação do código-fonte por meio de arquivos de backup

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

Este laboratório expõe o código-fonte da aplicação por meio de **arquivos de backup** armazenados em um diretório oculto. / O objetivo é identificar e enviar a **senha do banco de dados**, que está codificada no código-fonte divulgado.

**Etapas da operação**

**Descoberta de conteúdo**/ Usando **Burp Suite** (função Descobrir Conteúdo), analisamos os caminhos acessíveis da aplicação.

<figure><img src="/files/95256acb18f83d7833f91e5704b090984bb5c6ec" alt=""><figcaption></figcaption></figure>

**Identificação de um diretório sensível**/ A análise revela a existência de um diretório oculto chamado **backup**.

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

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

**Acesso a arquivos de backup**/ Neste diretório, um arquivo de backup com a extensão `.bk` está acessível. / Ele contém \*\*código Java\*\* explicado.

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

**Análise do código divulgado**/ O arquivo revela informações de login para um **PostgreSQL** banco de dados, com credenciais codificadas no código.

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

```java
        ConnectionBuilder connectionBuilder = ConnectionBuilder.from(
                "org.postgresql.Driver",
                "postgresql",
                "localhost",
                5432,
                "postgres",
                "postgres",
                "eq77s9j4j4sa5a3m9iymzi9e2m8e68sj"
        ).withAutoCommit();
```


---

# 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/source-code-disclosure-via-backup-files.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.
