SlideShare a Scribd company logo
Practical Windows Privilege
Escalation
Andrew Smith
C:>type disclaimer.txt
•The opinions expressed in this
presentation are mine and not
those of my employer.
C:>whoami /all
•Andrew Smith
•@jakx_
•Penetration Tester
•OWASP
•Metasploit
•CTF
•Certs
C:>whois you
What are you talking about?
•Relevant Windows Security Info
•PrivEsc tricks win7
•Limited user -> Local Admin
Why should I care?
•You wanna level up
•You wanna prevent level up
•Hack the planet!
•You like Mario?
Why should I care?
•"People designing defenses who have
never had them evaluated by a good
attacker is kind of like learning one of
those martial arts that look more like
dancing than fighting. They look nice,
but when you get into a fight your
dance kungfu isn’t going to help you
not get your ass kicked."
-Dan Guido
Windows Access Control
*https://msdn.microsoft.com/en-
us/library/windows/desktop/aa379557%28v=vs.85%29.aspx
•Securable Objects
•Files
•Directories
•Services
•Registry Keys
•Named Pipes
Windows Access Control
*https://msdn.microsoft.com/en-
us/library/windows/desktop/aa379563%28v=vs.85%29.aspx
•Security Descriptor
•Discretionary Access Control List
(DACL)
•Access Control Entries (ACE)
Windows Access Control
*https://msdn.microsoft.com/en-
us/library/windows/desktop/aa379563%28v=vs.85%29.aspx
•Access Token
•Container of user
security info
•SID, groups,
privileges
•Tied to process or
thread
Windows Access Control
Windows Access Control
Access
Token
Windows Access Control
Access
Token
DACL
Windows Access Control
Access
Token
DACL
AccessChk
Mandatory Integrity Control
*https://msdn.microsoft.com/en-us/library/bb625963.aspx
•Security feature post-Vista
•Assigns process Integrity Levels
•Indicates “trustworthiness” of
object
Windows Integrity Levels
*Windows® Internals: Including Windows Server 2008 and
Windows Vista, Fifth Edition
Windows Integrity Levels
Low Medium High SYSTEM
*https://msdn.microsoft.com/en-us/library/bb625963.aspx
Windows Integrity Levels
*https://msdn.microsoft.com/en-us/library/bb625963.aspx
Low Medium High SYSTEM
UAC
Just ask nicely…
The Setup…
•Land on workstation as SKYNETLuigi
via $method
•Want to escalate privileges
•Limited User -> Local Admin
•Marketing isnt Admin… right?
Time to Level Up!
•Admin somewhere else?
•Creds in files
•Exploit unpatched EoP bugs
•Exploit insecure configs/apps
•Weak Services DACLs
•Weak File DACLs
•AlwaysInstallEvelated
•DLLs
Somewhere Else?
•Luigi in “Domain Users” group
•1 box “Domain Users” in “Administrators”
Somewhere Else?
•Powerview
•https://github.com/PowerShellMafia/PowerSploit/blob/m
aster/Recon/PowerView.ps1
• Find-LocalAdminAccess
Somewhere Else?
Creds in Files
•C:usersluigiDesktoppasswords.xls
•C:>dir /b /s web.config
•C:>dir /b /s unattend.xml
•C:>dir /b /s sysprep.inf
•C:>dir /b /s sysprep.xml
•C:>dir /b /s *pass*
•GPP
•mushroomkindgomSYSVOL????
Windows EoP Buggzz
•Enumerate missing patches
•post/windows/gather/enum_patches
•post/multi/recon/local_exploit_suggester
•Pwn
Windows EoP Buggzz
•MS13-053
Weak Service Permissions
Accesschk.exe –qwcu “Authenticated Users” *
Accesschk.exe –qwcu “Users” *
Accesschk.exe –qwcu “Everyone” *
Weak Service Permissions
•Can we edit the service config?
•Can we edit the binary it points to?
Weak Service Permissions
•Demo
Weak File Permissions
•Look for writeable files
•Autoruns?
•Scheduled Tasks?
Accesschk.exe –qwsu “Authenticated Users” c:
Accesschk.exe –qwsu “Users” c:
Accesschk.exe –qwsu “Everyone” c:
Weak File Permissions
•Story time
Weak File Permissions
•Story time
•Main app binary writeable “users”
Weak File Permissions
•Story time
•Main app binary writeable “users”
•Autorun on login
Weak File Permissions
Weak File Permissions
• “Nah bro, UAC”
Weak File Permissions
• Admin logs in
Weak File Permissions
• Admin logs in
• Backdoored binary auto-executes
Weak File Permissions
• Admin logs in
• Backdoored binary auto-executes
• Code execution at medium IL as admin
(UAC)
Weak File Permissions
•“One important thing to know is that UAC is
not a security boundary.”
*https://blogs.msdn.microsoft.com/e7/2009/02/05/upda
te-on-uac/
AlwaysInstallElevated
•Group policy setting that makes installing
packages (.msi) convenient…
•..Any .msi…
•for everyone..
AlwaysInstallElevated
reg query
HKLMSOFTWAREPoliciesMicrosoft
WindowsInstaller /v
AlwaysInstallElevated
reg query
HKCUSOFTWAREPoliciesMicrosoft
WindowsInstaller /v
AlwaysInstallElevated
AlwaysInstallElevated
•Demo
DLL Hijacking
•Windows can dynamically load DLLs
•If full path not used/missing, Windows
executes DLL Search Order
•Eg.
•LoadLibrary(“ohnoes.dll”)
vs
•LoadLibrary(“c:program filesohnoes.dll”)
DLL Hijacking
1. The directory from which the application
loaded.
2. The system directory.
3. The 16-bit system directory.
4. The Windows directory.
5. The current directory.
6. The directories listed in the PATH
environment variable.
*https://msdn.microsoft.com/en-
us/library/windows/desktop/ms682586%28v=vs.85%29.aspx
DLL Hijacking
1. The directory from which the application
loaded.
2. The system directory.
3. The 16-bit system directory.
4. The Windows directory.
5. The current directory. (Exploitable)
6. The directories listed in the PATH
environment variable. (Exploitable)
*https://msdn.microsoft.com/en-
us/library/windows/desktop/ms682586%28v=vs.85%29.aspx
DLL Hijacking
•Privileged app loads missing DLL +
controllable search path element = pwned
•Use Sysinternals Procmon
•Include “.dll”
•Include “NAME NOT FOUND”
•Include folder in path
DLL Hijacking
•Demo
Conclusions
•Know your network/apps
•Don’t run as admin
•UAC IS NOT A SECURITY BOUNDARY
•Patch your shit
•“Hack yourself first”
Tools
•Powerup
•https://github.com/PowerShellMafia/PowerSploit/blob/master/Priv
esc/PowerUp.ps1
•Windows-privesc-check
•https://github.com/pentestmonkey/windows-privesc-check
•Sysinternals Suite
•https://technet.microsoft.com/en-us/sysinternals/bb545021.aspx
References/Resources
https://www.insomniasec.com/downloads/publications/WindowsPrivEsc.ppt
https://labs.mwrinfosecurity.com/system/assets/760/original/Windows_Service
s_-_All_roads_lead_to_SYSTEM.pdf
https://technet.microsoft.com/en-us/sysinternals/bb545027
http://www.greyhathacker.net/?p=738
Greyhat Hacking 4th edition
Windows Internals 6th edition
https://github.com/PowerShellEmpire/PowerTools/tree/master/PowerUp
http://www.slideshare.net/mubix/windows-attacks-at-is-the-new-black-
26665607
Questions?
@jakx_
ajs@swordshield.com

