• Stars
    star
    218
  • Rank 181,805 (Top 4 %)
  • Language
    C
  • License
    MIT License
  • Created almost 3 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CobaltWhispers is an aggressor script that utilizes a collection of Beacon Object Files (BOF) for Cobalt Strike to perform process injection, persistence and more, leveraging direct syscalls (SysWhispers2) to bypass EDR/AV

CobaltWhispers

Author: @Cerbersec

CobaltWhispers is an aggressor script that utilizes a collection of Beacon Object Files for Cobalt Strike to perform process injection, persistence and more, leveraging direct syscalls to bypass EDR/AV.

CobaltWhispers is powered by SysWhispers2 and InlineWhispers2
CobaltWhispers is based on StayKit and work from Hasherezade and Forrest Orr.

CobaltWhispers was made as part of an internship at NVISO Security's Red Team. The associated blogposts can be found here (process-injection) and here (kernel karnage).

Compiling from source

CobaltWhispers requires several tools to compile:

Each project requires 3 files generated by SysWhispers2 / InlineWhispers2 to function:

  • syscalls-asm.h
  • syscalls.c
  • syscalls.h

These files can be generated according to the InlineWhispers2 documentation, however this is not the optimal method because a lot of unused code will be included:

git clone https://github.com/Sh0ckFR/InlineWhispers2 && cd InlineWhispers2
cd SysWhispers2/ && python3 syswhispers.py --preset all -o syscalls_all && cd ..
python3 InlineWhispers2.py

Instead, use SysWhispers2 to generate the output files only for the necessary APIs, then manually (or script it) supply them to InlineWhispers2 which will convert them to the proper format. See the included makefile for additional information or use the included files at your own risk.

Injection

SpawnProcess

Payload Type Target Reliability (0-5) Elevated Remarks
- - 5 No Inherit permissions from parent process

Description

Spawns a new suspended process with Code Integrity Guard (CIG) enabled to block non-Microsoft signed binaries. Spoofs the specified parent process. The PID is returned.

Parameters

Parent process: The name of the process to set as parent
Executable location: Full path to executable on disk used to spawn new process


CreateRemoteThread

Payload Type Target Reliability (0-5) Elevated Remarks
Shellcode/Raw PID 5 No -

Description

Injects a payload into a remote process using NtCreateThreadEx

Parameters

Process PID: The process ID of the remote process
Payload location: Location of payload in binary form on disk (Conditional | Optional)
Payload b64: Raw shellcode in base64 encoded string format (Conditional | Optional)
Listener: Listener to generate payload for (Conditional)

A listener should be specified to generate a Beacon payload. If a manual payload is desired, it should be provided via a path to the raw binary on disk, or Base64 encoded shellcode.


QueueUserAPC

Payload Type Target Reliability (0-5) Elevated Remarks
Shellcode/Raw PID 2 No Potentially crash target process

Description

Injects a payload into a remote process using NtQueueApcThread

Parameters

Process PID: The process ID of the remote process
Threads: Number of threads to add an APC call to
Payload location: Location of payload in binary form on disk (Conditional | Optional)
Payload b64: Raw shellcode in base64 encoded string format (Conditional | Optional)
Listener: Listener to generate payload for (Conditional)

A listener should be specified to generate a Beacon payload. If a manual payload is desired, it should be provided via a path to the raw binary on disk, or Base64 encoded shellcode.


MapViewOfSection

Payload Type Target Reliability (0-5) Elevated Remarks
Shellcode/Raw Surrogate Process 5 No -

Description

Injects a payload into a surrogate process using NtMapViewOfSection

Parameters

Parent process: The name of the process to set as parent
Executable location: The location of the executable on disk to be used to spawn a new process
Payload location: Location of payload in binary form on disk (Conditional | Optional)
Payload b64: Raw shellcode in base64 encoded string format (Conditional | Optional)
Listener: Listener to generate payload for (Conditional)

A listener should be specified to generate a Beacon payload. If a manual payload is desired, it should be provided via a path to the raw binary on disk, or Base64 encoded shellcode.


TransactedHollowing

Payload Type Target Reliability (0-5) Elevated Remarks
PE Surrogate Process 5 No Requires x64 PE payload

