SlideShare a Scribd company logo
1 of 67
“_____ Is Not a Security
Boundary."
Things I Have Learned and Things That
Have Gotten Better from Researching
Microsoft Software
Matt Nelson (@enigma0x3)
SpecterOps
Overview
◦ Intro
◦ Disclaimer
◦ Why this is relevant
◦ Security Boundaries and Us
◦ Practical Examples
◦ Conclusion
Intro
◦ Matt Nelson (@enigma0x3)
▫ Job: Security Researcher & Red Teamer
@SpecterOps
▫ Trainer: BlackHat, AT:RTO
▫ Blog: enigma0x3.net
▫ Speaker: Various BSides, DerbyCon,
ShmooCon, WWHF, OPCDE
Disclaimer
◦ The following presentation is from the
perspective of an external security
researcher.
◦ Opinions are derived from first-hand
experience reporting atypical
abuse/bypasses.
I Replicate Persistent
Adversaries
Say What?
◦ My day job is to attack massive
organizations.
◦ I face the same hurdles that the bad
guys do.
▫ I also innovate around those
hurdles… just like the bad guys do.
The Problem
◦ People rely on vendors to protect them.
▫ This very often includes organizations as well…
◦ This works with serviceable bugs
▫ Not so well with security “feature” bypasses
◦ Organizations are confused on what they
need to fix and what is automatically fixed.
The Problem
◦ Most organizations lack basic security
posture
▫ Patching, logging, etc.
◦ Ideal scenario:
▫ Organizations use things like Application
Whitelisting, Command Line Logging, Network
Segmentation
The Reality
The Problem
◦ Researchers face a similar issue
▫ How do we know what to report?
◦ Some researchers have gotten “This isn’t
a boundary” responses.
▫ This can cause hesitation
Security Boundaries
and Us
Security Boundary?
“What’s a security boundary? It’s a wall
through which code and data can’t pass
without the authorization of a security
policy.“ - Mark Russinovich
https://blogs.technet.microsoft.com/markrussinovich/2007/02/12/psexec-user-
account-control-and-security-boundaries/
Implications?
◦ I hate the phrase “Security Boundary”
◦ Historically, the deciding factor if a fix is
issued or not.
◦ Just because it isn't a boundary, doesn’t
mean it shouldn't be fixed.
Implications?
◦ This has gotten much better as of late
◦ We now have “Defense in Depth” fixes
▫ Pushed out Patch Tuesday or added into new Windows
builds
◦ All the while, attackers don’t care and use
everything they can in the wild.
“Attackers don’t care
about security
boundaries” - Jessica
Payne at MSIgniteNZ
(@jepayneMSFT)
https://twitter.com/jepayneMSFT/status/791702594309677056
What Does This Mean?
◦ “Security Boundaries” == touchy subject
▫ Not cut & dry what is/isn’t
◦ Security Researchers get grumpy when
hearing “Technology X is not a security
boundary”
◦ Attackers. Don’t. Care.
Look At It This Way...
◦ Comes down to economics
◦ Is a security feature an impediment to
an attacker? If so, investing in a bypass
is worth it.
◦ Security Boundary or not, raising the
cost for attackers is a win!
Practical Examples
Outlook Forms/Rules
◦ Outlook Rule/Form attacks
▫ Remotely sync malicious Outlook rules or forms
(with scripts) for code-execution
▫ Discovered by @silentbreaksec
■ https://silentbreaksecurity.com/malicious-outlook-rules/
▫ Weaponized with Ruler from SensePost
◦ Feature of Office, not a vulnerability
▫ Fixed in KB4011091!
OLE
◦ Object Linking and Embedding
▫ Attackers’ favorite for smuggling in malicious
payloads via Office documents
◦ This is what I use on almost every
assessment
◦ Again, just a feature.
▫ So, not worthy of a fix, right?
OLE
Office 2016
◦ This is what ignoring “boundaries” and
raising the cost for attackers looks like.
◦ These 2 attacks are feature abuse only
▫ No bug is abused
▫ Yet, it was still fixed!
Protected View
◦ Designed to prevent various Office
components from being used when the doc
is from the internet
▫ Prevents automatic exploitation
◦ Most Office applications/file formats are
enrolled
▫ Except OneNote, Publisher and Excel
SLK files
Protected View
◦ Typically patched
▫ CVE-2016-3279 for example (.XLA files not
enrolled)
◦ Why are Publisher/OneNote/SLK files not?
▫ Mostly the same functionality
▫ I have used these formats to compromise clients
from the internet.
Protected View: DDE
◦ Dynamic Data Exchange
▫ Allows command execution
▫ It is a feature!
◦ Widely used by ITW malware, such as Locky
◦ The Response?
Protected View: DDE
https://www.theregister.co.uk/2017/10/17/microsoft_dde_attacks/
Office 2016
◦ Some things are GREAT
◦ Others, not so much
◦ Sometimes, it’s the simple things that can
make a huge difference
Anti-Malware Scan
Interface
Anti-Malware Scan Interface
◦ Standard interface for hooking scripting
engines (WSH/PowerShell,VBA)
◦ Helps facilitate detecting “in-memory”
attacks executed through Scripting
Languages
Anti-Malware Scan Interface
Anti-Malware Scan Interface
◦ AMSI bypass == AV-free code-execution
◦ Many exist
◦ Do we report these? Or do we save time
and publically disclose with mitigation
options?
▫ Attack service can get overwhelming...
Example: COM Hijacking
◦ Hijacks the AMSI COM server via the
registry
◦ Process calls CoCreateInstance() to
instantiate the AMSI COM component
◦ Calling process == Medium integrity level
▫ This results in searching HKCU for the COM
server
Example: COM Hijacking
Anti-Malware Scan Interface
◦ Is this a “boundary”?
▫ No.
◦ Is this a hurdle (some) attackers have to
jump over?
▫ Yes. A massive one.
◦ Do security vendors take a dependency
on AMSI?
▫ Yes.
Anti-Malware Scan Interface
◦ This is where things get weird.
▫ Vendors can’t fix everything
◦ How do you defend against a process
that has full access to its own memory
space?
◦ People need to defend themselves…
▫ Constrained Language Mode, Application
Whitelisting, etc.
Example: Unloading via
Reflection
Example: AMSI DLL Hijack
◦ The AMSI DLL isn’t loaded from a safe
location
▫ So, it uses the default Windows search order
◦ Load scripting engine from place you
control, drop fake AMSI DLL in same
directory
▫ Blogged about by @Cneelis
▫ Stop letting low-rep binaries execute/load
Anti-Malware Scan Interface
◦ So, some of them were fixed and some
were not
▫ Why not fix all those that are possible? (is it cost?)
◦ This raises the bar for an attacker
▫ They will rely on techniques such as reflection
(PowerShell)
▫ Makes logging these bypasses (in WMF 5) trivial
◦ Combine these fixes with CLM/AWL
User Account Control
User Account Control
◦ Designed to break out administrative
and standard user rights
◦ Explicitly stated it isn’t a boundary
▫ I completely agree
◦ Yet, it is a barrier that already elevated
attackers have to get around
▫ Why not make it harder?
User Account Control
◦ UAC has a MASSIVE attack surface
▫ It is hard to keep up on it
◦ UAC bypasses were introduced in 2009
and didn’t start to get fixed until 2016…
▫ But things are getting better!!
Example: UAC Bypass via
EventVwr
◦ Eventvwr.exe starts mmc.exe with the
Event Viewer MSC snap-in
▫ How does it know what binary handles .msc files?
◦ Looks in HKCU for it :-)
◦ Hijack that and you have the ability to
elevate without user interaction
Example: UAC Bypass via
EventVwr
Example: UAC Bypass via
EventVwr
Example: UAC Bypass via
EventVwr
◦ Populating that key with a binary +
parameters == code execution
◦ Malware authors ate this one up…
◦ Great example: UAC isn’t a boundary,
yet attackers care a lot about it
▫ Why not fix it?
Example: UAC
Bypass via
EventVwr
https://twitter.com/JohnLaTwC/status/817010045464367111
Example: UAC Bypass via
EventVwr
◦ As mentioned before, things are getting
better...
http://www.winhelponline.com/blog/microsoft-fixes-eventvwr-exe-uac-bypass-exploit-windows-10-creators-update/
User Account Control
◦ Please keep it up!
◦ Many UAC bypasses have been fixed
▫ Many have not…
◦ We know it isn’t trivial
▫ It makes attacker life suck, though
Device Guard
Device Guard
◦ The best application whitelisting solution
to date
▫ But doesn’t scale…yet.
◦ You define what you trust in a CI policy
▫ Certificates, hashes, etc.
▫ Both Kernel and Usermode
◦ Requires a bypass to run unsigned code
that isn’t in allowed via the policy
Device Guard
◦ Is this a hurdle that (some) attackers
have to jump over?
▫ Absolutely
◦ Bypasses are *usually* serviced with
CVEs
◦ Some bugs are not though (.NET)
▫ Why not??
Device Guard
◦ The difference: Device Guard makes a
security guarantee
▫ If you have a policy deployed, code that doesn’t
conform to that policy can’t run
◦ If you break that guarantee, it gets a CVE
▫ Usually…
▫ http://www.exploit-monday.com/2017/07/bypassing-device-guard-with-dotnet-
methods.html
Case Study: CVE-2017-0007
◦ UMCI in Device Guard didn’t properly
validate the call when checking a file’s
integrity
◦ Normally, an unsigned file should be
prevented from executing
Case Study: CVE-2017-0007
◦ So, what happens if we take an
embedded signature block from a
Microsoft signed file and apply it to our
own?
Case Study: CVE-2017-0007
◦ As you can see, the digital signature of
that file did not validate
▫ This is expected
◦ Since that file is not legitimately signed
and doesn’t pass integrity checks, UMCI
should block it
▫ Right?
Conclusion
This Problem Isn’t Trivial
◦ How can you fix everything?
▫ It isn’t practical
◦ Security Feature bypasses take a very
low precedence
◦ Ideally, organizations would wake up
and use all the latest and greatest
▫ WDATP, ATA, etc.
Call to Action
◦ Attackers are going to bypass these
features regardless of their “fix” priority
◦ Vendors & Defensive teams will be left
scrambling to write detections for these
bypasses
◦ Perform internal research
Call to Action
◦ Consider raising the service bar
▫ Doesn’t have to be a CVE; DiD fixes work too!
◦ Issue fixes consistently
◦ No fix? Issue mitigation options
◦ Communicate with researchers!
▫ Explain the reason for not fixing instead of “It
just isn’t a security boundary”
Shoutouts
◦ Special thanks to Nate Warfield
(MSRC), Lee Holmes (Azure), Scott
Anderson (Device Guard), Tom
Gallagher (Office) & Ryan Kivett!
Thanks!!!
Any questions?
@enigma0x3
matt@specterops.io

