SlideShare a Scribd company logo
#CyberCamp17
Testing UAC on
Windows 10
Ernesto Fernández
C:> whoami
2
Ernesto Fernández Provecho – L3cr0f
q Linkedin – www.linkedin.com/in/ernesto-fernandez-provecho/
q Github – github.com/L3cr0f
q Email – ernesto.fernpro@gmail.com
What Is User Account Control
(UAC) and How Does It
Work?
3
UAC
4
UAC
5
Mechanism to prevent malware execution at high integrity
level without user permission.
How?
Consent Prompt
UAC
6
It supports different "security" levels. The highest one
prevents many of bypass UAC attacks, whereas the lowest
one disables UAC.
Bypass UAC Attacks
7
UAC Bypass
8
Attack consisting in execute code with administrator rights
without prompting the user for consent on Windows
systems. Some requirements must be met in most cases:
q Vulnerable auto-elevate process.
q The user belongs to the Administrators group.
q The UAC security level is not set to "Always Notify".
Attacker Administrator Shell
UAC
9
10
11
12
13
14
15
16
17
UAC Bypass Methods
18
GUI Misusing
COM Interface Elevation
DLL Hijacking
19
The most common way to perform a bypass UAC attack. It
works thanks to the way DLLs are loaded in Windows systems
by some auto-elevate processes, since they do not found a
specific DLL at first trial, allowing an attacker to trick them by
loading a malicious DLL instead of the legit one.
q IFileOperation
q WUSA
q Environment variables expansion
q Race condition
q UIPI bypass
q COM handler hijacking
q NTFS reparse point
DLL Hijacking - IFileOperation
20
Invoke
IFileOperation
Masquerade
PEB
Process
Injection
Copy the
malicious DLL
to the targeted
location
Windows Trusted
Certificate Process
Execute auto-
elevate process
DLL Hijacking - WUSA
21
Copy the
malicious DLL
to the targeted
location
WUSA Extract
Functionality
Execute auto-
elevate process
Windows Update Standalone Installer (WUSA) runs at high
integrity.
Compress the
malicious DLL
into a CAB file
DLL Hijacking - WUSA
22
Copy the
malicious DLL
to the targeted
location
WUSA Extract
Functionality
Execute auto-
elevate process
Windows Update Standalone Installer (WUSA) runs at high
integrity.
Compress the
malicious DLL
into a CAB file
DLL Hijacking – UIPI Bypass
23
Inject
IFileOperation
DLL
hijacking
Copy to a
"secure"
path
Malicious
DLL
Execute
High
integrity
application
Process
Injection
Execute auto-
elevate process
Windows Trusted
Certificate Process
User Interface Privilege Isolation (UIPI) prevents lower
integrity processes from sending "messages" to higher
integrity processes.
DLL Hijacking – Environment Variable
Expansion
24
Copy the
malicious DLL
to the targeted
location
Modify the
environment
variable in the
Windows Registry
Execute auto-
elevate process
DLL Hijacking – Race Condition
25
Copy the
malicious DLL
to the targeted
location
DLL hijacking
Execute auto-
elevate process
DLL Hijacking – COM Handler Hijacking
26
The value is
modified in
"HKCR:CLSID"
Modify the
"HKCU:SoftwareClassesCLSID"
with the path of the malicious DLL
Execute
auto-elevate
process
A COM handler specifies a COM object by its CLSID key from
which the process associated with it will load a DLL.
DLL Hijacking – NTFS Reparse Point
27
Create
"wusa.exe"
race condition
A reparse point is a collection of user data associated with a
file or a directory used in NTFS to implement hard links,
junctions and symbolic links.
Compress the
malicious DLL
into a CAB file
Extract the malicious
DLL to the targeted
location by means of
NTFS reparse point
Execute auto-
elevate process
COM Interface Elevation
28
In Windows, a COM interface defines a set of methods that a
COM object can invoke. The problem appears since some of
this interfaces can elevate their privileges without user consent.
Execute a method
that allows us to
execute code
Find an
elevated COM
interface
Run the selected
method
Application Compatibility Exploiting
29
Abuses the way Application Compatibility (AppCompat) works
by creating a shim (file that contains the details on how
Windows should manipulate an antiquated program to execute
it properly) for an auto-elevate application that forces it to
load a malicious binary - CVE-2015-0002.
Auto-elevate
application
Malicious
binary
Malicious shim
file
Application Compatibility Exploiting
30
Abuses the way Application Compatibility (AppCompat) works
by creating a shim (file that contains the details on how
Windows should manipulate an antiquated program to execute
it properly) for an auto-elevate application that forces it to
load a malicious binary - CVE-2015-0002.
Auto-elevate
application
Malicious
binary
Malicious shim
file
Shell API
31
This method abuses the way some auto-elevate applications
use the shell API of Windows to execute its own commands.
Environment variables expansion Registry manipulation
Execute
command
Modify the
Windows
Registry
Token Impersonation
32
Abuse
QueryLimitedInformation
access right to get
Impersonate and
Duplicate rights
Check the rights
of "mmc.exe"
(high integrity
process)
Copy the high
integrity token
with Duplicate
right
Misuses the way tokens and their grants works in Windows
systems. The following scheme explains the James Forshaw
implementation.
Modify the
copied token
Impersonate the
copied token using
Impersonate right
Token Impersonation
33
Abuse
QueryLimitedInformation
access right to get
Impersonate and
Duplicate rights
Check the rights
of "mmc.exe"
(high integrity
process)
Copy the high
integrity token
with Duplicate
right
Misuses the way tokens and their grants works in Windows
systems. The following scheme explains the James Forshaw
implementation.
Modify the
copied token
Impersonate the
copied token using
Impersonate right
GUI Misusing
34
The way such UAC
bypass is performed is
taking advantage of the
way these processes use
the "FileDialog"
component, since you
can "right-click" with the
mouse on other
application and point
out the "Run as
administrator" option,
no UAC prompt will be
displayed.
Development of a New
Bypass UAC
35
Vulnerability Search
36
Auto-elevate processes
We checked the
different processes which
have the feature
"autoElevate" enabled
by means of Strings. We
found an interesting one,
"dccw.exe".
Vulnerability Search
37
dccw.exe execution
flow analysis
Using Process Monitor
we find out that
"dccw.exe" would be
vulnerable to a DLL
hijacking due to how
"WinSxS" is managed.
Vulnerability Verification
38
dccw.exe DLL hijacking
confirmation
We created the folders
that were looked for
unsuccessfully by
"dccw.exe". When it
was executed again, an
error was presented.
Vulnerability Verification
39
dccw.exe DLL hijacking
confirmation
We created the folders
that were looked for
unsuccessfully by
"dccw.exe". When it
was executed again, an
error was presented.
Exploit Development
40
Malicious DLL
To execute code ("cmd.exe")
at high integrity we need to
craft a DLL to be loaded
when "dccw.exe" will be
executed. This DLL needs to
export some functions from
the legit "GdiPlus.dll" loaded
by "dccw.exe".
The DLL is compressed and
base64 encoded in the
code.
Interoperabiltiy
To allow the C++ PoC
execution in Windows x86
and Windows x64, the
binary and the DLL have
been developed for x86
systems.
Exploit Development
41
Initial Checks
q Build version.
q Administrator rights.
q Administrators group.
q UAC security level.
Create Temporary Elements
In the same directory of the PoC:
1. Create the folder "dccw.exe.Local".
2. Create the folders that match with the
"x86_microsoft.windows.gdiplus_*"
pattern in the "WinSxS" folder into
the folder created in step 1.
3. Drop the malicious DLL into the
folders created in step 2.
Exploit Development
C++ - Masquerade PEB
Modify the Process Environment
Block (PEB) due to COM
objects rely on PSAPI, which
parses the PEB, to identify the
process from which they have
been invoked. The resultant PEB
will look like the one of a
Microsoft signed application
(e.g. "explorer.exe").
Trick the system to invoke IFileOperation at high integrity.
Metasploit - Process Injection
Inject a malicious DLL into a
Microsoft signed application
(e.g. "notepad.exe") and
execute it.
Exploit Development
43
Invoke IFileOperation
Copy the previously created "dccw.exe.Local" and the elements
contained in it to the vulnerable location.
dccw.exe.Local
WindowsSystem32
WindowsSysWOW64
Exploit Development
44
Execute "dccw.exe"
The DLL hijacking is
performed and "cmd.exe" is
executed with administrator
rights.
Remove Traces
All created files and folders are
deleted from the computer to
stay undetected.
Exploit Development
45
Initial Checks
Masquerade
PEB / Process
Injection
Execute
dccw.exe
Administrators
Group
Administrator
Rights
Build Version
UAC Settings
Invoke
IFileOperation
Create
Temporary
Elements
WinSxS folders with
"x86_microsoft.windo
ws.gdiplus_*" pattern
Drop the
malicious DLL to
those folders
Copy
temporary
files to DLL
hijacking
path
Execute code at
high integrity
Remove
Traces
Proof of Concept (PoC) Time!
46
Requirements
47
C++
q The target must be a
Windows 8 or 10.
q The UAC level must not be
set to "Always notify".
q The compromised user must
belong to the "Administrators
group".
Metasploit
q The target must be a Windows
8 or 10.
q The UAC level must not be set to
"Always notify".
q The compromised user must
belong to the "Administrators
group".
q Having a Meterpreter session.
q The TARGET option must match
the processor architecture of the
victim.
C++ PoC - Windows 10 x64 14393
48
github.com/L3cr0f/DccwBypassUAC
Metasploit Module - Windows 10 x86 15063
49
www.rapid7.com/db/modules/exploit/windows/local/bypassuac_injection_winsxs
Microsoft Position
50
51
"A weakness that would allow to bypass
the 'Consent Prompt' is not considered a
security vulnerability, since that is not
considered a security boundary."
But…
"User Account Control (UAC) is a
fundamental component of Microsoft's
overall security vision."
- Microsoft
Conclusions and Achievements
52
53
Conclusions
q Bypass User Account Control is not a big deal.
q Build patches are not enough.
q Microsoft should consider UAC bypasses as a vulnerability
so as to protect users.
q Nowadays, the only solution is setting up different users so
as to use the one with lowest privileges.
Achievements
q Development of a new bypass UAC method that works on
latest Windows 10 build versions.
q Development of a new Metasploit module that works on
latest Windows 10 build versions and which has being
included in the Metasploit Framework.
q This bypass UAC has been partially included in the UACME
project as the 37th method.
If you want to know more
about…
54
q DccwBypassUAC repository:
https://github.com/L3cr0f/DccwBypassUAC.
q Project paper:
https://www.researchgate.net/publication/319454675_Testing
_UAC_on_Windows_10.
q Metasploit module: https://github.com/rapid7/metasploit-
framework/blob/master/modules/exploits/windows/local/byp
assuac_injection_winsxs.rb.
q Rapid7 explanation of the Metasploit module:
https://www.rapid7.com/db/modules/exploit/windows/local/
bypassuac_injection_winsxs.
q UACME project: https://github.com/hfiref0x/UACME.
Gracias por su atención

