Skip to content
Write-up Advanced

Bypassing CrowdStrike Endpoint Detection and Response

A red team operator found that CrowdStrike blocked a basic shellcode loader that used VirtualAlloc and CreateThread, so they rewrote it to inject code via NtMapViewOfSection and NtQueueApcThread, which bypassed prevention. The MSBuild launch still raised a detection alert, but the shell was allowed to run.

redcursor.com.au

Published on redcursor.com.au

In a recent engagement I had to compromise a hardened desktop running CrowdStrike and Symantec Endpoint Protection. The initial code execution method was my reliable favourite MSBuild (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe) which could be leveraged to execute C# code as an inline task.

Red Cursor, on redcursor.com.au

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the endpoint product's prevention rules covered the common memory-allocation and thread-creation pattern but not the less common section-mapping and APC-queueing pattern.

Impact

An attacker with a way to run code on the host could execute a beacon despite the endpoint product, though the MSBuild launch still generated a detection alert.

What the attacker needed

Ability to run code on the host; MSBuild available on the target

How it was found

  1. Launch code execution through the MSBuild executable as an inline task.
  2. Run a loader that decrypts shellcode with a brute-force XOR routine.
  3. Observe CrowdStrike blocking the VirtualAlloc and CreateThread approach.
  4. Rewrite the loader to map a section and queue an APC using the undocumented functions.
  5. Run the new loader and confirm prevention is bypassed, with only a detection alert.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Endpoint detection software watches programs for behaviour that looks like malware, such as reserving memory and starting a new thread to run hidden code. The author changed the way the hidden code was launched to use less common Windows functions, which the product did not block. This is a red team write-up about evading a security product, not a bug in a website or app.

Similar reports

Same bug class and techniques, clearest first.