> 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-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf/ssrf-api-pentesting-web.md).

# SSRF em API

## [SSRF](/pt-br/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf.md):

O botão "Browse" nos permite enviar um arquivo que se espera ser uma imagem representando a capa de um livro, enquanto o campo de texto "Cover URL linked to your book" nos permite inserir uma URL para que o serviço a busque e baixe a imagem.

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

#### **Abertura** [**Burp Suite** ](https://hacking-notes-jordan.gitbook.io/notes/autres/burpsuite)**:**

Quando uma imagem é enviada para o servidor, é fornecido um link para o local de armazenamento.

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

Em seguida, realizamos um ataque de força bruta nas 65.535 portas e observamos que apenas a porta 5000 retorna uma resposta diferente.

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

Ao verificar o conteúdo da porta interna 5000, descobrimos que ela permite enviar um arquivo.

<figure><img src="/files/2454da9bea6b41978eb841619eca8b9aa3bbbee9" alt=""><figcaption></figcaption></figure>

Esse arquivo, em JSON, lista APIs internas com suas rotas associadas. Entre elas, a rota `message/authors` parece particularmente crítica.

<figure><img src="/files/6fc8dcf27bf5205c822e4856863c2658d8a69ad1" alt=""><figcaption></figcaption></figure>

Com o Burp Suite, acessamos então o arquivo pela porta 5000 no endereço abaixo:

```url
http://127.0.0.1:5000/api/latest/metadata/messages/authors

```

<figure><img src="/files/75d8275421661d214e178a000f585c08f5557c5d" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/713424b3f83a9299be0886a48a6b807e1c7382df" alt=""><figcaption></figcaption></figure>

Nesse arquivo, também encontramos um usuário e uma senha em texto simples `dev:dev080217_devAPI!@`

<figure><img src="/files/2363748b94cfbda0530065d2256854e8638932db" 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-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf/ssrf-api-pentesting-web.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.