More Related Content

What's hot

Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat Hunting
GIBIN JOHN
 
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red TeamWhat is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
MITRE ATT&CK
 
Hunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows EnvironmentHunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows Environment
Teymur Kheirkhabarov
 
BIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks UncoveredBIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks UncoveredAlex Matrosov
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
Sergey Soldatov
 
Started from the Bottom: Exploiting Data Sources to Uncover ATT&CK Behaviors
Started from the Bottom: Exploiting Data Sources to Uncover ATT&CK BehaviorsStarted from the Bottom: Exploiting Data Sources to Uncover ATT&CK Behaviors
Started from the Bottom: Exploiting Data Sources to Uncover ATT&CK Behaviors
JamieWilliams130
 
Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows Environment
Teymur Kheirkhabarov
 
Digital forensic upload
Digital forensic uploadDigital forensic upload
Digital forensic upload
Setia Juli Irzal Ismail
 
Sharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK FrameworkSharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK Framework
MITRE - ATT&CKcon
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
Daniel Bohannon
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
Stephan Borosh
 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
Splunk
 
Introduction à La Sécurité Informatique 1/2
Introduction à La Sécurité Informatique 1/2Introduction à La Sécurité Informatique 1/2
Introduction à La Sécurité Informatique 1/2
Sylvain Maret
 
