• Stars
    star
    159
  • Rank 235,916 (Top 5 %)
  • Language
    C
  • Created over 3 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Combining Sealighter with unpatched exploits to run the Threat-Intelligence ETW Provider

Sealighter-TI

Combining Sealighter with unpatched exploits and PPLDump to run the Microsoft-Windows-Threat-Intelligence ETW Provider without a signed driver.

NOTE

The PPLDump exploit is patched on Windows 10 v21H2 Build 19044.1826 and upwards. You can know more about it here and here.

For a similar solution, see my blog on using Vulnerable Drivers for the same purpose.

Overview

The Problem - PPL and Anti-Malware

The Microsoft-Windows-Threat-Intelligence ETW Provider is an excellent tool to detect process injection, and other type of attacks. Unlike usermode hooking or in-process ETW Providers, avoiding or tampering with the Threat-Intelligence is very difficult.

However, to subscribe to this Provider requires a process with very special privileges, marked as Protected Process Light (PPL) 'Anti-Malware' or higher. To legitimately run a program at this level you must submit a driver to Microsoft to be co-signed by them, something not everyone has the inclination or reputation to do.

I originally created a research project named PPLRunner that would allow you create PPL process in a test environment, however it requires Windows to be put into a debug or 'test signing' mode. This could in theory also have the effect of altering the behaviour of the malware or program you are attempting to analyse, which may behave differently if it believes it is not on a 'real' machine.

The Solution - Exploit to success

Back in 2018 Alex Ionescu and James Forshaw presented a series of talks, as well as some blogs, covering many ways you could trick Windows into illegitimately running arbitrary code at the PPL level. A number of these techniques remain unpatched to this day.

In 2021 Clément Labro created the project PPLDump, which uses one of the unpatched techniques Alex and James covered, to trick a PPL-elevated services.exe into loading an arbitrary DLL.

The Glue - SealighterTI

PPLDump uses its elevated access to dump the memory of lsass.exe. I've taken Clément's awesome code, and instead combined it with my ETW Logging tool Sealighter, to enable you to get events from the Microsoft-Windows-Threat-Intelligence logging to the Windows Event Log. This is possible from a 'production' machine, without the need for a signed driver or to put the machine into 'test signing' mode.

To Build

To use pre-built binaries, download the SealighterTI.exe and sealigher_provider.man from The Releases Page.

To build manually, first check out the source code (make sure to use --recursive):

git clone --recursive https://github.com/pathtofile/SealighterTI.git

Then build SealighterTI.sln

In most circumstances, only the 'Release' Build will actually inject successfully, so build and use that for 99% of cases

To Run

First, move the SealighterTI.exe binary to somewhere accessible by all users, e.g. C:\Program Files. Then open up the sealigher_provider.man in a text editor, and replace all uses of !!SEALIGHTER_LOCATION!! with the full path to the SealighterTI.exe binary. Then from an elevated command prompt run:

wevtutil im path/to/sealigher_provider.man

Then just run SealighterTI.exe. For the first run, I recommend running with the debug flag:

SealighterTI.exe -d

For the first run I also recommend having a copy of Sysinternal's DBGView open with the "Capture Global Win32" option set, so you can see the debug logs from the DLL/PPL Process as well. If run correctly It should look like this: Pic of Code Running

Once it gets to "press ctrl+c to stop" Open Event Viewer, and you should see events under 'Application and Service Logs/Sealighter/Operational': Pic of Event Log

To stop the trace, press 'ctrl+c' in the SealighterTI.exe window.

Technical Details

See this blog for the technical details about how everything works.

The code has lots of 'PPLDump' files and functions?

Yep, I chose to fork PPLDump and alter only the parts I needed to in order to get the ETW Trace working. This is both to ensure people know the exploit parts of the code are courtesy of Clément Labro, but also to make it easy if PPLDump gets updated with any bug fixes I may want to also pull into Sealighter-TI.

Compatibility

This has only been tested on Windows 10 x64.

Acknowledgements

All of the work to run arbitrary code as PPL is the work of Clément Labro and their PPLDump project. I simply worked on glueing the ETW Logging to the end of it.

The Research from Alex Ionescu and James Forshaw is instrumental in making this project possible.

Filip Olszak has written a great blog about the usefulness of the Threat-Intelligence ETW Provider.

Further Reading/Links

More Repositories

1

bad-bpf

A collection of eBPF programs demonstrating bad behavior, presented at DEF CON 29
C
530
star
2

Sealighter

Sysmon-Like research tool for ETW
C++
328
star
3

PPLRunner

Run Processes as PPL with ELAM
C
141
star
4

bpf-hookdetect

Dectect syscall hooking using eBPF
C
139
star
5

siemcraft

Security Information and Event Management in Minecraft
Go
115
star
6

commandline_cloaking

A collection of projects demonstrating various commandline cloaking techniques on Linux
Go
53
star
7

bpf-pipesnoop

Example program using eBPF to log data being based in using shell pipes
C
40
star
8

toucli

Use TouchID and the Secure Enclave to encrypt data from the commandline.
Swift
15
star
9

SimpleAmsiProvider

A simple provider to analyse what gets passed into Microsoft's Anti-Malware Scan Interface
C++
13
star
10

tf_wireguard

Simple Terraform Scripts to setup a WireGuard server on various cloud providers.
HCL
11
star
11

https.server

Python SimpleHTTPServer wrapped in TLS
Python
8
star
12

bpf-uprobedbg

C
7
star
13

ctlwatcher

Monitor Certificate Transparency logs for domains matching regexes.
Rust
6
star
14

ld_preload_go

Simple example of creating an `LD_PRELOAD` library in Go that hooks LibC's main function.
Go
5
star
15

ebpf-pinned-fentry

Example how to run eBPF probes without a usermode process using fentry
C
3
star
16

Presentations

A Repo to hold slides from presentations, etc.
3
star
17

cookiecache

Simplify getting and using cookies from the browser to use in Python.
Python
3
star
18

dockenv

Dockenv - Run python in docker the easy way
Python
2
star
19

etwRunner

Basic KrabsETW runner template
C++
2
star
20

terraform-provider-bitlaunch

BitLaunch Terraform Provider
Go
2
star
21

pyauditlogger

Auto-Add Python 3.8 audit hooks to all python scripts
Python
1
star
22

hijack-watcher

Rust version of HijackWatcher
Rust
1
star
23

etw_watcher

Using GitHub Actions to create commit diffs
PowerShell
1
star
24

PowerInject

Inject Interactive PowerShell into an arbitrary process
C
1
star
25

sigstore-watcher

Watches SigStore Code Signing Logs
Rust
1
star
26

sgproxy

Basic HTTP/S proxy. Created to add HTTP Auth to a request from a client that doesn't support supplying auth in URL, for example VScode's Juypyter Notebook Server browser.
Go
1
star
27

Puppeteer-Stealth-Docker

This is a simple example of how do stealthy headless chrome webscraping from a Docker container.
Dockerfile
1
star