I. OVERVIEW
Endpoint Detection and Response (EDR) always provides strong protection for its executable file locations. If an attacker can interfere with these locations, they can prevent the EDR from functioning or inject code into the EDR itself to stay under the radar.
In this article, I will demonstrate the technique of exploiting the Bind Filter driver (bindflt.sys) to redirect folders containing the executable files of EDRs to a location that I completely control. Here, we can block or inject code into the EDR at will. Everything will be executed in user mode without needing kernel privileges through the Bring Your Own Vulnerable Driver (BYOVD) attack. Additionally, I will use the Cloud Filter driver (cldflt.sys) to completely isolate an antivirus.
I will conduct a practical experiment in this article using Windows Defender. I have also tried this technique with two other commercial EDRs, and it was successful with all of them.
Find me on X to get the latest pentest and red team tricks that I've been researching: Two Seven One Three (@TwoSevenOneT) / X
Privacy Screen Protector for iPhone
High Privacy: Keeps your personal, private, and sensitive information hidden from strangers, screen is only visible to persons directly in front of screen.
II. BODY
1. Introduction To The Bind Link Feature Of Windows
The Windows Bind Link is part of a newer feature introduced in Windows 11 (starting with version 24H2) that enables filesystem namespace redirection using a virtual path
A bind link allows administrators to map a virtual path on the local system to a backing path, either local or remote, without physically copying files. This is handled by the Bind Filter driver (bindflt.sys).
- Virtual Path Mapping: Redirects file system access from a virtual path to a real path.
- Transparent to Applications: Apps don’t need to be aware of the redirection; they operate as if files are local.
- Security Inheritance: Permissions and security descriptors from the backing path are extended to the virtual path.
- No Physical Files Created: The virtual path doesn’t create actual files or folders, just a logical mapping.
2. Redirecting the EDR executable folder with EDR-Redir
As mentioned above, you can simply understand that bind link functions similarly to a symbolic link for folders. The difference is that it operates at the minifilter driver level.
Current EDRs are also very vigilant against the symbolic link redirect attack technique. They check files thoroughly before opening or do not follow symlinks. Additionally, they use RedirectionGuard to mitigate unsafe junctions and symlink traversal. It blocks privileged services from following symlinks unless explicitly allowed.
The most important thing is that you will not be able to write files into the folders containing the executable files of the EDR, unless you have kernel privileges or exploit the EDR software to execute code within its processes.
But what if we can move the executable folder of the EDR to another location, as I have done with Windows Defender ?
The challenge here is that when the EDR is active, we have limited options with its executable folders. Even when the EDR service processes are not running, these folders remain protected by the EDR's minifilter.
But everything changes when the bind link comes into play.
2.1 Introduction to the EDR-Redir tool
EDR-Redir is a simple tool that creates a virtual path pointing to a real path. You can download it at the following link:
https://github.com/TwoSevenOneT/EDR-Redir
It has very simple running parameters.
EDR-Redir.exe bind c:\TMP\123 c:\TMP\4562.2 Experimenting EDR-Redir with Windows Defender
2.3 EDR-Redir vs Elastic Defend
2.4 EDR-Redir vs Sophos Intercept X
2.5 Windows Defender and Cloud Files API
3. Demo Video
III. ENDING
IV. READING
Some books you should read to sharpen your cybersecurity skills, especially in offensive security:
Books on Programming and Cybersecurity recommended by Zero Salarium Researchers
Author of the article: Two Seven One Three

Comments
Post a Comment