More Related Content

What's hot

Csw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelistingCsw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelisting
CanSecWest
 
Google chrome sandbox
Google chrome sandboxGoogle chrome sandbox
Google chrome sandbox
Nephi Johnson
 
CSW2017 Weston miller csw17_mitigating_native_remote_code_execution
CSW2017 Weston miller csw17_mitigating_native_remote_code_executionCSW2017 Weston miller csw17_mitigating_native_remote_code_execution
CSW2017 Weston miller csw17_mitigating_native_remote_code_execution
CanSecWest
 
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat Security Conference
 
NCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios appsNCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group
 

What's hot (20)

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 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 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 2014 - The Attacker's View of Windows Authentication and Post Exploit...
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
 
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
 
Certified Pre-Owned
Certified Pre-OwnedCertified Pre-Owned
Certified Pre-Owned
 
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...
 
Csw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelistingCsw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelisting
 
Google chrome sandbox
Google chrome sandboxGoogle chrome sandbox
Google chrome sandbox
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shell
 
CSW2017 Weston miller csw17_mitigating_native_remote_code_execution
CSW2017 Weston miller csw17_mitigating_native_remote_code_executionCSW2017 Weston miller csw17_mitigating_native_remote_code_execution
CSW2017 Weston miller csw17_mitigating_native_remote_code_execution
 
