Friends-Security / SharpExclusionFinder

Tool designed to find folder exclusions using Windows Defender using command line utility MpCmdRun.exe as a low privileged user, without relying on event logs
MIT License
166 stars 16 forks source link

SharpExclusionFinder

Overview

This C# program finds Windows Defender folder exclusions using Windows Defender through its command-line tool (MpCmdRun.exe). The program processes directories recursively, with configurable depth and thread usage, and outputs information about exclusions and scan progress.

The program allows you to:

Usage

Basic Command:

program.exe <BasePath> [options]

Options:

Example:

program.exe "C:\MyDirectory" --max-threads 5 --depth 3 --output scan_log.txt

This will scan C:\MyDirectory up to a depth of 3 subdirectories, using 5 threads, and log any exclusions or errors to scan_log.txt.

How It Works

A blog explaining the technique utilised can be viewed here - https://blog.fndsec.net/2024/10/04/uncovering-exclusion-paths-in-microsoft-defender-a-security-research-insight

Example Output

Processed 2000 directories. Time elapsed: 23.78 seconds.
[+] Folder C:\users\user\Example is excluded
Processed 2500 directories. Time elapsed: 30.77 seconds.

Prerequisites