Cyber threat intelligence
Cyber threat intelligenceCyber threat intelligence
Cyber threat intelligence
Mondher Smii
 
Malware Analysis Tips and Tricks.pdf
Malware Analysis Tips and Tricks.pdfMalware Analysis Tips and Tricks.pdf
Malware Analysis Tips and Tricks.pdf
Yushimon
 
PowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingPowerShell for Practical Purple Teaming
PowerShell for Practical Purple Teaming
Nikhil Mittal
 
Detection Rules Coverage
Detection Rules CoverageDetection Rules Coverage
Detection Rules Coverage
Sunny Neo
 
I Hunt Sys Admins
I Hunt Sys AdminsI Hunt Sys Admins
I Hunt Sys Admins
Will Schroeder
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
CODE BLUE
 
PIC your malware
PIC your malwarePIC your malware
PIC your malware
CODE WHITE GmbH
 

What's hot (20)

Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat Hunting
 
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red TeamWhat is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
 
Hunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows EnvironmentHunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows Environment
 
BIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks UncoveredBIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks Uncovered
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
Started from the Bottom: Exploiting Data Sources to Uncover ATT&CK Behaviors
Started from the Bottom: Exploiting Data Sources to Uncover ATT&CK BehaviorsStarted from the Bottom: Exploiting Data Sources to Uncover ATT&CK Behaviors
Started from the Bottom: Exploiting Data Sources to Uncover ATT&CK Behaviors
 
Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows Environment
 