Description

Injects a payload into a surrogate process using transacted sections and mapped views. Remote entry point and PEB are updated, no anomalous memory sections or memory permissions. See here for more information.

Parameters

Parent process: The name of the process to set as parent
Executable location: The location of the executable on disk to be used to spawn a new process
Payload location: Location of x64 PE payload on disk (Conditional | Optional)
Payload b64: x64 PE payload in base64 encoded string format (Conditional | Optional)
Listener: Listener to generate payload for (Conditional)

A listener should be specified to generate a Beacon payload. If a manual payload is desired, it should be provided via a path to the x64 PE on disk, or Base64 encoded x64 PE.


PhantomDLLHollowing

CURRENTLY NOT IMPLEMENTED

Payload Type Target Reliability (0-5) Elevated Remarks
Position Independent Shellcode (PIC) Surrogate Process 5 Yes Elevated permissions are required to open system DLLs with write permissions

Description

Injects a payload into a surrogate process using transacted sections in combination with DLL hollowing. See here for more information.

Parameters

Parent process: The name of the process to set as parent
Executable location: The location of the executable on disk to be used to spawn a new process
Payload location: Location of payload in binary form on disk (Conditional | Optional)
Payload b64: Raw shellcode in base64 encoded string format (Conditional | Optional)
Listener: Listener to generate payload for (Conditional)

A listener should be specified to generate a Beacon payload. If a manual payload is desired, it should be provided via a path to the raw binary on disk, or Base64 encoded shellcode.


Persistence

ElevatedRegKey

Description

Create or modify a registry key at the specified location.

  • HKLM:Software\Microsoft\Windows\CurrentVersion\Run
  • HKLM:Software\Microsoft\Windows\CurrentVersion\RunOnce

Parameters

Key name: Value name
Command: Command to be ran when registry is used
Registry key: Location where registry key will be created
Hidden: Will prepend a null byte to the key name; throws errors in regedit
Cleanup: Removes created key

Cleanup requires the key name and registry key (location).


ElevatedUserInitRegKey

Description

Create or modify a registry key at the specified location.

  • HKLM:Software\Microsoft\Windows NT\CurrentVersion\Winlogon [UserInit]

Parameters

Key name: Value name
Command: Command to be ran when registry is used
Registry key: Location where registry key will be created
Hidden: Will prepend a null byte to the key name; throws errors in regedit
Cleanup: Removes created key

Cleanup requires the key name and registry key (location).
UserInit: Automatically sets 'Key name' and 'Registry key'.


UserRegKey

Description

Create or modify a registry key at the specified location.

  • HKCU:Software\Microsoft\Windows\CurrentVersion\Run
  • HKCU:Software\Microsoft\Windows\CurrentVersion\RunOnce

Parameters

Key name: Value name
Command: Command to be ran when registry is used
Registry key: Location where registry key will be created
Hidden: Will prepend a null byte to the key name; throws errors in regedit
Cleanup: Removes created key

Cleanup requires the key name and registry key (location).


UserInitMprRegKey

Description

Create or modify a registry key at the specified location.

  • HKCU:Environment [UserInitMprLogonScript]

Parameters

Key name: Value name
Command: Command to be ran when registry is used
Registry key: Location where registry key will be created
Hidden: Will prepend a null byte to the key name; throws errors in regedit
Cleanup: Removes created key

Cleanup requires the key name and registry key (location).
UserInitMprLogonScript: Automatically sets 'Key name'and 'Registry key'.


Scheduled Task COM Hijack

Description

Hijacks a scheduled task's COM handler. Creates a registry key at HKCU:\Software\Classes\CLSID\\InprocServer32 which points to a DLL.

Parameters

Class ID: The CLSID that corresponds to the task's COM handler CLSID
DLL path: Path to DLL that is to be loaded
Cleanup: Removes created key


Drivers

DisableDSE

Reliability (0-5) Elevated Remarks
4 Yes Can potentially BSOD target system

Description

Loads a vulnerable signed driver with arbitrary kernel memory read/write (NalDrv/iqvm64.sys). Changes the ntoskrnl.exe g_CiEnabled or CI.dll g_CiOptions flag to disable Driver Signature Enforcement (DSE).
Loads a non-signed driver (Interceptor/Interceptor.sys), then restores the DSE flag values. Both the signed driver and non-signed driver are written to disk.