The Unintended Risks of Trusting Active Directory
The Unintended Risks of Trusting Active DirectoryThe Unintended Risks of Trusting Active Directory
The Unintended Risks of Trusting Active Directory
 
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 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
 
SYN507: Reducing desktop infrastructure management overhead using “old school...
SYN507: Reducing desktop infrastructure management overhead using “old school...SYN507: Reducing desktop infrastructure management overhead using “old school...
SYN507: Reducing desktop infrastructure management overhead using “old school...
 
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security DescriptorsAn ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors
 
Virtualization Security
Virtualization SecurityVirtualization Security
Virtualization Security
 
Evading Microsoft ATA for Active Directory Domination
Evading Microsoft ATA for Active Directory DominationEvading Microsoft ATA for Active Directory Domination
Evading Microsoft ATA for Active Directory Domination
 
NCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios appsNCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios apps
 
Teensy Programming for Everyone
Teensy Programming for EveryoneTeensy Programming for Everyone
Teensy Programming for Everyone
 

Similar to “_____ Is Not a Security Boundary: Things I Have Learned and Things That Have Gotten Better from Researching Microsoft Software

Security engineering 101 when good design & security work together
Security engineering 101  when good design & security work togetherSecurity engineering 101  when good design & security work together
Security engineering 101 when good design & security work together
Wendy Knox Everette
 