Digital forensic upload
Digital forensic uploadDigital forensic upload
Digital forensic upload
 
Sharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK FrameworkSharpening your Threat-Hunting Program with ATTACK Framework
Sharpening your Threat-Hunting Program with ATTACK Framework
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
 
Introduction à La Sécurité Informatique 1/2
Introduction à La Sécurité Informatique 1/2Introduction à La Sécurité Informatique 1/2
Introduction à La Sécurité Informatique 1/2
 
Cyber threat intelligence
Cyber threat intelligenceCyber threat intelligence
Cyber threat intelligence
 
Malware Analysis Tips and Tricks.pdf
Malware Analysis Tips and Tricks.pdfMalware Analysis Tips and Tricks.pdf
Malware Analysis Tips and Tricks.pdf
 
PowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingPowerShell for Practical Purple Teaming
PowerShell for Practical Purple Teaming
 
Detection Rules Coverage
Detection Rules CoverageDetection Rules Coverage
Detection Rules Coverage
 
I Hunt Sys Admins
I Hunt Sys AdminsI Hunt Sys Admins
I Hunt Sys Admins
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
 
PIC your malware
PIC your malwarePIC your malware
PIC your malware
 

Similar to Testing UAC on Windows 10

Basic malware analysis
Basic malware analysis Basic malware analysis
Basic malware analysis
Cysinfo Cyber Security Community
 
Reversing & Malware Analysis Training Part 9 - Advanced Malware Analysis
Reversing & Malware Analysis Training Part 9 -  Advanced Malware AnalysisReversing & Malware Analysis Training Part 9 -  Advanced Malware Analysis
Reversing & Malware Analysis Training Part 9 - Advanced Malware Analysis
securityxploded
 
Windows 7 Application Compatibility
Windows 7 Application CompatibilityWindows 7 Application Compatibility
Windows 7 Application Compatibility
micham
 
Catching fileless attacks
Catching fileless attacksCatching fileless attacks
Catching fileless attacks
Balaji Rajasekaran
 
Black Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysisBlack Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysis
Roberto Suggi Liverani
 
Windows advanced
Windows advancedWindows advanced
Windows advanced
yarden hanan
 
Basic malware analysis
Basic malware analysisBasic malware analysis
Basic malware analysis
securityxploded
 
Malware analysis
Malware analysisMalware analysis
Malware analysisDen Iir
 
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.pptCHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
ManjuAppukuttan2
 
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHack
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHackAn inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHack
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHack
Soya Aoyama
 
Finfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn ViệtFinfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn Việt
Security Bootcamp
 
CNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware BehaviorCNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware Behavior
Sam Bowne
 
How to escalate privileges to administrator in latest Windows.
How to escalate privileges to administrator in latest Windows.How to escalate privileges to administrator in latest Windows.
How to escalate privileges to administrator in latest Windows.
Soya Aoyama
 
Crisis. advanced malware
Crisis. advanced malwareCrisis. advanced malware
Crisis. advanced malwareYury Chemerkin
 
Mitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptxMitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptx
waizuq
 
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
CODE BLUE
 
Wcl310 Raiders of the Elevated Token
Wcl310 Raiders of the Elevated TokenWcl310 Raiders of the Elevated Token
Wcl310 Raiders of the Elevated Token
Raymond Comvalius
 
