SlideShare a Scribd company logo
WHOAMI
» Philip Tsukerman – Security Researcher @ Cybereason
» @PhilipTsukerman
» No idea to whom the legs in the background belong
OUTLINE
» Intro to Device Guard
» VBA based techniques
» Non-VBA based techniques
» Other benefits of techniques
» Conclusion
INTRO TO DEVICE GUARD
DEVICE GUARD – WHAT AND WHY?
» Application whitelisting feature in Win10
» Only code defined in a policy (by cert/hash/etc.) should
be able to run
» Inhibits an attacker’s ability to run code on a
compromised machine
» Very interesting and permissive threat model:
» Attacker can already execute commands on a machine
WHAT DOES ARBITRARY CODE REALLY MEAN?
» The ability to interact with the OS freely (under
privilege constraints)
» Most direct way to achieve this is having full control of
process memory
WHAT DOES ARBITRARY CODE REALLY MEAN?
WHAT DOES ARBITRARY CODE REALLY MEAN?
» Without AWL:
»Arbitrary commands == arbitrary
code
»Just run your own process/library
and you’re set
WHAT DOES ARBITRARY CODE REALLY MEAN?
» With AWL:
»You have to rely only on allowed
executables/scripts
»Implementing basic offensive
functionality (cred stealing, c&c
etc.) becomes immensely hard
LOSING ARBITRARY EXECUTION IS EASY!
Fully
Controlled
Process
Privilege
Escalation
Lateral
Movement
Sandbox
Escape
Persistenc
e
DEVICE GUARD – IN PRACTICE
» PE Files
» Only whitelisted files may be executed
» Powershell
» Constrained Language Mode (CLM) allows only very
restricted types in non-whitelisted scripts
» ActiveScript Engines
» COM object filtering on non-whitelisted scripts
DEVICE GUARD – IN PRACTICE
ADMIN BYPASSES ARE STILL DANGEROUS
» Admin users can disable Device Guard
» Requires a restart
» Throws a nasty event log
» Forces attackers into very conspicuous and detectable behavior
ADMIN BYPASSES ARE STILL DANGEROUS
» New admin bypasses may be unnoticed by defenders
» Most common scenario for Lateral Movement
» More unfixed admin bypasses = less reliability to the
feature
VBA BYPASSES
A WORD ON VBA
» You can’t expect MS to lock every piece of code in
existence
» But Office is MS made, and ubiquitous
» VBA is uninstrumented by Device Guard
» Macros easily allow you to gain full process control:
» Import WINAPI functions and run shellcode
» DotNetToJScript
THE NAÏVE APPROACH
THE NAÏVE APPROACH
» Requires user interaction, and RDPing to a victim is a
bit too much
» Is also really lame
» Could we run macros without user/GUI interactions?
THE LATERAL MOVEMENT/DCOM APPROACH
» Macro functionality is exposed via DCOM
» No files, no protected mode!
» Easily available only remotely
» Requires Admin in most configs
THE LATERAL MOVEMENT/DCOM APPROACH
BUT WE WANT TO DO IT LOCALLY!
AND UNPRIVILEGED!
WHEN DOES OFFICE FORSAKE PROTECTED MODE?
» Documents for which macros were enabled once are considered
trusted
» So are documents running from trusted locations
TRUSTED LOCATIONS
» Trusted locations are managed in the registry
» All the default ones are only writable by admins
TRUSTED LOCATIONS
TRUSTED LOCATIONS
¯_( ツ )_/¯
PS IN CLM TO ARBITRARY CODE EXAMPLE
UGH. FINE. LET’S BLOCK VBE7.DLL
NON-VBA BASED BYPASSES
EXCEL4.0 MACROS
» Excel actually has another, legacy macro feature,
introduced in ‘92
» Implemented in excel.exe itself
» CALL and REGISTER functions allow execution of arbitrary
dll functions
» May leave a subtle taste of vomit in your mouth after use
EXCEL4.0 MACROS
» Can be used to run x86 shellcode via a method discovered
by Stan Hegt and Pieter Ceelen of Outflank
EXCEL4.0 MACROS
RUNNING SHELLCODE VIA DCOM
Fileless version by Stan Hegt available here -
https://github.com/outflanknl/Excel4-DCOM
EXCEL4.0 MACROS
» The current technique can’t support x64 shellcode due to
datatype and calling convention constraints
» The fileless lateral movement version is a bit slow, as
it writes the payload byte by byte
» A fast, 64-bit supporting version and an accompanying
blogpost are available here –
https://www.cybereason.com/blog/excel4.0-macros-now-with-twice-the-bits
RUNNING SHELLCODE VIA DCOM – X64 SUPPORT
RUNNING SHELLCODE VIA TRUSTED FOLDER
» The trusted directory trick works exactly the same, without
VBA
BENEFITS OF EXCEL4 MACROS
» Less likely to be killed if DG is introduced to office
» No external library to block
» Excel is installed = Device Guard Forever(?)-Day
ACTIVESCRIPT BYPASSES
ACTIVESCRIPT BYPASSES
» ActiveScript is a generic Windows scripting technology
» What’s behind vbscript/jscript
» The target of many recent bypasses (Squibly[A-Za-z]*)
THE MAIN COMPONENTS OF ACTIVESCRIPT
https://docs.microsoft.com
COMMON HOSTS AND ENGINES
» Hosts:
» W/Cscript.exe
» Scrobj.dll
» Msxml3/6.dll
» Mshtml.dll
» Engines:
» Jscript.dll
» VBScript.dll
» Jscript9.dll
DEVICE GUARD IN ACTIVESCRIPT
Engine
Wldp.dll
Host
Engine
Script
new ActiveXObject
(“Wscript.Shell”);
CLSIDFromProgID (“Wscript.Shell”,
&clsid)
Host->IsClassAllowed (clsid, &is_allowed)
WldpIsClassInApprovedList
(classID, hostInformation, isApproved, optionalFlags)
CoCreateInstance (clsid, *otherparams)
ACTIVESCRIPTCONSUMER
» You might know this WMI class from the most common WMI
persistence method
» Implemented as scrcons.exe
» An independent ActiveScript host by itself
» Not instrumented by Device Guard
» Only available as admin :(
ACTIVESCRIPTCONSUMER
XSLT TRANSFORMS
XSLT TRANSFORMS
» XML Transform stylesheets
» Support embedded scripting
» Implement their own uninstrumented scripting host in
msxml.dll
» Applying an arbitrary xsl transform can result in running
arbitrary code
MSACCESS XSLT TRANSFORMS
MSACCESS XSLT TRANSFORMS
Implementation available here - https://gist.github.com/Philts/1c6a41048501d5067fd0ab4b933a38c8
OUTLOOK OBJECT CREATION + XSLT
Modification of a method published here:
https://enigma0x3.net/2017/11/16/lateral-movement-using-outlooks-createobject-method-and-dotnettojscript/
THIS WAS A LIE BY OMISSION
Engine
Wldp.dll
Host
Engine
Script
new ActiveXObject
(“Wscript.Shell”);
CLSIDFromProgID (“Wscript.Shell”,
&clsid)
Host->IsClassAllowed (clsid, &is_allowed)
WldpIsClassInApprovedList
(classID, hostInformation, isApproved, optionalFlags)
CoCreateInstance (clsid, *otherparams)
DIFFERENT IMPLEMENTATIONS IN ACTIVESCRIPT
WHAT DOES THIS MEAN FOR US?
» Mshtml.dll is responsible for
calling IsClassAllowed for the
engine
» Cscript.exe exposes IsClassAllowed
to the engine, which calls it
directly
CVE-2018-8417
» Jscript9.dll was not meant to be used by wcscript, and
thus assumes the host will call IsClassAllowed for it
» Can be run under cscript if asked very nicely
» The engine relies on the host to check the whitelist,
while the host relies on the engine
» IsClassAllowed is never called
» Object is created with no checks
A TWEETABLE POC
OK, BUT WHAT ABOUT SCRIPTLETS?!
» Scrobj.dll (the scriptlet host) works exactly the
same
» Scriptlets need a ProgID, not a CLSID
» Just register your own and you’re set
OK, BUT WHAT ABOUT SCRIPTLETS?!
OK, BUT WHAT ABOUT SCRIPTLETS?!
UPDATED MACHINE? – BYOV!
UPDATED MACHINE? – BYOV!
» Jimmy Bayne (@bohops) discovered that you could still
abuse two of our recent bypasses, despite them being
patched
» Borrowing a trick from driver signature enforcement
bypasses
» Bad catalog hygiene means that the signature of the
vulnerable library is still valid
AN IMPERFECT SOLUTION
NOT JUST THE BYPASSES, BUT THE OVERFLOWS AND UAFS TOO!
THE SCOPE OF THE PROBLEM
» Stale catalogs are not the exception, but rather the norm
» Your machine is vulnerable to anything that is:
» A DG bypass / Code execution vulnerability
» Vulnerable code is reachable via command line / COM hijacking /
dll hijacking
» Vulnerability was patched after the current major Windows update
(RS#) was released
» Almost all vulnerable versions of files can be found in
the WinSxS folder
» Fixing this requires either better catalog hygiene on
update, or adding every single such vulnerability to the
block list as it is released.
THIS IS BORING. NOBODY USES DG
ANYWAY!
ALTERNATIVE EXECUTION METHODS ARE ALWAYS FUN
» Some of the bypasses shown can be used as
stealthy execution techniques regardless of
Device Guard
AMSI BYPASSES
» Jscript9.dll isn’t instrumented with AMSI
» Even on an updated machine you are provided
with a free AMSI bypass!
AMSI BYPASSES
» Chakra.dll – Yes, there’s another ActiveScript JS
implementation!
» No AMSI, but no ActiveX functionality
» Wscript.CreateObject to the rescue!
STICKING TECHNIQUES TOGETHER
» Use Jscript9/Chakra.dll to create the Excel object
» Run shellcode through Excel
» No files, No AMSI, and no injections!
CONCLUSION
YOU ALREADY HAVE THE TOOLS FOR DETECTION
» Each of the bypasses described can be easily detected, if
you know what to look for
» Command lines, registry and maybe a tiny bit of WMI is
all you need
HOW I THINK THE FEATURE SHOULD DEVELOP
» Lock down Office, as it is pretty ubiquitous
» Implement a generic solution for the catalog
hygiene issue
» A single consistent implementation for
ActiveScript
» Some kind of way to extend the whitelisting
model to other applications would be nice
PEOPLE TO FOLLOW
» James Forshaw - @tiraniddo
» Matt Graeber - @mattifestation
» Casey Smith - @subtee
» Matt Nelson - @enigma0x3
» Jimmy Bayne - @bohops
You can also reach me via @PhilipTsukerman
QUESTIONS?

More Related Content

What's hot

Common PhoneGap Gotchas (#PGDay EU 2016)
Common PhoneGap Gotchas (#PGDay EU 2016)Common PhoneGap Gotchas (#PGDay EU 2016)
Common PhoneGap Gotchas (#PGDay EU 2016)
Kerri Shotts
 
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
enigma0x3
 
BSides London 2017 - Hunt Or Be Hunted
BSides London 2017 - Hunt Or Be HuntedBSides London 2017 - Hunt Or Be Hunted
BSides London 2017 - Hunt Or Be Hunted
Alex Davies
 
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
BlueHat Security Conference
 
Bridging the Gap: Lessons in Adversarial Tradecraft
Bridging the Gap: Lessons in Adversarial TradecraftBridging the Gap: Lessons in Adversarial Tradecraft
Bridging the Gap: Lessons in Adversarial Tradecraft
enigma0x3
 
Attacking with html5(lava kumar)
Attacking with html5(lava kumar)Attacking with html5(lava kumar)
Attacking with html5(lava kumar)
ClubHack
 
Hunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsHunting for security bugs in AEM webapps
Hunting for security bugs in AEM webapps
Mikhail Egorov
 
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
BlueHat Security Conference
 
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web InterfacesThey Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
michelemanzotti
 
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat Security Conference
 
CNIT 128: Android Implementation Issues (Part 2)
CNIT 128: Android Implementation Issues (Part 2)CNIT 128: Android Implementation Issues (Part 2)
CNIT 128: Android Implementation Issues (Part 2)
Sam Bowne
 
Htaccess info
Htaccess infoHtaccess info
Htaccess info
umakant jadhav
 
Malware Analysis For The Enterprise
Malware Analysis For The EnterpriseMalware Analysis For The Enterprise
Malware Analysis For The Enterprise
Jason Ross
 
Continuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friendsContinuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friends
Nikhil Mittal
 
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 Security Conference
 
Ruxmon feb 2013 what happened to rails
Ruxmon feb 2013   what happened to railsRuxmon feb 2013   what happened to rails
Ruxmon feb 2013 what happened to rails
snyff
 
Defcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-securityDefcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-security
Priyanka Aash
 
CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)
Sam Bowne
 
I got 99 trends and a # is all of them
I got 99 trends and a # is all of themI got 99 trends and a # is all of them
I got 99 trends and a # is all of them
Roberto Suggi Liverani
 
ColdFusion for Penetration Testers
ColdFusion for Penetration TestersColdFusion for Penetration Testers
ColdFusion for Penetration Testers
Chris Gates
 

What's hot (20)

Common PhoneGap Gotchas (#PGDay EU 2016)
Common PhoneGap Gotchas (#PGDay EU 2016)Common PhoneGap Gotchas (#PGDay EU 2016)
Common PhoneGap Gotchas (#PGDay EU 2016)
 
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
 
BSides London 2017 - Hunt Or Be Hunted
BSides London 2017 - Hunt Or Be HuntedBSides London 2017 - Hunt Or Be Hunted
BSides London 2017 - Hunt Or Be Hunted
 
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
 
Bridging the Gap: Lessons in Adversarial Tradecraft
Bridging the Gap: Lessons in Adversarial TradecraftBridging the Gap: Lessons in Adversarial Tradecraft
Bridging the Gap: Lessons in Adversarial Tradecraft
 
Attacking with html5(lava kumar)
Attacking with html5(lava kumar)Attacking with html5(lava kumar)
Attacking with html5(lava kumar)
 
Hunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsHunting for security bugs in AEM webapps
Hunting for security bugs in AEM webapps
 
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
 
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web InterfacesThey Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
 
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole
 
CNIT 128: Android Implementation Issues (Part 2)
CNIT 128: Android Implementation Issues (Part 2)CNIT 128: Android Implementation Issues (Part 2)
CNIT 128: Android Implementation Issues (Part 2)
 
Htaccess info
Htaccess infoHtaccess info
Htaccess info
 
Malware Analysis For The Enterprise
Malware Analysis For The EnterpriseMalware Analysis For The Enterprise
Malware Analysis For The Enterprise
 
Continuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friendsContinuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friends
 
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
 
Ruxmon feb 2013 what happened to rails
Ruxmon feb 2013   what happened to railsRuxmon feb 2013   what happened to rails
Ruxmon feb 2013 what happened to rails
 
Defcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-securityDefcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-security
 
CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)
 
I got 99 trends and a # is all of them
I got 99 trends and a # is all of themI got 99 trends and a # is all of them
I got 99 trends and a # is all of them
 
ColdFusion for Penetration Testers
ColdFusion for Penetration TestersColdFusion for Penetration Testers
ColdFusion for Penetration Testers
 

Similar to Sneaking Past Device Guard - HITB19AMS

Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...
Stefano Maccaglia
 
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Christian Schneider
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Christian Schneider
 
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
Felipe Prado
 
Scripting and Automation within the MAX Platform - Mark Petrie
Scripting and Automation within the MAX Platform - Mark Petrie Scripting and Automation within the MAX Platform - Mark Petrie
Scripting and Automation within the MAX Platform - Mark Petrie
MAXfocus
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
nitinscribd
 
Blackhat Arsenal 2017 - The Cumulus Toolkit
Blackhat Arsenal 2017 - The Cumulus ToolkitBlackhat Arsenal 2017 - The Cumulus Toolkit
Blackhat Arsenal 2017 - The Cumulus Toolkit
Javier Godinez
 
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Apostolos Giannakidis
 
The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010
Mario Heiderich
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Ajin Abraham
 
Antivirus is hopeless
Antivirus is hopelessAntivirus is hopeless
Antivirus is hopeless
Sumedt Jitpukdebodin
 
ETCSS: Into the Mind of a Hacker
ETCSS: Into the Mind of a HackerETCSS: Into the Mind of a Hacker
ETCSS: Into the Mind of a Hacker
Rob Gillen
 
Automated Intrusion Detection and Response on AWS
Automated Intrusion Detection and Response on AWSAutomated Intrusion Detection and Response on AWS
Automated Intrusion Detection and Response on AWS
Teri Radichel
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010
Tim Clark
 
Watch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty ResultsWatch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty Results
jtmelton
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
Peter Hlavaty
 
Waf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScriptWaf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScript
Denis Kolegov
 
Cm5 secure code_training_1day_system configuration
Cm5 secure code_training_1day_system configurationCm5 secure code_training_1day_system configuration
Cm5 secure code_training_1day_system configuration
dcervigni
 
Metasploit Computer security testing tool
Metasploit  Computer security testing toolMetasploit  Computer security testing tool
Metasploit Computer security testing tool
medoelkang600
 

Similar to Sneaking Past Device Guard - HITB19AMS (20)

Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...
 
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
 
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
 
Scripting and Automation within the MAX Platform - Mark Petrie
Scripting and Automation within the MAX Platform - Mark Petrie Scripting and Automation within the MAX Platform - Mark Petrie
Scripting and Automation within the MAX Platform - Mark Petrie
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
 
Blackhat Arsenal 2017 - The Cumulus Toolkit
Blackhat Arsenal 2017 - The Cumulus ToolkitBlackhat Arsenal 2017 - The Cumulus Toolkit
Blackhat Arsenal 2017 - The Cumulus Toolkit
 
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
 
The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
 
Antivirus is hopeless
Antivirus is hopelessAntivirus is hopeless
Antivirus is hopeless
 
ETCSS: Into the Mind of a Hacker
ETCSS: Into the Mind of a HackerETCSS: Into the Mind of a Hacker
ETCSS: Into the Mind of a Hacker
 
Automated Intrusion Detection and Response on AWS
Automated Intrusion Detection and Response on AWSAutomated Intrusion Detection and Response on AWS
Automated Intrusion Detection and Response on AWS
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010
 
Watch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty ResultsWatch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty Results
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Waf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScriptWaf.js: How to Protect Web Applications using JavaScript
Waf.js: How to Protect Web Applications using JavaScript
 
Cm5 secure code_training_1day_system configuration
Cm5 secure code_training_1day_system configurationCm5 secure code_training_1day_system configuration
Cm5 secure code_training_1day_system configuration
 
Metasploit Computer security testing tool
Metasploit  Computer security testing toolMetasploit  Computer security testing tool
Metasploit Computer security testing tool
 

Recently uploaded

The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
aeeva
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
alowpalsadig
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 

Recently uploaded (20)

The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 

Sneaking Past Device Guard - HITB19AMS

  • 1.
  • 2. WHOAMI » Philip Tsukerman – Security Researcher @ Cybereason » @PhilipTsukerman » No idea to whom the legs in the background belong
  • 3. OUTLINE » Intro to Device Guard » VBA based techniques » Non-VBA based techniques » Other benefits of techniques » Conclusion
  • 5. DEVICE GUARD – WHAT AND WHY? » Application whitelisting feature in Win10 » Only code defined in a policy (by cert/hash/etc.) should be able to run » Inhibits an attacker’s ability to run code on a compromised machine » Very interesting and permissive threat model: » Attacker can already execute commands on a machine
  • 6. WHAT DOES ARBITRARY CODE REALLY MEAN? » The ability to interact with the OS freely (under privilege constraints) » Most direct way to achieve this is having full control of process memory
  • 7. WHAT DOES ARBITRARY CODE REALLY MEAN?
  • 8. WHAT DOES ARBITRARY CODE REALLY MEAN? » Without AWL: »Arbitrary commands == arbitrary code »Just run your own process/library and you’re set
  • 9. WHAT DOES ARBITRARY CODE REALLY MEAN? » With AWL: »You have to rely only on allowed executables/scripts »Implementing basic offensive functionality (cred stealing, c&c etc.) becomes immensely hard
  • 10. LOSING ARBITRARY EXECUTION IS EASY! Fully Controlled Process Privilege Escalation Lateral Movement Sandbox Escape Persistenc e
  • 11. DEVICE GUARD – IN PRACTICE » PE Files » Only whitelisted files may be executed » Powershell » Constrained Language Mode (CLM) allows only very restricted types in non-whitelisted scripts » ActiveScript Engines » COM object filtering on non-whitelisted scripts
  • 12. DEVICE GUARD – IN PRACTICE
  • 13. ADMIN BYPASSES ARE STILL DANGEROUS » Admin users can disable Device Guard » Requires a restart » Throws a nasty event log » Forces attackers into very conspicuous and detectable behavior
  • 14. ADMIN BYPASSES ARE STILL DANGEROUS » New admin bypasses may be unnoticed by defenders » Most common scenario for Lateral Movement » More unfixed admin bypasses = less reliability to the feature
  • 16. A WORD ON VBA » You can’t expect MS to lock every piece of code in existence » But Office is MS made, and ubiquitous » VBA is uninstrumented by Device Guard » Macros easily allow you to gain full process control: » Import WINAPI functions and run shellcode » DotNetToJScript
  • 18. THE NAÏVE APPROACH » Requires user interaction, and RDPing to a victim is a bit too much » Is also really lame » Could we run macros without user/GUI interactions?
  • 19. THE LATERAL MOVEMENT/DCOM APPROACH » Macro functionality is exposed via DCOM » No files, no protected mode! » Easily available only remotely » Requires Admin in most configs
  • 21. BUT WE WANT TO DO IT LOCALLY! AND UNPRIVILEGED!
  • 22. WHEN DOES OFFICE FORSAKE PROTECTED MODE? » Documents for which macros were enabled once are considered trusted » So are documents running from trusted locations
  • 23. TRUSTED LOCATIONS » Trusted locations are managed in the registry » All the default ones are only writable by admins
  • 27. PS IN CLM TO ARBITRARY CODE EXAMPLE
  • 28. UGH. FINE. LET’S BLOCK VBE7.DLL
  • 30. EXCEL4.0 MACROS » Excel actually has another, legacy macro feature, introduced in ‘92 » Implemented in excel.exe itself » CALL and REGISTER functions allow execution of arbitrary dll functions » May leave a subtle taste of vomit in your mouth after use
  • 31. EXCEL4.0 MACROS » Can be used to run x86 shellcode via a method discovered by Stan Hegt and Pieter Ceelen of Outflank
  • 33. RUNNING SHELLCODE VIA DCOM Fileless version by Stan Hegt available here - https://github.com/outflanknl/Excel4-DCOM
  • 34. EXCEL4.0 MACROS » The current technique can’t support x64 shellcode due to datatype and calling convention constraints » The fileless lateral movement version is a bit slow, as it writes the payload byte by byte » A fast, 64-bit supporting version and an accompanying blogpost are available here – https://www.cybereason.com/blog/excel4.0-macros-now-with-twice-the-bits
  • 35. RUNNING SHELLCODE VIA DCOM – X64 SUPPORT
  • 36. RUNNING SHELLCODE VIA TRUSTED FOLDER » The trusted directory trick works exactly the same, without VBA
  • 37. BENEFITS OF EXCEL4 MACROS » Less likely to be killed if DG is introduced to office » No external library to block » Excel is installed = Device Guard Forever(?)-Day
  • 39. ACTIVESCRIPT BYPASSES » ActiveScript is a generic Windows scripting technology » What’s behind vbscript/jscript » The target of many recent bypasses (Squibly[A-Za-z]*)
  • 40. THE MAIN COMPONENTS OF ACTIVESCRIPT https://docs.microsoft.com
  • 41. COMMON HOSTS AND ENGINES » Hosts: » W/Cscript.exe » Scrobj.dll » Msxml3/6.dll » Mshtml.dll » Engines: » Jscript.dll » VBScript.dll » Jscript9.dll
  • 42. DEVICE GUARD IN ACTIVESCRIPT Engine Wldp.dll Host Engine Script new ActiveXObject (“Wscript.Shell”); CLSIDFromProgID (“Wscript.Shell”, &clsid) Host->IsClassAllowed (clsid, &is_allowed) WldpIsClassInApprovedList (classID, hostInformation, isApproved, optionalFlags) CoCreateInstance (clsid, *otherparams)
  • 43. ACTIVESCRIPTCONSUMER » You might know this WMI class from the most common WMI persistence method » Implemented as scrcons.exe » An independent ActiveScript host by itself » Not instrumented by Device Guard » Only available as admin :(
  • 46. XSLT TRANSFORMS » XML Transform stylesheets » Support embedded scripting » Implement their own uninstrumented scripting host in msxml.dll » Applying an arbitrary xsl transform can result in running arbitrary code
  • 48. MSACCESS XSLT TRANSFORMS Implementation available here - https://gist.github.com/Philts/1c6a41048501d5067fd0ab4b933a38c8
  • 49. OUTLOOK OBJECT CREATION + XSLT Modification of a method published here: https://enigma0x3.net/2017/11/16/lateral-movement-using-outlooks-createobject-method-and-dotnettojscript/
  • 50. THIS WAS A LIE BY OMISSION Engine Wldp.dll Host Engine Script new ActiveXObject (“Wscript.Shell”); CLSIDFromProgID (“Wscript.Shell”, &clsid) Host->IsClassAllowed (clsid, &is_allowed) WldpIsClassInApprovedList (classID, hostInformation, isApproved, optionalFlags) CoCreateInstance (clsid, *otherparams)
  • 52. WHAT DOES THIS MEAN FOR US? » Mshtml.dll is responsible for calling IsClassAllowed for the engine » Cscript.exe exposes IsClassAllowed to the engine, which calls it directly
  • 53. CVE-2018-8417 » Jscript9.dll was not meant to be used by wcscript, and thus assumes the host will call IsClassAllowed for it » Can be run under cscript if asked very nicely » The engine relies on the host to check the whitelist, while the host relies on the engine » IsClassAllowed is never called » Object is created with no checks
  • 55. OK, BUT WHAT ABOUT SCRIPTLETS?! » Scrobj.dll (the scriptlet host) works exactly the same » Scriptlets need a ProgID, not a CLSID » Just register your own and you’re set
  • 56. OK, BUT WHAT ABOUT SCRIPTLETS?!
  • 57. OK, BUT WHAT ABOUT SCRIPTLETS?!
  • 59. UPDATED MACHINE? – BYOV! » Jimmy Bayne (@bohops) discovered that you could still abuse two of our recent bypasses, despite them being patched » Borrowing a trick from driver signature enforcement bypasses » Bad catalog hygiene means that the signature of the vulnerable library is still valid
  • 61. NOT JUST THE BYPASSES, BUT THE OVERFLOWS AND UAFS TOO!
  • 62. THE SCOPE OF THE PROBLEM » Stale catalogs are not the exception, but rather the norm » Your machine is vulnerable to anything that is: » A DG bypass / Code execution vulnerability » Vulnerable code is reachable via command line / COM hijacking / dll hijacking » Vulnerability was patched after the current major Windows update (RS#) was released » Almost all vulnerable versions of files can be found in the WinSxS folder » Fixing this requires either better catalog hygiene on update, or adding every single such vulnerability to the block list as it is released.
  • 63. THIS IS BORING. NOBODY USES DG ANYWAY!
  • 64. ALTERNATIVE EXECUTION METHODS ARE ALWAYS FUN » Some of the bypasses shown can be used as stealthy execution techniques regardless of Device Guard
  • 65. AMSI BYPASSES » Jscript9.dll isn’t instrumented with AMSI » Even on an updated machine you are provided with a free AMSI bypass!
  • 66. AMSI BYPASSES » Chakra.dll – Yes, there’s another ActiveScript JS implementation! » No AMSI, but no ActiveX functionality » Wscript.CreateObject to the rescue!
  • 67. STICKING TECHNIQUES TOGETHER » Use Jscript9/Chakra.dll to create the Excel object » Run shellcode through Excel » No files, No AMSI, and no injections!
  • 69. YOU ALREADY HAVE THE TOOLS FOR DETECTION » Each of the bypasses described can be easily detected, if you know what to look for » Command lines, registry and maybe a tiny bit of WMI is all you need
  • 70. HOW I THINK THE FEATURE SHOULD DEVELOP » Lock down Office, as it is pretty ubiquitous » Implement a generic solution for the catalog hygiene issue » A single consistent implementation for ActiveScript » Some kind of way to extend the whitelisting model to other applications would be nice
  • 71. PEOPLE TO FOLLOW » James Forshaw - @tiraniddo » Matt Graeber - @mattifestation » Casey Smith - @subtee » Matt Nelson - @enigma0x3 » Jimmy Bayne - @bohops
  • 72. You can also reach me via @PhilipTsukerman QUESTIONS?