More Related Content

PDF
Oscp preparation
PDF
How fun of privilege escalation Red Pill2017
PPTX
Windows privilege escalation by Dhruv Shah
PDF
Hunting for Privilege Escalation in Windows Environment
PPTX
Linux privilege escalation
PDF
Privilege escalation from 1 to 0 Workshop
PPTX
Secure Coding 101 - OWASP University of Ottawa Workshop
PPT
Hacking web applications
Oscp preparation
How fun of privilege escalation Red Pill2017
Windows privilege escalation by Dhruv Shah
Hunting for Privilege Escalation in Windows Environment
Linux privilege escalation
Privilege escalation from 1 to 0 Workshop
Secure Coding 101 - OWASP University of Ottawa Workshop
Hacking web applications

What's hot (20)

PDF
Web App Security Presentation by Ryan Holland - 05-31-2017
PPTX
Ethical Hacking n VAPT presentation by Suvrat jain
PPTX
VAPT PRESENTATION full.pptx
PDF
Sql Injection - Vulnerability and Security
PPTX
Metasploit
PPTX
WTF is Penetration Testing v.2
PDF
aclpwn - Active Directory ACL exploitation with BloodHound
PDF
Welcome to the Jungle: Pentesting AWS
PPTX
Introduction to Malware Analysis
PPTX
PDF
Breach and attack simulation tools
PDF
Sigma and YARA Rules
PPTX
Six Degrees of Domain Admin - BloodHound at DEF CON 24
PDF
Hunting Lateral Movement in Windows Infrastructure
PPTX
Catch Me If You Can: PowerShell Red vs Blue
PPTX
OWASP Top 10 2021 Presentation (Jul 2022)
PDF
Web application security & Testing
PPTX
Linux privilege escalation 101
PPT
Introduction To OWASP
PDF
PHDays 2018 Threat Hunting Hands-On Lab
Web App Security Presentation by Ryan Holland - 05-31-2017
Ethical Hacking n VAPT presentation by Suvrat jain
VAPT PRESENTATION full.pptx
Sql Injection - Vulnerability and Security
Metasploit
WTF is Penetration Testing v.2
aclpwn - Active Directory ACL exploitation with BloodHound
Welcome to the Jungle: Pentesting AWS
Introduction to Malware Analysis
Breach and attack simulation tools
Sigma and YARA Rules
Six Degrees of Domain Admin - BloodHound at DEF CON 24
Hunting Lateral Movement in Windows Infrastructure
Catch Me If You Can: PowerShell Red vs Blue
OWASP Top 10 2021 Presentation (Jul 2022)
Web application security & Testing
Linux privilege escalation 101
Introduction To OWASP
PHDays 2018 Threat Hunting Hands-On Lab
Ad

