Cobalt Strike Scan : Scan Files Or Process Memory For CobaltStrike Beacons & Parse Their Configuration

Scan files or process memory for Cobalt Strike beacons and parse their configuration.

CobaltStrikeScan scans Windows process memory for evidence of DLL injection (classic or reflective injection) and performs a YARA scan on the target process’ memory for Cobalt Strike v3 and v4 beacon signatures.

Alternatively, CobaltStrikeScan can perform the same YARA scan on a file supplied by absolute or relative path as a command-line argument.

If a Cobalt Strike beacon is detected in the file or process, the beacon’s configuration will be parsed and displayed to the console.

Cloning This Repo

CobaltStrikeScan contains GetInjectedThreads as a submodule. Ensure you use git clone --recursive https://github.com/Apr4h/CobaltStrikeScan.git when cloning CobaltStrikeScan so that the submodule’s code is also downloaded/cloned.

Building The Solution

Costura.Fody is configured to embed CobaltStrikeConfigParser.dll and GetInjectedThreads.dll in the compiled ConsoleUI.exe assembly. ConsoleUI.exe should then serve as a static, portable version of CobaltStrikeScan. For this to occur, ensure that the “Active Solution Platform” is set to x64 when building, and that the CobaltStrikeConfigParser and GetInjectedThreads projects are built before the ConsoleUI project is built, so that Costura.Fody can find the required DLLs to be embedded.

Acknowledgements

This project is inspired by the following research / articles:

Requirements

  • 64-bit Windows OS
  • .NET Framework 4.6
  • Administrator or SeDebugPrivilege is required to scan process memory for injected threads

Usage

-d, –dump-processes Dump process memory to file when injected threads are detected
-f, –scan-file Scan a file/process dump for CobaltStrike beacons
-i, –injected-threads Scan running (64-bit) processes for injected threads (won’t scan for CobaltStrike beacons)
-p, –scan-processes Scan running processes for injected threads and CobaltStrike beacons
-v, –verbose Write verbose output (display detailed information for injected threads)
-h, –help Display Help Message
–help Display this help screen.
–version Display version information.

Example

R K

Recent Posts

How to Check if a File Exists in Bash – Simply Explained

Why Do We Check Files in Bash? When writing a Bash script, you often work…

58 minutes ago

Bash Arrays Explained Simply: Beginner’s Guide with Examples

If you’re learning Bash scripting, one of the most useful features you’ll come across is…

24 hours ago

Bash For Loop Examples Explained Simply for Beginners

If you are new to Bash scripting or Linux shell scripting, one of the most…

1 day ago

How Does a Firewall Work Step by Step

How Does a Firewall Work Step by Step? What Is a Firewall and How Does…

3 days ago

ROADTools: The Modern Azure AD Exploration Framework

ROADTools is a powerful framework designed for exploring and interacting with Microsoft Azure Active Directory…

6 days ago

How to Enumerate Microsoft 365 Groups Using PowerShell and Python

Microsoft 365 Groups (also known as M365 Groups or Unified Groups) are at the heart…

6 days ago