---
title: "Impersonation"
date: 2024-05-07
draft: false
---


Token impersonation overview

TOKENS - Temporary keys that allow you to access system/network without providing creds every time. 
- TWO TYPES: 
	- Delegate - Created for logging into a machine, or for using RDP
	- Impersonate - "non-interactive" such as attaching a network drive or domain logon script

Looking for available tokens - use mimikatz to dump LSA hashes 

----
https://swisskyrepo.github.io/InternalAllTheThings/redteam/escalation/windows-privilege-escalation/#eop-impersonation-privileges

-- checking `whoami /priv` and what that means for you!
**FULL LIST OF PRIVS AND IF YOU CAN ESCALATE THEM** 
https://github.com/gtworek/Priv2Admin 

Potato attacks - `SeImpersonate` 
https://foxglovesecurity.com/2016/09/26/rotten-potato-privilege-escalation-from-service-accounts-to-system/

```bash
1. Trick the “NT AUTHORITY\SYSTEM” account into authenticating via NTLM to a TCP endpoint we control.
2. Man-in-the-middle this authentication attempt (NTLM relay) to locally negotiate a security token for the “NT AUTHORITY\SYSTEM” account. This is done through a series of Windows API calls.
3. Impersonate the token we have just negotiated. This can only be done if the attackers current account has the privilege to impersonate security tokens. This is usually true of most service accounts and not true of most user-level accounts.
```

https://github.com/ohpe/juicy-potato