Viewers also liked (20)

PPTX
Fundamentals of Linux Privilege Escalation
PDF
From zero to SYSTEM on full disk encrypted windows system
PPTX
An Introduction to Sysinternals
PDF
Prepare Yourself to Become Infosec Professional
PDF
My pwk & oscp journey
PDF
Esoteric xss payloads
PPTX
4 Ways to Make UAC Less Annoying on Windows 7 / Vista
PPSX
PPTX
Windows Privilege Escalation
PDF
OPS2016 ja ohjelmointi
PPTX
Programación dinámica
PPT
Privilege Escalation And Misconfigurations Part2
PPT
Privilege Escalation And Misconfigurations
PDF
Attacking Windows Authentication and BitLocker Full Disk Encryption
PDF
Disruptive Innovations 2014 / CITI
PDF
CMS Hacking Tricks - DerbyCon 4 - 2014
PPT
Maximum clique detection algorithm
PDF
Social Engineering the Windows Kernel by James Forshaw
PDF
44CON 2014 - Simple Hardware Sidechannel Attacks for 10 GBP or Less, Joe Fitz...
PPTX
DBSCAN (2014_11_25 06_21_12 UTC)
Fundamentals of Linux Privilege Escalation
From zero to SYSTEM on full disk encrypted windows system
An Introduction to Sysinternals
Prepare Yourself to Become Infosec Professional
My pwk & oscp journey
Esoteric xss payloads
4 Ways to Make UAC Less Annoying on Windows 7 / Vista
Windows Privilege Escalation
OPS2016 ja ohjelmointi
Programación dinámica
Privilege Escalation And Misconfigurations Part2
Privilege Escalation And Misconfigurations
Attacking Windows Authentication and BitLocker Full Disk Encryption
Disruptive Innovations 2014 / CITI
CMS Hacking Tricks - DerbyCon 4 - 2014
Maximum clique detection algorithm
Social Engineering the Windows Kernel by James Forshaw
44CON 2014 - Simple Hardware Sidechannel Attacks for 10 GBP or Less, Joe Fitz...
DBSCAN (2014_11_25 06_21_12 UTC)
Ad

Similar to Level Up! - Practical Windows Privilege Escalation (20)

PDF
Testing UAC on Windows 10
PPTX
Windows advanced
PPTX
Wcl310 Raiders of the Elevated Token
PPTX
Windows privilege escalation
PDF
Windows Attacks AT is the new black
PDF
Windows attacks - AT is the new black
PPTX
Windows Client Privilege Escalation-Shared.pptx
PPTX
Not a Security Boundary: Bypassing User Account Control
PPTX
RACE - Minimal Rights and ACE for Active Directory Dominance
PPTX
Privileged file operations_bug_on_windows
PPT
Dominique
PDF
Windows Security Internals 1 / converted Edition James Forshaw
DOCX
The license associated with the Belarc Advisor product allows
PPTX
Windows 7 Application Compatibility
PDF
Windows Security Internals: A Deep Dive into Windows Authentication, Authoriz...
PDF
Win32 Introduction To Perl And Vista S Feature User Acceptance Control
PPTX
Windows Privilege Escalation Techniques.pptx
PPTX
Securing Windows with Group Policy
PPTX
Best free tools for win database admin
PPTX
Best free tools for w d a
Testing UAC on Windows 10
Windows advanced
Wcl310 Raiders of the Elevated Token
Windows privilege escalation
Windows Attacks AT is the new black
Windows attacks - AT is the new black
Windows Client Privilege Escalation-Shared.pptx
Not a Security Boundary: Bypassing User Account Control
RACE - Minimal Rights and ACE for Active Directory Dominance
Privileged file operations_bug_on_windows
Dominique
Windows Security Internals 1 / converted Edition James Forshaw
The license associated with the Belarc Advisor product allows
Windows 7 Application Compatibility
Windows Security Internals: A Deep Dive into Windows Authentication, Authoriz...
Win32 Introduction To Perl And Vista S Feature User Acceptance Control
Windows Privilege Escalation Techniques.pptx
Securing Windows with Group Policy
Best free tools for win database admin
Best free tools for w d a

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PDF
KodekX | Application Modernization Development
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Modernizing your data center with Dell and AMD
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Cloud computing and distributed systems.
PPTX
A Presentation on Artificial Intelligence
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation theory and applications.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
KodekX | Application Modernization Development
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
Modernizing your data center with Dell and AMD
NewMind AI Monthly Chronicles - July 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Cloud computing and distributed systems.
A Presentation on Artificial Intelligence
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Level Up! - Practical Windows Privilege Escalation