Driver MD5 checksum
iqvm64.sys 1898ceda3247213c084f43637ef163b3
Interceptor.sys 508c8943359717cfa0c77b61ebea2118

Parameters

Vulnerable driver location: Location of vulnerable signed driver in binary form on disk
Malicious driver location: Location of the malicious non-signed driver in binary form on disk
Vulnerable driver name: name used to create the registry key '\Registry\Machine\System\CurrentControlSet\Services\'
Vulnerable driver device name: name used to contact the driver '\DosDevices\'
Malicious driver name: name used to create the registry key '\Registry\Machine\System\CurrentControlSet\Services\'
Malicious driver device name: name used to contact the driver '\DosDevices\'
Target path: temporary path to write the vulnerable and malicious driver files to


UnloadDriver

Reliability (0-5) Elevated Remarks
5 Yes -

Description

Unloads a driver on the target using the provided registry key and deletes the binary from disk at the specified path.

Parameters

Driver registry key: registry key used to unload driver '\Registry\Machine\System\CurrentControlSet\Services\'
Driver installation path: location of driver on disk


Intercept

Reliability (0-5) Elevated Remarks
4 No Can potentially BSOD target system

Description

Information: Query the Interceptor driver
Hook: Hook the target driver's major functions (IRP)
Unhook: Restore the target driver's major functions
Patch: Patch the target kernel callbacks
Restore: Restore the target kernel callbacks

Parameters: Information

Vendors: display supported vendors
Modules: query all loaded drivers
Hooked modules: display all hooked drivers
Callbacks: query all registered callbacks

Parameters: Hook

Index: hook a driver by index (see: information - modules)
Name: hook a driver by device name (\Device\Name)
Values: comma separated list of indexes (conditional)
Name: device name of the target driver (conditional)

Values are required when 'Index' is selected. Name is required when 'Name' is selected.

Parameters: Unhook

Index: unhook a driver by index (see: information - hooked modules)
All: unhook all hooked drivers
Values: comma separated list of indexes (conditional)

Values is required when 'Index' is selected.

Parameters: Patch

Vendor: patch all callbacks associated with vendor module(s)
Module: patch all callbacks associated with module(s)
Process: patch process callback(s)
Thread: patch thread callback(s)
Image: patch image callback(s)
Registry: patch registry callback(s)
Object process: patch object process callbac(s)
Object thread: patch object thread callback(s)
Values: comma separated list of indexes (see: information - callbacks) (conditional)
Name: comma separated list of module names or single vendor name (see: information - vendors) (conditional)

Values is required when 'process', 'thread', 'image', 'registry', 'object process' or 'object thread' is selected. Name is required when 'vendor' or 'module' is selected.

Parameters: Restore

Vendor: restore all callbacks associated with vendor module(s)
Module: restore all callbacks associated with module(s)
Process: restore process callback(s)
Thread: restore thread callback(s)
Image: restore image callback(s)
Registry: restore registry callback(s)
Object process: restore object process callbac(s)
Object thread: restore object thread callback(s)
All: restore all callbacks
Values: comma separated list of indexes (see: information - callbacks) (conditional)
Name: comma separated list of module names or single vendor name (see: information - vendors) (conditional)

Values is required when 'process', 'thread', 'image', 'registry', 'object process' or 'object thread' is selected. Name is required when 'vendor' or 'module' is selected.


More Repositories

1

MagiskTrustUserCerts

A Magisk/KernelSU module that automatically adds user certificates to the system root CA store
Shell
1,519
star
2

posh-dsc-windows-hardening

Windows OS Hardening with PowerShell DSC
PowerShell
257
star
3

disable-flutter-tls-verification

A Frida script that disables Flutter's TLS verification
C++
241
star
4

ee-outliers

Open-source framework to detect outliers in Elasticsearch events
Python
205
star
5

binsnitch

Detect silent (unwanted) changes to files on your system
Python
153
star
6

pyCobaltHound