OceanLotus Ships New Backdoor Using Old Tricks
OceanLotus Ships New Backdoor Using Old TricksOceanLotus Ships New Backdoor Using Old Tricks
OceanLotus Ships New Backdoor Using Old Tricks
ESET Middle East
 
Practical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware BehaviorPractical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware Behavior
Sam Bowne
 

Similar to Testing UAC on Windows 10 (20)

Basic malware analysis
Basic malware analysis Basic malware analysis
Basic malware analysis
 
Reversing & Malware Analysis Training Part 9 - Advanced Malware Analysis
Reversing & Malware Analysis Training Part 9 -  Advanced Malware AnalysisReversing & Malware Analysis Training Part 9 -  Advanced Malware Analysis
Reversing & Malware Analysis Training Part 9 - Advanced Malware Analysis
 
Windows 7 Application Compatibility
Windows 7 Application CompatibilityWindows 7 Application Compatibility
Windows 7 Application Compatibility
 
Catching fileless attacks
Catching fileless attacksCatching fileless attacks
Catching fileless attacks
 
Black Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysisBlack Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysis
 
Windows advanced
Windows advancedWindows advanced
Windows advanced
 
Basic malware analysis
Basic malware analysisBasic malware analysis
Basic malware analysis
 
Stuxnet dc9723
Stuxnet dc9723Stuxnet dc9723
Stuxnet dc9723
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.pptCHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
 
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHack
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHackAn inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHack
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ LeHack
 
Finfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn ViệtFinfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn Việt
 
CNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware BehaviorCNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware Behavior
 
How to escalate privileges to administrator in latest Windows.
How to escalate privileges to administrator in latest Windows.How to escalate privileges to administrator in latest Windows.
How to escalate privileges to administrator in latest Windows.
 
Crisis. advanced malware
Crisis. advanced malwareCrisis. advanced malware
Crisis. advanced malware
 
Mitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptxMitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptx
 
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
 
Wcl310 Raiders of the Elevated Token
Wcl310 Raiders of the Elevated TokenWcl310 Raiders of the Elevated Token
Wcl310 Raiders of the Elevated Token
 
OceanLotus Ships New Backdoor Using Old Tricks
OceanLotus Ships New Backdoor Using Old TricksOceanLotus Ships New Backdoor Using Old Tricks
OceanLotus Ships New Backdoor Using Old Tricks
 
Practical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware BehaviorPractical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware Behavior
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 

