π₯SeImpersonate & SeAssignPrimaryToken
π― Overview
π Token Impersonation Fundamentals
Access Token Concepts
Key Privileges
SeImpersonatePrivilege # Impersonate client after authentication
SeAssignPrimaryTokenPrivilege # Replace process level tokenπ₯ Potato Attack Family
Attack Mechanism
JuicyPotato - Legacy Systems
Prerequisites
Basic Usage
PrintSpoofer - Modern Systems
Advantages
Usage Examples
RoguePotato - Alternative Approach
π» Practical Exploitation Scenario
SQL Server Service Account Compromise
Initial Access via MSSQL
Privilege Assessment
JuicyPotato Exploitation
PrintSpoofer Alternative
Verification
π οΈ Tool Comparison
Tool
OS Support
Method
Reliability
π― HTB Academy Lab Solution
Lab Environment
Detailed Step-by-Step Solution
1. Initial Connection with MSSQL
2. Enable xp_cmdshell for Command Execution
3. Enumerate Privileges - Key Step!
4. Set Up Reverse Shell Listener (New Terminal)
5. Execute PrintSpoofer Privilege Escalation
6. Receive SYSTEM Shell
7. Verify SYSTEM Access & Retrieve Flag
Alternative Methods
Using JuicyPotato (for older systems)
Key Success Indicators
Troubleshooting Common Issues
If PrintSpoofer Fails:
If Connection Issues:
If Tools Not Present:
π Detection Indicators
Process Behavior
Event Logs
π‘οΈ Defense Strategies
Privilege Hardening
Detection Rules
π SeImpersonate Exploitation Checklist
Prerequisites
Execution Steps
Post-Exploitation
π‘ Key Takeaways
Last updated