SlideShare a Scribd company logo
1 of 36
Download to read offline
Microsoft Azure
…
Control Flow Guard
Enforce control flow integrity
on indirect function calls
???
Enforce control flow integrity on
function returns
Arbitrary Code Guard
Prevent dynamic code generation,
modification, and execution
Code Integrity Guard
Images must be signed and load
from valid places
Prevent
control-flow
hijacking
Prevent
arbitrary code
generation
ü  Only valid, signed code pages can
be mapped by the app
ü  Code pages are immutable and
cannot be modified by the app
ü  Code execution stays “on the rails”
per the control-flow integrity policy
Example of such an attack provided by Yang Yu @ Black Hat USA
2014
Attacker attempts to map
malicious DLL
Allow DLL to be
mapped
Yes
No
Code Integrity Policies
Only allow Microsoft-signed DLLs
Only allow Microsoft, Store, or WHQL signed DLLs
Configurable via Device Guard policy
The following will fail with ERROR_DYNAMIC_CODE_BLOCKED
VirtualProtect(codePage, …, PAGE_EXECUTE_READWRITE)
VirtualProtect(codePage, …, PAGE_READWRITE)
VirtualAlloc(…, PAGE_EXECUTE*)
VirtualProtect(dataPage, …, PAGE_EXECUTE*)
MapViewOfFile(hPagefileSection, FILE_MAP_EXECUTE, …)
WriteProcessMemory(codePage, …)
…
ü Code is immutable
ü Data cannot become code
ü Only properly signed code
pages can be mapped
https://github.com/Microsoft/binskim
Compile time Runtime
Metadata is automatically added to the image
which identifies functions that may be called
indirectly
void	Foo(...)	{	
			//	SomeFunc	is	address-taken		
			//	and	may	be	called	indirectly	
			Object->FuncPtr	=	SomeFunc;	
}	
A lightweight check is inserted prior to indirect
calls which will verify that the call target is valid at
runtime
void	Bar(...)	{	
			//	Compiler-inserted	check	to		
			//	verify	call	target	is	valid	
			_guard_check_icall(Object->FuncPtr);	
			Object->FuncPtr(xyz);	
}	
• Update valid call target data
with metadata from PE image
Image
Load
• Map valid call target data
Process
Start
• Perform O(1) validity check
• Terminate process if invalid
target
Indirect
Call
ü  Return addresses are not
protected
ü  Valid functions can be called out of
context
ü  “Fail-open” design for compatibility
Non-enlightened Just-in-Time (JIT) compilers
Mitigated in latest version of Edge on Windows 10 (Chakra, Adobe Flash, and
WARP)
Multiple non-instrumented indirect calls
reported to our Mitigation Bypass Bounty
Mitigated in latest version of Edge on Windows 10
Calling sensitive APIs out of context
NtContinue/longjmp – mitigated for all CFG enabled apps on Windows 10
VirtualProtect/VirtualAlloc – mitigated in latest version of Microsoft Edge on
Windows 10
LoadLibrary – mitigated in latest version of Microsoft Edge on Windows 10 via CIG
WinExec – mitigated in Edge on Windows 10 anniversary edition via child process
policy
All exports – mitigated in Edge on Windows 10 Creators Update via export
suppression
Corrupting mutable read-only memory Known limitation that we are exploring solutions for
Bypass Status
Security Must be robust against our threat model
Performance
Cost must be within reason and
proportional to value
Compatibility Don’t break legacy apps
Interoperability
Binary compatibility with previous and
future versions of Windows
ABI compliant We can’t rebuild the world
Agility Don’t paint ourselves into a corner
Developer friction
Cost for developers to enable should be
minimal (ideally zero)
ü Stack cookies (/GS, etc)
•  Only mitigates stack buffer overruns
ü Shadow/split stack solutions
•  E.g. SafeStack (
http://clang.llvm.org/docs/SafeStack.html)
ü Fine-grained CFI solutions
•  E.g. RAP (https://www.grsecurity.net/rap_announce.php)
ü Control-flow Enforcement Technology (CET)
•  Indirect branch tracking via ENDBRANCH
•  Return address protection via a shadow stack
ü  Hardware-assists for helping to mitigate control-
flow hijacking & ROP
ü  Robust against our threat model
Preview specification:
https://software.intel.com/sites/default/files/managed/4d/2a/control-
flow-enforcement-technology-preview.pdf
644c8b1c24						mov					r11,qword	ptr	fs:[rsp]	
4c3b1c24								cmp					r11,qword	ptr	[rsp]	
0f8518a00300				jne					DLL!__guard_ss_verify_failure	
488b0424								mov					rax,qword	ptr	[rsp]		
6448890424						mov					qword	ptr	fs:[rsp],rax
Security Must be robust against our threat model
Performance
Cost must be within reason and
proportional to value
Compatibility Don’t break legacy apps
Interoperability
Binary compatibility with previous and
future versions of Windows
ABI compliant We can’t rebuild the world
Agility Don’t paint ourselves into a corner
Developer friction
Cost for developers to enable should be
minimal (ideally zero)
Array.prototype.slice() Type Confusion
Takes a JavaScriptArray as input, returns a newly created JavaScriptArray
https://github.com/Microsoft/ChakraCore/commit/17f3d4a4852dcc9e48de7091685b1862afb9f307
•  Create a NativeFloatArray fake_obj_arr which contains a fake object
•  Use CVE-2016-3260 to leak its address
•  Use CVE-2016-3260 to create a JavaScript variable fake_obj pointing
to fake_obj_arr + data_offset
•  …and a few other steps we won’t be talking about today J
ü  Reminder: Microsoft has an ongoing
$100,000 USD bounty for defensive
ideas J
ü  https://technet.microsoft.com/en-us/
security/dn425049.aspx
ü  https://blogs.technet.microsoft.com/
srd/2015/09/08/what-makes-a-good-
microsoft-defense-bounty-
submission/
ü  Accepting a weaker threat model would
mean significant drop in ROI
ü  Long-term impact on cost to exploit
would not be high enough to warrant
long-term cost of feature
ü  Red team was key to vetting the
solution
ü  @zer0mem also reported some
interesting attacks J
Mitigation Relevant policies
Runtime
API
EXE bit
Process creation
attribute
IFEO
CIG ProcessSignaturePolicy Yes No Yes Yes
ACG ProcessDynamicCodePolicy Yes No Yes Yes
CFG ProcessControlFlowGuardPolicy No
Yes (/
guard:cf)
Yes Yes
No Child Process
CHILD_PROCESS_POLICY process
creation attribute No No Yes No
Opt-in method Details Precedence
Runtime API See SetProcessMitigationPolicy 4
EXE flag Mitigation-specific flag in PE headers 3
Process creation attribute
See UpdateProcThreadAttribute with
PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY
2
Image File Execution Option (IFEO)
Set MitigationOptions (REG_BINARY) IFEO for an EXE
Same bits as process creation attribute
1
ü  Probability of detection increases with zero day
use
•  Attackers are incentivized to minimize use
•  Targets that detect zero day may alert vendor
ü  Selective use reduces downstream supply
•  Many actors lack means and capability to
https://www.proofpoint.com/us/threat-insight/post/magnitude-actor-social-engineering-scheme-windows-10
ü  Windows 10 is always up to date
•  Poor ROI for exploiting patched vulnerabilities
•  Rapid evolution of defensive technologies
ü  Mass-market exploit kits struggling to maintain
supply
•  Decrease in reusable & public exploits
•  Cost to acquire exceeds expected ROI
ü  Market has shifted toward social engineering
•  Macros, tech support scams, so on
https://aka.ms/bugbounty
https://aka.ms/cesecurityopenjobs
https://aka.ms/wdgsecurityjobs
CSW2017 Weston miller csw17_mitigating_native_remote_code_execution
CSW2017 Weston miller csw17_mitigating_native_remote_code_execution

More Related Content

What's hot

CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CanSecWest
 
CSW2017 chuanda ding_state of windows application security
CSW2017 chuanda ding_state of windows application securityCSW2017 chuanda ding_state of windows application security
CSW2017 chuanda ding_state of windows application security
CanSecWest
 
CSW2017 Privilege escalation on high-end servers due to implementation gaps i...
CSW2017 Privilege escalation on high-end servers due to implementation gaps i...CSW2017 Privilege escalation on high-end servers due to implementation gaps i...
CSW2017 Privilege escalation on high-end servers due to implementation gaps i...
CanSecWest
 
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCsw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
CanSecWest
 
BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...
BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...
BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...
BlueHat Security Conference
 
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 ||  Detecting Compromise on Windows Endpoints with Osquery  BlueHat v17 ||  Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
BlueHat Security Conference
 
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
OWASP
 

What's hot (20)

BlueHat v17 || Mitigations for the Masses: From EMET to Windows Defender Exp...
BlueHat v17 ||  Mitigations for the Masses: From EMET to Windows Defender Exp...BlueHat v17 ||  Mitigations for the Masses: From EMET to Windows Defender Exp...
BlueHat v17 || Mitigations for the Masses: From EMET to Windows Defender Exp...
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
 
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
 
BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S...
 BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S... BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S...
BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S...
 
CSW2017 chuanda ding_state of windows application security
CSW2017 chuanda ding_state of windows application securityCSW2017 chuanda ding_state of windows application security
CSW2017 chuanda ding_state of windows application security
 
BlueHat v17 || Raising the Bar: New Hardware Primitives for Exploit Mitigations
BlueHat v17 || Raising the Bar: New Hardware Primitives for Exploit Mitigations BlueHat v17 || Raising the Bar: New Hardware Primitives for Exploit Mitigations
BlueHat v17 || Raising the Bar: New Hardware Primitives for Exploit Mitigations
 
CSW2017 Privilege escalation on high-end servers due to implementation gaps i...
CSW2017 Privilege escalation on high-end servers due to implementation gaps i...CSW2017 Privilege escalation on high-end servers due to implementation gaps i...
CSW2017 Privilege escalation on high-end servers due to implementation gaps i...
 
BlueHat v17 || Dangerous Contents - Securing .Net Deserialization
BlueHat v17 || Dangerous Contents - Securing .Net Deserialization BlueHat v17 || Dangerous Contents - Securing .Net Deserialization
BlueHat v17 || Dangerous Contents - Securing .Net Deserialization
 
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure  BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
 
Endpoint is not enough
Endpoint is not enoughEndpoint is not enough
Endpoint is not enough
 
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCsw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
 
BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...
BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...
BlueHat v17 || Wannacrypt + Smbv1.0 Vulnerability = One of the Most Damaging ...
 
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 ||  Detecting Compromise on Windows Endpoints with Osquery  BlueHat v17 ||  Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
 
OWASP Poland Day 2018 - Amir Shladovsky - Crypto-mining
OWASP Poland Day 2018 - Amir Shladovsky - Crypto-miningOWASP Poland Day 2018 - Amir Shladovsky - Crypto-mining
OWASP Poland Day 2018 - Amir Shladovsky - Crypto-mining
 
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
[OPD 2019] Side-Channels on the Web:
Attacks and Defenses
 
The Art of defence: How vulnerabilites help shape security features and mitig...
The Art of defence: How vulnerabilites help shape security features and mitig...The Art of defence: How vulnerabilites help shape security features and mitig...
The Art of defence: How vulnerabilites help shape security features and mitig...
 
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisInside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
 
BlueHat v18 || Malicious user profiling using a deep neural net
BlueHat v18 || Malicious user profiling using a deep neural netBlueHat v18 || Malicious user profiling using a deep neural net
BlueHat v18 || Malicious user profiling using a deep neural net
 
1.3. (In)security Software
1.3. (In)security Software1.3. (In)security Software
1.3. (In)security Software
 
BlueHat v18 || Record now, decrypt later - future quantum computers are a pre...
BlueHat v18 || Record now, decrypt later - future quantum computers are a pre...BlueHat v18 || Record now, decrypt later - future quantum computers are a pre...
BlueHat v18 || Record now, decrypt later - future quantum computers are a pre...
 

Similar to CSW2017 Weston miller csw17_mitigating_native_remote_code_execution

WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
Dmitri Artamonov
 
Tech Ed09 Net Best Practices Bijoy New
Tech Ed09 Net Best Practices Bijoy NewTech Ed09 Net Best Practices Bijoy New
Tech Ed09 Net Best Practices Bijoy New
rsnarayanan
 
Adobe Hacked Again: What Does It Mean for You?
Adobe Hacked Again: What Does It Mean for You? Adobe Hacked Again: What Does It Mean for You?
Adobe Hacked Again: What Does It Mean for You?
Lumension
 

Similar to CSW2017 Weston miller csw17_mitigating_native_remote_code_execution (20)

WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
 
Tools & techniques, building a dev secops culture at mozilla sba live a...
Tools & techniques, building a dev secops culture at mozilla   sba live a...Tools & techniques, building a dev secops culture at mozilla   sba live a...
Tools & techniques, building a dev secops culture at mozilla sba live a...
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
 
Tech Ed09 Net Best Practices Bijoy New
Tech Ed09 Net Best Practices Bijoy NewTech Ed09 Net Best Practices Bijoy New
Tech Ed09 Net Best Practices Bijoy New
 
March 2019 Patch Tuesday Analysis
March 2019 Patch Tuesday AnalysisMarch 2019 Patch Tuesday Analysis
March 2019 Patch Tuesday Analysis
 
An introduction to Defender for Business
An introduction to Defender for BusinessAn introduction to Defender for Business
An introduction to Defender for Business
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
 
Adobe Hacked Again: What Does It Mean for You?
Adobe Hacked Again: What Does It Mean for You? Adobe Hacked Again: What Does It Mean for You?
Adobe Hacked Again: What Does It Mean for You?
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
 
What’s new in Microsoft ALM 2013, hosted in Windows Azure, VISUAL STUDIO ONLI...
What’s new in Microsoft ALM 2013, hosted in Windows Azure, VISUAL STUDIO ONLI...What’s new in Microsoft ALM 2013, hosted in Windows Azure, VISUAL STUDIO ONLI...
What’s new in Microsoft ALM 2013, hosted in Windows Azure, VISUAL STUDIO ONLI...
 
Porque las Amenazas avanzadas requieren de una Seguridad para Aplicaciones av...
Porque las Amenazas avanzadas requieren de una Seguridad para Aplicaciones av...Porque las Amenazas avanzadas requieren de una Seguridad para Aplicaciones av...
Porque las Amenazas avanzadas requieren de una Seguridad para Aplicaciones av...
 
ABN AMRO DevSecOps Journey
ABN AMRO DevSecOps JourneyABN AMRO DevSecOps Journey
ABN AMRO DevSecOps Journey
 
Azure presentation nnug dec 2010
Azure presentation nnug  dec 2010Azure presentation nnug  dec 2010
Azure presentation nnug dec 2010
 
Bhavin_Resume
Bhavin_ResumeBhavin_Resume
Bhavin_Resume
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
SYN 321: Securing the Published Browser
SYN 321: Securing the Published BrowserSYN 321: Securing the Published Browser
SYN 321: Securing the Published Browser
 
2023 November Patch Tuesday
2023 November Patch Tuesday2023 November Patch Tuesday
2023 November Patch Tuesday
 
Security strategies for html5 enterprise mobile apps
Security strategies for html5 enterprise mobile appsSecurity strategies for html5 enterprise mobile apps
Security strategies for html5 enterprise mobile apps
 

More from CanSecWest

CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CanSecWest
 
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CanSecWest
 
CSW2017 Qinghao tang+Xinlei ying vmware_escape_final
CSW2017 Qinghao tang+Xinlei ying vmware_escape_finalCSW2017 Qinghao tang+Xinlei ying vmware_escape_final
CSW2017 Qinghao tang+Xinlei ying vmware_escape_final
CanSecWest
 
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu securityCSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CanSecWest
 
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_markCSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CanSecWest
 
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg dayCSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
CanSecWest
 
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CanSecWest
 
CSW2017 Mickey+maggie low cost radio attacks on modern platforms
CSW2017 Mickey+maggie low cost radio attacks on modern platformsCSW2017 Mickey+maggie low cost radio attacks on modern platforms
CSW2017 Mickey+maggie low cost radio attacks on modern platforms
CanSecWest
 
CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...
CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...
CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...
CanSecWest
 
CSW2017 Saumil shah stegosploit_internals_cansecwest_2017
CSW2017 Saumil shah stegosploit_internals_cansecwest_2017CSW2017 Saumil shah stegosploit_internals_cansecwest_2017
CSW2017 Saumil shah stegosploit_internals_cansecwest_2017
CanSecWest
 
CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017
CanSecWest
 
CSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershell
CSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershellCSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershell
CSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershell
CanSecWest
 
Csw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromisedCsw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromised
CanSecWest
 
Csw2016 d antoine_automatic_exploitgeneration
Csw2016 d antoine_automatic_exploitgenerationCsw2016 d antoine_automatic_exploitgeneration
Csw2016 d antoine_automatic_exploitgeneration
CanSecWest
 
Csw2016 gawlik bypassing_differentdefenseschemes
Csw2016 gawlik bypassing_differentdefenseschemesCsw2016 gawlik bypassing_differentdefenseschemes
Csw2016 gawlik bypassing_differentdefenseschemes
CanSecWest
 

More from CanSecWest (20)

CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on android
 
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
 
CSW2017 jun li_car anomaly detection
CSW2017  jun li_car anomaly detectionCSW2017  jun li_car anomaly detection
CSW2017 jun li_car anomaly detection
 
CSW2017 Qinghao tang+Xinlei ying vmware_escape_final
CSW2017 Qinghao tang+Xinlei ying vmware_escape_finalCSW2017 Qinghao tang+Xinlei ying vmware_escape_final
CSW2017 Qinghao tang+Xinlei ying vmware_escape_final
 
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu securityCSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
 
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_markCSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
 
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg dayCSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
 
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
 
CSW2017 Mickey+maggie low cost radio attacks on modern platforms
CSW2017 Mickey+maggie low cost radio attacks on modern platformsCSW2017 Mickey+maggie low cost radio attacks on modern platforms
CSW2017 Mickey+maggie low cost radio attacks on modern platforms
 
CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...
CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...
CSW2017 Minrui yan+Jianhao-liu a visualization tool for evaluating can-bus cy...
 
CSW2017 Harri hursti csw17 final
CSW2017 Harri hursti csw17 finalCSW2017 Harri hursti csw17 final
CSW2017 Harri hursti csw17 final
 
CSW2017 Saumil shah stegosploit_internals_cansecwest_2017
CSW2017 Saumil shah stegosploit_internals_cansecwest_2017CSW2017 Saumil shah stegosploit_internals_cansecwest_2017
CSW2017 Saumil shah stegosploit_internals_cansecwest_2017
 
CSW2017 Scott kelly secureboot-csw2017-v1
CSW2017 Scott kelly secureboot-csw2017-v1CSW2017 Scott kelly secureboot-csw2017-v1
CSW2017 Scott kelly secureboot-csw2017-v1
 
CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017
 
CSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershell
CSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershellCSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershell
CSW2017 Amanda rousseau cansecwest2017_net_hijacking_powershell
 
Csw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromisedCsw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromised
 
Csw2016 song li-smart_wars
Csw2016 song li-smart_warsCsw2016 song li-smart_wars
Csw2016 song li-smart_wars
 
Csw2016 macaulay eh_trace-rop_hooks
Csw2016 macaulay eh_trace-rop_hooksCsw2016 macaulay eh_trace-rop_hooks
Csw2016 macaulay eh_trace-rop_hooks
 
Csw2016 d antoine_automatic_exploitgeneration
Csw2016 d antoine_automatic_exploitgenerationCsw2016 d antoine_automatic_exploitgeneration
Csw2016 d antoine_automatic_exploitgeneration
 
Csw2016 gawlik bypassing_differentdefenseschemes
Csw2016 gawlik bypassing_differentdefenseschemesCsw2016 gawlik bypassing_differentdefenseschemes
Csw2016 gawlik bypassing_differentdefenseschemes
 

Recently uploaded

一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
apekaom
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理
SS
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
AS
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 

Recently uploaded (20)

Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理
 
Delivery in 20 Mins Call Girls Cuttack 9332606886 HOT & SEXY Models beautifu...
Delivery in 20 Mins Call Girls Cuttack  9332606886 HOT & SEXY Models beautifu...Delivery in 20 Mins Call Girls Cuttack  9332606886 HOT & SEXY Models beautifu...
Delivery in 20 Mins Call Girls Cuttack 9332606886 HOT & SEXY Models beautifu...
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
 
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Washington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers ShirtWashington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers Shirt
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Call Girls Mehdipatnam ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Mehdipatnam ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Mehdipatnam ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Mehdipatnam ( 8250092165 ) Cheap rates call girls | Get low budget
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 

CSW2017 Weston miller csw17_mitigating_native_remote_code_execution

  • 1.
  • 2.
  • 3.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Control Flow Guard Enforce control flow integrity on indirect function calls ??? Enforce control flow integrity on function returns Arbitrary Code Guard Prevent dynamic code generation, modification, and execution Code Integrity Guard Images must be signed and load from valid places Prevent control-flow hijacking Prevent arbitrary code generation ü  Only valid, signed code pages can be mapped by the app ü  Code pages are immutable and cannot be modified by the app ü  Code execution stays “on the rails” per the control-flow integrity policy
  • 12. Example of such an attack provided by Yang Yu @ Black Hat USA 2014 Attacker attempts to map malicious DLL Allow DLL to be mapped Yes No Code Integrity Policies Only allow Microsoft-signed DLLs Only allow Microsoft, Store, or WHQL signed DLLs Configurable via Device Guard policy
  • 13.
  • 14. The following will fail with ERROR_DYNAMIC_CODE_BLOCKED VirtualProtect(codePage, …, PAGE_EXECUTE_READWRITE) VirtualProtect(codePage, …, PAGE_READWRITE) VirtualAlloc(…, PAGE_EXECUTE*) VirtualProtect(dataPage, …, PAGE_EXECUTE*) MapViewOfFile(hPagefileSection, FILE_MAP_EXECUTE, …) WriteProcessMemory(codePage, …) … ü Code is immutable ü Data cannot become code ü Only properly signed code pages can be mapped
  • 16. Compile time Runtime Metadata is automatically added to the image which identifies functions that may be called indirectly void Foo(...) { // SomeFunc is address-taken // and may be called indirectly Object->FuncPtr = SomeFunc; } A lightweight check is inserted prior to indirect calls which will verify that the call target is valid at runtime void Bar(...) { // Compiler-inserted check to // verify call target is valid _guard_check_icall(Object->FuncPtr); Object->FuncPtr(xyz); } • Update valid call target data with metadata from PE image Image Load • Map valid call target data Process Start • Perform O(1) validity check • Terminate process if invalid target Indirect Call
  • 17. ü  Return addresses are not protected ü  Valid functions can be called out of context ü  “Fail-open” design for compatibility Non-enlightened Just-in-Time (JIT) compilers Mitigated in latest version of Edge on Windows 10 (Chakra, Adobe Flash, and WARP) Multiple non-instrumented indirect calls reported to our Mitigation Bypass Bounty Mitigated in latest version of Edge on Windows 10 Calling sensitive APIs out of context NtContinue/longjmp – mitigated for all CFG enabled apps on Windows 10 VirtualProtect/VirtualAlloc – mitigated in latest version of Microsoft Edge on Windows 10 LoadLibrary – mitigated in latest version of Microsoft Edge on Windows 10 via CIG WinExec – mitigated in Edge on Windows 10 anniversary edition via child process policy All exports – mitigated in Edge on Windows 10 Creators Update via export suppression Corrupting mutable read-only memory Known limitation that we are exploring solutions for Bypass Status
  • 18. Security Must be robust against our threat model Performance Cost must be within reason and proportional to value Compatibility Don’t break legacy apps Interoperability Binary compatibility with previous and future versions of Windows ABI compliant We can’t rebuild the world Agility Don’t paint ourselves into a corner Developer friction Cost for developers to enable should be minimal (ideally zero) ü Stack cookies (/GS, etc) •  Only mitigates stack buffer overruns ü Shadow/split stack solutions •  E.g. SafeStack ( http://clang.llvm.org/docs/SafeStack.html) ü Fine-grained CFI solutions •  E.g. RAP (https://www.grsecurity.net/rap_announce.php)
  • 19. ü Control-flow Enforcement Technology (CET) •  Indirect branch tracking via ENDBRANCH •  Return address protection via a shadow stack ü  Hardware-assists for helping to mitigate control- flow hijacking & ROP ü  Robust against our threat model Preview specification: https://software.intel.com/sites/default/files/managed/4d/2a/control- flow-enforcement-technology-preview.pdf
  • 20.
  • 22. Security Must be robust against our threat model Performance Cost must be within reason and proportional to value Compatibility Don’t break legacy apps Interoperability Binary compatibility with previous and future versions of Windows ABI compliant We can’t rebuild the world Agility Don’t paint ourselves into a corner Developer friction Cost for developers to enable should be minimal (ideally zero)
  • 23. Array.prototype.slice() Type Confusion Takes a JavaScriptArray as input, returns a newly created JavaScriptArray https://github.com/Microsoft/ChakraCore/commit/17f3d4a4852dcc9e48de7091685b1862afb9f307
  • 24. •  Create a NativeFloatArray fake_obj_arr which contains a fake object •  Use CVE-2016-3260 to leak its address •  Use CVE-2016-3260 to create a JavaScript variable fake_obj pointing to fake_obj_arr + data_offset •  …and a few other steps we won’t be talking about today J
  • 25. ü  Reminder: Microsoft has an ongoing $100,000 USD bounty for defensive ideas J ü  https://technet.microsoft.com/en-us/ security/dn425049.aspx ü  https://blogs.technet.microsoft.com/ srd/2015/09/08/what-makes-a-good- microsoft-defense-bounty- submission/ ü  Accepting a weaker threat model would mean significant drop in ROI ü  Long-term impact on cost to exploit would not be high enough to warrant long-term cost of feature ü  Red team was key to vetting the solution ü  @zer0mem also reported some interesting attacks J
  • 26. Mitigation Relevant policies Runtime API EXE bit Process creation attribute IFEO CIG ProcessSignaturePolicy Yes No Yes Yes ACG ProcessDynamicCodePolicy Yes No Yes Yes CFG ProcessControlFlowGuardPolicy No Yes (/ guard:cf) Yes Yes No Child Process CHILD_PROCESS_POLICY process creation attribute No No Yes No Opt-in method Details Precedence Runtime API See SetProcessMitigationPolicy 4 EXE flag Mitigation-specific flag in PE headers 3 Process creation attribute See UpdateProcThreadAttribute with PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY 2 Image File Execution Option (IFEO) Set MitigationOptions (REG_BINARY) IFEO for an EXE Same bits as process creation attribute 1
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. ü  Probability of detection increases with zero day use •  Attackers are incentivized to minimize use •  Targets that detect zero day may alert vendor ü  Selective use reduces downstream supply •  Many actors lack means and capability to https://www.proofpoint.com/us/threat-insight/post/magnitude-actor-social-engineering-scheme-windows-10 ü  Windows 10 is always up to date •  Poor ROI for exploiting patched vulnerabilities •  Rapid evolution of defensive technologies ü  Mass-market exploit kits struggling to maintain supply •  Decrease in reusable & public exploits •  Cost to acquire exceeds expected ROI ü  Market has shifted toward social engineering •  Macros, tech support scams, so on
  • 33.