pyCobaltHound is an Aggressor script extension for Cobalt Strike which aims to provide a deep integration between Cobalt Strike and Bloodhound.
Python
136
star
7

frida-ios-playground

An iOS app that lets you practice your Frida skills
Swift
126
star
8

evtx-hunter

evtx-hunter helps to quickly spot interesting security-related activity in Windows Event Viewer (EVTX) files.
Python
125
star
9

Interceptor

Interceptor is a kernel driver focused on tampering with EDR/AV solutions in kernel space
C++
115
star
10

brown-bags

C#
108
star
11

IOXY

MQTT intercepting proxy
Go
97
star
12

decompile-py2exe

Decompile py2exe Python 3 generated EXEs
Python
92
star
13

DInvisibleRegistry

DInvisibleRegistry
C#
81
star
14

blogposts

A repo to house files for our blogposts on blog.nviso.eu
C++
60
star
15

cs2br-bof

C
59
star
16

codasm

Payload encoding utility to effectively lower payload entropy.
Python
53
star
17

cyber-security-llm-agents

A collection of agents that use Large Language Models (LLMs) to perform tasks common on our day to day jobs in cyber security.
Jupyter Notebook
52
star
18

nviso-cti

YARA
40
star
19

nexus_5_bootloader_unpacker

A bootloader imgdata unpacker for Nexus 4, 5 and 7 smartphones as well as imgdata tool for Nexus 5.
C
25
star
20

FileSearcher

C#
22
star
21

logalert.py

Smart piping of command output to email for alerting.
Python
21
star
22

DLLoader

C++
16
star
23

SEC599-Resources

16
star
24

SEC599

SEC599 supporting GitHub repository
Shell
15
star
25

VerifiedBootRPi3

Verified Boot for RPi3
14
star
26

cobalt-strike-notifier

Python
13
star
27

YARA

Repository of YARA rules developed by NVISO
11
star
28

ansible-velociraptor

Ansible role for Velociraptor EDR
9
star
29

cloud-security-automation

PowerShell scripts used in the "Incident response in the cloud/ foggy with a ray of sunshine" conference talk
PowerShell
8
star
30

ansible-sysmon

Ansible role for sysmon
7
star
31

ansible-auditbeat

Ansible role for auditbeat install
7
star
32

ansible-thehive

Ansible role for installing The Hive & Cortex
6
star
33

BitSight-Automation-Tool

BitSight Automation was developed to automate certain manual procedures and extract information such as ratings, assets, findings, etc. This tool also provides the possibility to collaborate with Scheduled Tasks and cronjobs.
Python
6
star
34

ansible-windowslogconfig

Ansible role for configuring Windows security logs
5
star
35

ansible-caldera

Ansible role for MITRE caldera
5
star
36

assemblyline-service-cape

Assemblyline service build for CAPE's API
Python
4
star
37

ansible-elk

Ansible role for ELK stack install
4
star
38

ansible-winlogbeat

Ansible role for WinLogBeat
4
star
39

assemblyline-service-python-exe-unpacker

Python exe unpacker service
Python
3
star
40

ansible-covenant

Ansible role for Covenant
3
star
41

assemblyline-service-urlscanio

URLScan.io AL service
Python
3
star
42

assemblyline-service-clamav

Assemblyline service which submits a file to ClamAV and displays the result
Python
2
star
43

assemblyline-service-msg-extractor

Simple MSG extractor AssemblyLine service
Python
2
star
44

ansible-nexusrepo

Ansible role for Nexus Repository OSS
2
star
45

assemblyline-service-steg-finder

AssemblyLine service which scans for embedded data in image using StegExpose
Python
2
star
46

assemblyline-service-malware-bazaar

Assemblyline service fetching Malware Bazaar report
Python
2
star
47

caldex

Caldera exportation plugin to the MITRE ATT&CKβ„’ Navigator.
Python
2
star
48

assemblyline-service-autoit-ripper

AutoIt unpacker service
Python
1
star
49

assemblyline-service-unfurl

Assemblyline service parsing a submitted URL to unshorten it.
Python
1
star
50

cortex.xsoar

The cortex.xsoar collection includes Ansible modules to help automate the management of Palo Alto Cortex XSOAR.
Python
1
star