Web Security: What's wrong, and how the bad guys can break your website
Web Security: What's wrong, and how the bad guys can break your websiteWeb Security: What's wrong, and how the bad guys can break your website
Web Security: What's wrong, and how the bad guys can break your website
Andrew Sorensen
 
Elementary-Information-Security-Practices
Elementary-Information-Security-PracticesElementary-Information-Security-Practices
Elementary-Information-Security-Practices
Octogence
 

Similar to “_____ Is Not a Security Boundary: Things I Have Learned and Things That Have Gotten Better from Researching Microsoft Software (20)

Security engineering 101 when good design & security work together
Security engineering 101  when good design & security work togetherSecurity engineering 101  when good design & security work together
Security engineering 101 when good design & security work together
 
An Introduction to Secure Application Development
An Introduction to Secure Application DevelopmentAn Introduction to Secure Application Development
An Introduction to Secure Application Development
 
Luis Grangeia IBWAS
Luis Grangeia IBWASLuis Grangeia IBWAS
Luis Grangeia IBWAS
 
IBWAS 2010: Web Security From an Auditor's Standpoint
IBWAS 2010: Web Security From an Auditor's StandpointIBWAS 2010: Web Security From an Auditor's Standpoint
IBWAS 2010: Web Security From an Auditor's Standpoint
 
Web Security: What's wrong, and how the bad guys can break your website
Web Security: What's wrong, and how the bad guys can break your websiteWeb Security: What's wrong, and how the bad guys can break your website
Web Security: What's wrong, and how the bad guys can break your website
 
Bridging the Gap
Bridging the GapBridging the Gap
Bridging the Gap
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelines
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
DevSecOps : an Introduction
DevSecOps : an IntroductionDevSecOps : an Introduction
DevSecOps : an Introduction
 
Owasp tds
Owasp tdsOwasp tds
Owasp tds
 
DevSecOps What Why and How
DevSecOps What Why and HowDevSecOps What Why and How
DevSecOps What Why and How
 
Measures to ensure Cyber Security in a serverless environment
Measures to ensure Cyber Security in a serverless environmentMeasures to ensure Cyber Security in a serverless environment
Measures to ensure Cyber Security in a serverless environment
 
DevSecOps at Agile 2019
DevSecOps at   Agile 2019 DevSecOps at   Agile 2019
DevSecOps at Agile 2019
 
Double agent zero-day code injection and persistence technique
Double agent  zero-day code injection and persistence techniqueDouble agent  zero-day code injection and persistence technique
Double agent zero-day code injection and persistence technique
 
VMWare Tech Talk: "The Road from Rugged DevOps to Security Chaos Engineering"
VMWare Tech Talk: "The Road from Rugged DevOps to Security Chaos Engineering"VMWare Tech Talk: "The Road from Rugged DevOps to Security Chaos Engineering"
VMWare Tech Talk: "The Road from Rugged DevOps to Security Chaos Engineering"
 
So you wanna be a pentester - free webinar to show you how
So you wanna be a pentester - free webinar to show you howSo you wanna be a pentester - free webinar to show you how
So you wanna be a pentester - free webinar to show you how
 
Broken by design (Danny Fullerton)
Broken by design (Danny Fullerton)Broken by design (Danny Fullerton)
Broken by design (Danny Fullerton)
 
OSMC 2008 | Advanced Windows monitoring and NSClient++ with Nagios by Michael...
OSMC 2008 | Advanced Windows monitoring and NSClient++ with Nagios by Michael...OSMC 2008 | Advanced Windows monitoring and NSClient++ with Nagios by Michael...
OSMC 2008 | Advanced Windows monitoring and NSClient++ with Nagios by Michael...
 