Testing UAC on Windows 10

  • 1. #CyberCamp17 Testing UAC on Windows 10 Ernesto Fernández
  • 2. C:> whoami 2 Ernesto Fernández Provecho – L3cr0f q Linkedin – www.linkedin.com/in/ernesto-fernandez-provecho/ q Github – github.com/L3cr0f q Email – ernesto.fernpro@gmail.com
  • 3. What Is User Account Control (UAC) and How Does It Work? 3
  • 5. UAC 5 Mechanism to prevent malware execution at high integrity level without user permission. How? Consent Prompt
  • 6. UAC 6 It supports different "security" levels. The highest one prevents many of bypass UAC attacks, whereas the lowest one disables UAC.
  • 8. UAC Bypass 8 Attack consisting in execute code with administrator rights without prompting the user for consent on Windows systems. Some requirements must be met in most cases: q Vulnerable auto-elevate process. q The user belongs to the Administrators group. q The UAC security level is not set to "Always Notify". Attacker Administrator Shell UAC
  • 9. 9
  • 10. 10
  • 11. 11
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. 17
  • 18. UAC Bypass Methods 18 GUI Misusing COM Interface Elevation
  • 19. DLL Hijacking 19 The most common way to perform a bypass UAC attack. It works thanks to the way DLLs are loaded in Windows systems by some auto-elevate processes, since they do not found a specific DLL at first trial, allowing an attacker to trick them by loading a malicious DLL instead of the legit one. q IFileOperation q WUSA q Environment variables expansion q Race condition q UIPI bypass q COM handler hijacking q NTFS reparse point
  • 20. DLL Hijacking - IFileOperation 20 Invoke IFileOperation Masquerade PEB Process Injection Copy the malicious DLL to the targeted location Windows Trusted Certificate Process Execute auto- elevate process
  • 21. DLL Hijacking - WUSA 21 Copy the malicious DLL to the targeted location WUSA Extract Functionality Execute auto- elevate process Windows Update Standalone Installer (WUSA) runs at high integrity. Compress the malicious DLL into a CAB file
  • 22. DLL Hijacking - WUSA 22 Copy the malicious DLL to the targeted location WUSA Extract Functionality Execute auto- elevate process Windows Update Standalone Installer (WUSA) runs at high integrity. Compress the malicious DLL into a CAB file
  • 23. DLL Hijacking – UIPI Bypass 23 Inject IFileOperation DLL hijacking Copy to a "secure" path Malicious DLL Execute High integrity application Process Injection Execute auto- elevate process Windows Trusted Certificate Process User Interface Privilege Isolation (UIPI) prevents lower integrity processes from sending "messages" to higher integrity processes.
  • 24. DLL Hijacking – Environment Variable Expansion 24 Copy the malicious DLL to the targeted location Modify the environment variable in the Windows Registry Execute auto- elevate process
  • 25. DLL Hijacking – Race Condition 25 Copy the malicious DLL to the targeted location DLL hijacking Execute auto- elevate process
  • 26. DLL Hijacking – COM Handler Hijacking 26 The value is modified in "HKCR:CLSID" Modify the "HKCU:SoftwareClassesCLSID" with the path of the malicious DLL Execute auto-elevate process A COM handler specifies a COM object by its CLSID key from which the process associated with it will load a DLL.
  • 27. DLL Hijacking – NTFS Reparse Point 27 Create "wusa.exe" race condition A reparse point is a collection of user data associated with a file or a directory used in NTFS to implement hard links, junctions and symbolic links. Compress the malicious DLL into a CAB file Extract the malicious DLL to the targeted location by means of NTFS reparse point Execute auto- elevate process
  • 28. COM Interface Elevation 28 In Windows, a COM interface defines a set of methods that a COM object can invoke. The problem appears since some of this interfaces can elevate their privileges without user consent. Execute a method that allows us to execute code Find an elevated COM interface Run the selected method
  • 29. Application Compatibility Exploiting 29 Abuses the way Application Compatibility (AppCompat) works by creating a shim (file that contains the details on how Windows should manipulate an antiquated program to execute it properly) for an auto-elevate application that forces it to load a malicious binary - CVE-2015-0002. Auto-elevate application Malicious binary Malicious shim file
  • 30. Application Compatibility Exploiting 30 Abuses the way Application Compatibility (AppCompat) works by creating a shim (file that contains the details on how Windows should manipulate an antiquated program to execute it properly) for an auto-elevate application that forces it to load a malicious binary - CVE-2015-0002. Auto-elevate application Malicious binary Malicious shim file
  • 31. Shell API 31 This method abuses the way some auto-elevate applications use the shell API of Windows to execute its own commands. Environment variables expansion Registry manipulation Execute command Modify the Windows Registry
  • 32. Token Impersonation 32 Abuse QueryLimitedInformation access right to get Impersonate and Duplicate rights Check the rights of "mmc.exe" (high integrity process) Copy the high integrity token with Duplicate right Misuses the way tokens and their grants works in Windows systems. The following scheme explains the James Forshaw implementation. Modify the copied token Impersonate the copied token using Impersonate right
  • 33. Token Impersonation 33 Abuse QueryLimitedInformation access right to get Impersonate and Duplicate rights Check the rights of "mmc.exe" (high integrity process) Copy the high integrity token with Duplicate right Misuses the way tokens and their grants works in Windows systems. The following scheme explains the James Forshaw implementation. Modify the copied token Impersonate the copied token using Impersonate right
  • 34. GUI Misusing 34 The way such UAC bypass is performed is taking advantage of the way these processes use the "FileDialog" component, since you can "right-click" with the mouse on other application and point out the "Run as administrator" option, no UAC prompt will be displayed.
  • 35. Development of a New Bypass UAC 35
  • 36. Vulnerability Search 36 Auto-elevate processes We checked the different processes which have the feature "autoElevate" enabled by means of Strings. We found an interesting one, "dccw.exe".
  • 37. Vulnerability Search 37 dccw.exe execution flow analysis Using Process Monitor we find out that "dccw.exe" would be vulnerable to a DLL hijacking due to how "WinSxS" is managed.
  • 38. Vulnerability Verification 38 dccw.exe DLL hijacking confirmation We created the folders that were looked for unsuccessfully by "dccw.exe". When it was executed again, an error was presented.
  • 39. Vulnerability Verification 39 dccw.exe DLL hijacking confirmation We created the folders that were looked for unsuccessfully by "dccw.exe". When it was executed again, an error was presented.
  • 40. Exploit Development 40 Malicious DLL To execute code ("cmd.exe") at high integrity we need to craft a DLL to be loaded when "dccw.exe" will be executed. This DLL needs to export some functions from the legit "GdiPlus.dll" loaded by "dccw.exe". The DLL is compressed and base64 encoded in the code. Interoperabiltiy To allow the C++ PoC execution in Windows x86 and Windows x64, the binary and the DLL have been developed for x86 systems.
  • 41. Exploit Development 41 Initial Checks q Build version. q Administrator rights. q Administrators group. q UAC security level. Create Temporary Elements In the same directory of the PoC: 1. Create the folder "dccw.exe.Local". 2. Create the folders that match with the "x86_microsoft.windows.gdiplus_*" pattern in the "WinSxS" folder into the folder created in step 1. 3. Drop the malicious DLL into the folders created in step 2.
  • 42. Exploit Development C++ - Masquerade PEB Modify the Process Environment Block (PEB) due to COM objects rely on PSAPI, which parses the PEB, to identify the process from which they have been invoked. The resultant PEB will look like the one of a Microsoft signed application (e.g. "explorer.exe"). Trick the system to invoke IFileOperation at high integrity. Metasploit - Process Injection Inject a malicious DLL into a Microsoft signed application (e.g. "notepad.exe") and execute it.
  • 43. Exploit Development 43 Invoke IFileOperation Copy the previously created "dccw.exe.Local" and the elements contained in it to the vulnerable location. dccw.exe.Local WindowsSystem32 WindowsSysWOW64
  • 44. Exploit Development 44 Execute "dccw.exe" The DLL hijacking is performed and "cmd.exe" is executed with administrator rights. Remove Traces All created files and folders are deleted from the computer to stay undetected.
  • 45. Exploit Development 45 Initial Checks Masquerade PEB / Process Injection Execute dccw.exe Administrators Group Administrator Rights Build Version UAC Settings Invoke IFileOperation Create Temporary Elements WinSxS folders with "x86_microsoft.windo ws.gdiplus_*" pattern Drop the malicious DLL to those folders Copy temporary files to DLL hijacking path Execute code at high integrity Remove Traces
  • 46. Proof of Concept (PoC) Time! 46
  • 47. Requirements 47 C++ q The target must be a Windows 8 or 10. q The UAC level must not be set to "Always notify". q The compromised user must belong to the "Administrators group". Metasploit q The target must be a Windows 8 or 10. q The UAC level must not be set to "Always notify". q The compromised user must belong to the "Administrators group". q Having a Meterpreter session. q The TARGET option must match the processor architecture of the victim.
  • 48. C++ PoC - Windows 10 x64 14393 48 github.com/L3cr0f/DccwBypassUAC
  • 49. Metasploit Module - Windows 10 x86 15063 49 www.rapid7.com/db/modules/exploit/windows/local/bypassuac_injection_winsxs
  • 51. 51 "A weakness that would allow to bypass the 'Consent Prompt' is not considered a security vulnerability, since that is not considered a security boundary." But… "User Account Control (UAC) is a fundamental component of Microsoft's overall security vision." - Microsoft
  • 53. 53 Conclusions q Bypass User Account Control is not a big deal. q Build patches are not enough. q Microsoft should consider UAC bypasses as a vulnerability so as to protect users. q Nowadays, the only solution is setting up different users so as to use the one with lowest privileges. Achievements q Development of a new bypass UAC method that works on latest Windows 10 build versions. q Development of a new Metasploit module that works on latest Windows 10 build versions and which has being included in the Metasploit Framework. q This bypass UAC has been partially included in the UACME project as the 37th method.
  • 54. If you want to know more about… 54
  • 55. q DccwBypassUAC repository: https://github.com/L3cr0f/DccwBypassUAC. q Project paper: https://www.researchgate.net/publication/319454675_Testing _UAC_on_Windows_10. q Metasploit module: https://github.com/rapid7/metasploit- framework/blob/master/modules/exploits/windows/local/byp assuac_injection_winsxs.rb. q Rapid7 explanation of the Metasploit module: https://www.rapid7.com/db/modules/exploit/windows/local/ bypassuac_injection_winsxs. q UACME project: https://github.com/hfiref0x/UACME.
  • 56. Gracias por su atención