Elementary-Information-Security-Practices
Elementary-Information-Security-PracticesElementary-Information-Security-Practices
Elementary-Information-Security-Practices
 
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have Gotten Better from Researching Microsoft Software

  • 1. “_____ Is Not a Security Boundary." Things I Have Learned and Things That Have Gotten Better from Researching Microsoft Software Matt Nelson (@enigma0x3) SpecterOps
  • 2. Overview ◦ Intro ◦ Disclaimer ◦ Why this is relevant ◦ Security Boundaries and Us ◦ Practical Examples ◦ Conclusion
  • 3. Intro ◦ Matt Nelson (@enigma0x3) ▫ Job: Security Researcher & Red Teamer @SpecterOps ▫ Trainer: BlackHat, AT:RTO ▫ Blog: enigma0x3.net ▫ Speaker: Various BSides, DerbyCon, ShmooCon, WWHF, OPCDE
  • 4. Disclaimer ◦ The following presentation is from the perspective of an external security researcher. ◦ Opinions are derived from first-hand experience reporting atypical abuse/bypasses.
  • 6. Say What? ◦ My day job is to attack massive organizations. ◦ I face the same hurdles that the bad guys do. ▫ I also innovate around those hurdles… just like the bad guys do.
  • 7. The Problem ◦ People rely on vendors to protect them. ▫ This very often includes organizations as well… ◦ This works with serviceable bugs ▫ Not so well with security “feature” bypasses ◦ Organizations are confused on what they need to fix and what is automatically fixed.
  • 8. The Problem ◦ Most organizations lack basic security posture ▫ Patching, logging, etc. ◦ Ideal scenario: ▫ Organizations use things like Application Whitelisting, Command Line Logging, Network Segmentation
  • 10. The Problem ◦ Researchers face a similar issue ▫ How do we know what to report? ◦ Some researchers have gotten “This isn’t a boundary” responses. ▫ This can cause hesitation
  • 12. Security Boundary? “What’s a security boundary? It’s a wall through which code and data can’t pass without the authorization of a security policy.“ - Mark Russinovich https://blogs.technet.microsoft.com/markrussinovich/2007/02/12/psexec-user- account-control-and-security-boundaries/
  • 13. Implications? ◦ I hate the phrase “Security Boundary” ◦ Historically, the deciding factor if a fix is issued or not. ◦ Just because it isn't a boundary, doesn’t mean it shouldn't be fixed.
  • 14. Implications? ◦ This has gotten much better as of late ◦ We now have “Defense in Depth” fixes ▫ Pushed out Patch Tuesday or added into new Windows builds ◦ All the while, attackers don’t care and use everything they can in the wild.
  • 15. “Attackers don’t care about security boundaries” - Jessica Payne at MSIgniteNZ (@jepayneMSFT) https://twitter.com/jepayneMSFT/status/791702594309677056
  • 16. What Does This Mean? ◦ “Security Boundaries” == touchy subject ▫ Not cut & dry what is/isn’t ◦ Security Researchers get grumpy when hearing “Technology X is not a security boundary” ◦ Attackers. Don’t. Care.
  • 17. Look At It This Way... ◦ Comes down to economics ◦ Is a security feature an impediment to an attacker? If so, investing in a bypass is worth it. ◦ Security Boundary or not, raising the cost for attackers is a win!
  • 19. Outlook Forms/Rules ◦ Outlook Rule/Form attacks ▫ Remotely sync malicious Outlook rules or forms (with scripts) for code-execution ▫ Discovered by @silentbreaksec ■ https://silentbreaksecurity.com/malicious-outlook-rules/ ▫ Weaponized with Ruler from SensePost ◦ Feature of Office, not a vulnerability ▫ Fixed in KB4011091!
  • 20. OLE ◦ Object Linking and Embedding ▫ Attackers’ favorite for smuggling in malicious payloads via Office documents ◦ This is what I use on almost every assessment ◦ Again, just a feature. ▫ So, not worthy of a fix, right?
  • 21. OLE
  • 22. Office 2016 ◦ This is what ignoring “boundaries” and raising the cost for attackers looks like. ◦ These 2 attacks are feature abuse only ▫ No bug is abused ▫ Yet, it was still fixed!
  • 23. Protected View ◦ Designed to prevent various Office components from being used when the doc is from the internet ▫ Prevents automatic exploitation ◦ Most Office applications/file formats are enrolled ▫ Except OneNote, Publisher and Excel SLK files
  • 24. Protected View ◦ Typically patched ▫ CVE-2016-3279 for example (.XLA files not enrolled) ◦ Why are Publisher/OneNote/SLK files not? ▫ Mostly the same functionality ▫ I have used these formats to compromise clients from the internet.
  • 25. Protected View: DDE ◦ Dynamic Data Exchange ▫ Allows command execution ▫ It is a feature! ◦ Widely used by ITW malware, such as Locky ◦ The Response?
  • 27.
  • 28. Office 2016 ◦ Some things are GREAT ◦ Others, not so much ◦ Sometimes, it’s the simple things that can make a huge difference
  • 30. Anti-Malware Scan Interface ◦ Standard interface for hooking scripting engines (WSH/PowerShell,VBA) ◦ Helps facilitate detecting “in-memory” attacks executed through Scripting Languages
  • 32. Anti-Malware Scan Interface ◦ AMSI bypass == AV-free code-execution ◦ Many exist ◦ Do we report these? Or do we save time and publically disclose with mitigation options? ▫ Attack service can get overwhelming...
  • 33. Example: COM Hijacking ◦ Hijacks the AMSI COM server via the registry ◦ Process calls CoCreateInstance() to instantiate the AMSI COM component ◦ Calling process == Medium integrity level ▫ This results in searching HKCU for the COM server
  • 34.
  • 36. Anti-Malware Scan Interface ◦ Is this a “boundary”? ▫ No. ◦ Is this a hurdle (some) attackers have to jump over? ▫ Yes. A massive one. ◦ Do security vendors take a dependency on AMSI? ▫ Yes.
  • 37. Anti-Malware Scan Interface ◦ This is where things get weird. ▫ Vendors can’t fix everything ◦ How do you defend against a process that has full access to its own memory space? ◦ People need to defend themselves… ▫ Constrained Language Mode, Application Whitelisting, etc.
  • 39. Example: AMSI DLL Hijack ◦ The AMSI DLL isn’t loaded from a safe location ▫ So, it uses the default Windows search order ◦ Load scripting engine from place you control, drop fake AMSI DLL in same directory ▫ Blogged about by @Cneelis ▫ Stop letting low-rep binaries execute/load
  • 40.
  • 41. Anti-Malware Scan Interface ◦ So, some of them were fixed and some were not ▫ Why not fix all those that are possible? (is it cost?) ◦ This raises the bar for an attacker ▫ They will rely on techniques such as reflection (PowerShell) ▫ Makes logging these bypasses (in WMF 5) trivial ◦ Combine these fixes with CLM/AWL
  • 43. User Account Control ◦ Designed to break out administrative and standard user rights ◦ Explicitly stated it isn’t a boundary ▫ I completely agree ◦ Yet, it is a barrier that already elevated attackers have to get around ▫ Why not make it harder?
  • 44. User Account Control ◦ UAC has a MASSIVE attack surface ▫ It is hard to keep up on it ◦ UAC bypasses were introduced in 2009 and didn’t start to get fixed until 2016… ▫ But things are getting better!!
  • 45. Example: UAC Bypass via EventVwr ◦ Eventvwr.exe starts mmc.exe with the Event Viewer MSC snap-in ▫ How does it know what binary handles .msc files? ◦ Looks in HKCU for it :-) ◦ Hijack that and you have the ability to elevate without user interaction
  • 46. Example: UAC Bypass via EventVwr
  • 47. Example: UAC Bypass via EventVwr
  • 48. Example: UAC Bypass via EventVwr ◦ Populating that key with a binary + parameters == code execution ◦ Malware authors ate this one up… ◦ Great example: UAC isn’t a boundary, yet attackers care a lot about it ▫ Why not fix it?
  • 50. Example: UAC Bypass via EventVwr ◦ As mentioned before, things are getting better... http://www.winhelponline.com/blog/microsoft-fixes-eventvwr-exe-uac-bypass-exploit-windows-10-creators-update/
  • 51. User Account Control ◦ Please keep it up! ◦ Many UAC bypasses have been fixed ▫ Many have not… ◦ We know it isn’t trivial ▫ It makes attacker life suck, though
  • 53. Device Guard ◦ The best application whitelisting solution to date ▫ But doesn’t scale…yet. ◦ You define what you trust in a CI policy ▫ Certificates, hashes, etc. ▫ Both Kernel and Usermode ◦ Requires a bypass to run unsigned code that isn’t in allowed via the policy
  • 54. Device Guard ◦ Is this a hurdle that (some) attackers have to jump over? ▫ Absolutely ◦ Bypasses are *usually* serviced with CVEs ◦ Some bugs are not though (.NET) ▫ Why not??
  • 55. Device Guard ◦ The difference: Device Guard makes a security guarantee ▫ If you have a policy deployed, code that doesn’t conform to that policy can’t run ◦ If you break that guarantee, it gets a CVE ▫ Usually… ▫ http://www.exploit-monday.com/2017/07/bypassing-device-guard-with-dotnet- methods.html
  • 56. Case Study: CVE-2017-0007 ◦ UMCI in Device Guard didn’t properly validate the call when checking a file’s integrity ◦ Normally, an unsigned file should be prevented from executing
  • 57.
  • 58. Case Study: CVE-2017-0007 ◦ So, what happens if we take an embedded signature block from a Microsoft signed file and apply it to our own?
  • 59.
  • 60. Case Study: CVE-2017-0007 ◦ As you can see, the digital signature of that file did not validate ▫ This is expected ◦ Since that file is not legitimately signed and doesn’t pass integrity checks, UMCI should block it ▫ Right?
  • 61.
  • 63. This Problem Isn’t Trivial ◦ How can you fix everything? ▫ It isn’t practical ◦ Security Feature bypasses take a very low precedence ◦ Ideally, organizations would wake up and use all the latest and greatest ▫ WDATP, ATA, etc.
  • 64. Call to Action ◦ Attackers are going to bypass these features regardless of their “fix” priority ◦ Vendors & Defensive teams will be left scrambling to write detections for these bypasses ◦ Perform internal research
  • 65. Call to Action ◦ Consider raising the service bar ▫ Doesn’t have to be a CVE; DiD fixes work too! ◦ Issue fixes consistently ◦ No fix? Issue mitigation options ◦ Communicate with researchers! ▫ Explain the reason for not fixing instead of “It just isn’t a security boundary”
  • 66. Shoutouts ◦ Special thanks to Nate Warfield (MSRC), Lee Holmes (Azure), Scott Anderson (Device Guard), Tom Gallagher (Office) & Ryan Kivett!

Editor's Notes

  1. Relevant: How the real world works
  2. The purpose is to start a conversation
  3. People don’t like to talk about it
  4. Going to cover things done right, features abused ITW and things serviced.
  5. Status: Fixed
  6. Status: Fixed
  7. Shout out the office team
  8. Shout out the office team
  9. Insider builds of office have bounties for PV sandbox escapes Status: Not Fixed Why worry about that if not all files trigger the sandbox?
  10. Shout out the office team
  11. Shout out the office team
  12. DDE recommendations were published which is AWESOME DDE is just 1 technique non-PV enrolled files can use. Why not enroll them?
  13. Shout out the office team
  14. These are questions researchers are wondering
  15. What do we report? What do we not?
  16. These are questions researchers are wondering
  17. Status: Fixed in insider preview build
  18. What happens when a component other vendors rely on are easily bypassed? Are you on the hook to fix?
  19. These are questions researchers are wondering
  20. Some things you can’t fix, which is fine. Why not fix the things you can?
  21. These are questions researchers are wondering
  22. These are questions researchers are wondering
  23. Fixing the AMSI bypasses you can forces attackers to use ones like reflection, which forces them to go against various controls.
  24. These are questions researchers are wondering
  25. These are questions researchers are wondering
  26. These are questions researchers are wondering
  27. These are questions researchers are wondering
  28. These are questions researchers are wondering
  29. These are questions researchers are wondering
  30. These are questions researchers are wondering
  31. These are questions researchers are wondering
  32. These are questions researchers are wondering
  33. These are questions researchers are wondering
  34. These are questions researchers are wondering
  35. These are questions researchers are wondering Admin vectors
  36. These are questions researchers are wondering
  37. These are questions researchers are wondering
  38. These are questions researchers are wondering
  39. These are questions researchers are wondering
  40. These are questions researchers are wondering
  41. CheckValidSignature return code isn’t validated
  42. There are obviously costs associated with fixing things. How do we know what to report?
  43. These are questions researchers are wondering
  44. These are questions researchers are wondering
  45. These are questions researchers are wondering