CS-Aggressor-Kit
Homemade Aggressor scripts kit for Cobalt Strike


Description
This repository contains numerous CNA files (Aggressor Scripts) for Cobalt Strike, which are useful during a Red Team engagement.
This project created with ❤️ by @nickvourd.
Special thanks to Will Nowlan for all his contributions.
ℹ️ This tool has been selected and it is proudly part of the Cobalt Strike Community Kit.
Table of Contents
Summary
The following table illustrates all the CNA files included in this project:
| Section |
Name |
Description |
| Alert |
slack-alerts_linux.cna |
Slack CNA file for Linux CS client |
| Alert |
slack-alerts_windows.cna |
Slack CNA file for Windows CS client |
| Alert |
discord-alerts_linux.cna |
Discord CNA file for Linux CS Client |
| Alert |
teams-alerts_linux.cna |
Teams CNA file for Linux CS Client |
| Alert |
mattermost-alerts_linux.cna |
Mattermost CNA file for Linux CS Client |
| Alert |
mattermost-alerts_windows.cna |
Mattermost CNA file for Windows CS Client |
| Alert |
iMessage_MacOS.cna |
iMessage CNA file for MacOS CS Client |
| Alert |
Signal_linux.cna |
Signal CNA file for Linux/MacOS CS Client |
| Alert |
telegram-alerts_linux.cna |
Telegram CNA file for Linux/MacOS CS Client |
| Auto |
auto-sleep-on-start.cna |
This CNA file automatically sets the sleep time to a specific value when a new user joins the teamserver. It requires a client to remain open at all times, ensuring the sleep time is configured even if the Cobalt Strike client is closed or you forget to set it while away |
| Auto |
auto-sleep-on-exit.cna |
This CNA file automatically sets the sleep time to a specific value when all users, except one, disconnect from the teamserver. A client must remain open at all times |
| Auto |
auto-sleep-after-initial-access.cna |
This CNA file automatically configures the beacon’s sleep interval upon initial acccess |
| Auto |
auto-sleep-interactive-for-testing.cna |
This CNA file automatically set beacon sleep to 0 on initial connection |
| Misc |
Beacon-Name-Tab.cna |
This CNA file modifies the Beacon tab name format from the default to username@hostname (pid) |
| Misc |
Beacon-Name-Tab-Colors.cna |
This CNA file modifies the Beacon tab name format from the default to username@hostname (pid), for admin’s beacon the color is red, for user’s beacon the color is green |
| Misc |
CS-All-Tabs-Bold.cna |
This CNA file makes all CS client tabs bold |
| Misc |
CWD-Beacon-Bar.cna |
This CNA file enhances Beacon console status bar to display the Beacon’s last known working directory path. Additionally, improves the ‘cd’ command to support restoring the previous directory path seamlessly (Usage: cd -) |
| Misc |
Opsec.cna |
This CNA file allows and blocks default Cobalt Strike commands to improve the opsec. |
| SA |
File-Color.cna |
This CNA file outputs files in a colorful format for file hunting |
| SA |
PS-Color.cna |
This CNA file outputs proccess in a colorful format for process hunting |
| Utils |
Sonata.cna |
Sonata is a file hash calculator that supports MD5, SHA1, SHA256, and SHA512 algorithms. The CNA port enhances functionality by supporting string hash calculations as well |
| Utils |
locate.cna |
This CNA functions like the locate Linux command. Additionally, it performs case-insensitive keyword searches. This CNA requires a Linux CS client |
Alert
These CNA files will notify you via the Slack/Discord/Teams/Mattermost/Signal/iMessage/Telegram applications when:
- A new client connects to the team server.
- A CS client disconnects from the team server.
- A new incoming beacon.
- A new web hit occurs.
- A CS client posts something in the event log.
- New site hosts.
- New credentials come in from keylogging.
- A new screenshot is taken from Cobalt Strike.
:information_source: Some CNA files are compatible with Windows/Linux/MacOS operating systems.
The following table illustrates the CNA files included in the Alert section:
Setup Slack and Webhooks
:information_source: To set up a Slack server and webhook, you can follow these guides provided on the Slack website.
Setup Discord and Webhooks
:information_source: To set up a Discord server and webhook, you can follow these guides provided on the Discord website.
Setup Teams Webhooks
:information_source: To set up a Microsoft Teams webhook, you can follow these guides provided on Microsoft website.
Setup Mattermost Webhooks
:information_source: To set up a Mattermost webhook, you can follow these guides provided on Mattermost website.
Set Up iMessage Implementation
:information_source: To set up the iMessage implementation, you need to use a device with MacOS like Macbook Pro/Air or Mac mini.
brew install osascript
Set Up Signal Implementation
-> Full Digram Communication:
+------------------------------+
| Linux Host |
| |
| Cobalt Strike / CNA Script |
| (runs as root) |
| | |
| curl http://127.0.0.1:8080
| | |
+---------------|--------------+
|
Host port 8080 mapped to container port 8080
|
+---------------v--------------+
| Docker Container (signal) |
| Process user: signal-api |
| signal-cli REST API (8080) |
+------------------------------+
:information_source: In order to set up signal implementation, you need to do the following.
docker run -d \
--name signal \
-p 8080:8080 \
-v signal-data:/home/.local/share/signal-cli \
bbernhard/signal-cli-rest-api
docker exec -it signal bash


su - signal-api
signal-cli --config /home/.local/share/signal-cli -u <+your_number> register --captcha 'signalcaptcha://<LONG_TOKEN_VALUE>'
- Verify the number using the SMS code:
signal-cli --config /home/.local/share/signal-cli -u <+your_number> verify <verify_code>
- Then set your profile name:
signal-cli --config /home/.local/share/signal-cli -u <+your_number> updateProfile --name '<C2_BOT_NAME>' --about '<Description>'
- From outside the container send a test message:
curl -X POST http://127.0.0.1:8080/v2/send \
-H "Content-Type: application/json" \
-d '{
"number": "<+your_number>",
"recipients": ["<+receipt_number>"],
"message": "Test from Signal CLI REST API"
}'
Setup Telegram Implementation
:information_source: To set up the Telegram notifications, you need to create a new bot, you can follow these guides provided on Telegram website.
Alert CNA Output Examples
New incoming Beacon notification example (Slack):

New Web hit notification example (Discord):

New CS client connects to the teamserver notification example (Slack):

CS Client disconnects from the teamserver notification example (Discord):

CS Client hosts a file or clones a website notification example (Slack):

CS client posts something in the event log (Discord):

New credentials come in from keylogging (Discord):

New screenshot is taken from Cobalt Strike (Slack):

Auto
These CNA files automatically configure certain actions in Cobalt Strike.
The following table illustrates the CNA files included in the Auto section:
| Name |
Description |
| auto-sleep-on-start.cna |
This CNA file automatically sets the sleep time to a specific value when a new user joins the teamserver. It requires a client to remain open at all times |
| auto-sleep-on-exit.cna |
This CNA file automatically sets the sleep time to a specific value when all users, except one, disconnect from the teamserver. A client must remain open at all times |
| auto-sleep-interactive-for-testing.cna |
This CNA file automatically set beacon sleep to 0 on initial connection |
| auto-sleep-after-initial-access.cna |
This CNA file automatically configures the beacon’s sleep interval upon initial acccess |
How Auto Sleep Works
:information_source: The two auto-sleep CNA files can be used individually or together, depending on your preferences.
Diagram 1: The two Cobalt Srike clients are connected to the Team server.

Diagram 2: At the end of the day’s engagement tasks, the operators decide to stop the engagement. One operator, using a Cobalt Strike client without the CNA file, disconnects from the teamserver, while the other operator ensures his/her Cobalt Strike client with the CNA file (auto-sleep-on-exit.cna) remains open.

Diagram 3: The Cobalt Strike client with the CNA file will detect the user disconnection event and automatically adjust the sleep time to the predefined value specified in the CNA file.

Diagram 4: The next day, when the operator (with the Cobalt Strike client without the CNA file) connects to the Team Server, the always-open client with the loaded CNA file (auto-sleep-on-start.cna) will detect the new user connection. It will then automatically set the sleep time to the predefined value specified in the CNA file.

Auto Sleep Interactive For Testing
This CNA file automatically sets the beacon sleep interval to 0 upon initial connection, which is useful for testing purposes.

Auto Sleep After Initial Access
This CNA file automatically configures the beacon’s sleep interval upon initial acccess.
Misc
These CNA files will configure the output format for various default functionalities of Cobalt Strike.
The following table illustrates the CNA files included in the Misc section:
| Name |
Description |
| Beacon-Name-Tab.cna |
This CNA file modifies the Beacon tab name format from the default to username@hostname (pid) |
| Beacon-Name-Tab-Colors.cna |
This CNA file modifies the Beacon tab name format from the default to username@hostname (pid), for admin’s beacon the color is red, for user’s beacon the color is green |
| CS-All-Tabs-Bold.cna |
This CNA file makes all CS client tabs bold |
| CWD-Beacon-Bar.cna |
This CNA file enhances Beacon console status bar to display the Beacon’s last known working directory path. Additionally, improves the ‘cd’ command to support restoring the previous directory path seamlessly (Usage: cd -) |
Beacon Name Tab Example
This CNA file modifies the Beacon tab name format from the default to username@hostname (pid).

Beacon Name Tab Colors Example
This CNA file modifies the Beacon tab name format from the default to username@hostname (pid). For an Administrator’s Beacon, the tab color is set to red, while for a standard user’s Beacon, the tab color is set to green.

CS All Tabs Bold Example
This CNA file makes all Cobalt Strike client tabs bold.

CWD Beacon Bar Example
This CNA file enhances Beacon console status bar to display the Beacon’s last known working directory path.

Additionally, improves the ‘cd’ command to support restoring the previous directory path seamlessly (Usage: cd -).

Finally, when you have an Administrator’s Beacon, the hostname of the target machine changes from the CNA’s default green (used for standard users) to red.

Opsec Example
This CNA file allows and blocks default Cobalt Strike commands to improve the opsec.
SA
These CNA files are used for Situational Awareness.
The following table illustrates the CNA files included in the SA section:
| Name |
Description |
| File-Color.cna |
This CNA file outputs files in a colorful format for file hunting |
| PS-Color.cna |
This CNA file outputs proccess in a colorful format for process hunting |
File Color Example
This CNA file outputs files in a colorful format for file hunting.
- [*] Executable files listed in GREEN
- [*] System-Related files listed in PURPLE
- [*] Database files listed in YELLOW
- [*] Office related files listed in RED
- [*] Source Code files listed in CYAN
- [*] Media files listed in ORANGE
- [*] Directories listed in BLUE

Process Color Example
This CNA file outputs proccess in a colorful format for process hunting.
- [*] This Beacon PID: YELLOW (<beacon_pid>)
- [*] Windows Processes: GREEN
- [*] Security Products: RED

Utils
These CNA files are used for general micro tasks during operations.
The following table illustrates the CNA files included in the Utils section:
| Name |
Description |
| Sonata.cna |
This CNA file is a port of the Sonata tool. Sonata is a file hash calculator that supports MD5, SHA1, SHA256, and SHA512 algorithms. The CNA port enhances functionality by supporting string hash calculations as well |
| locate.cna |
This CNA functions like the locate Linux command. Additionally, it performs case-insensitive keyword searches. This CNA requires a Linux CS client |
Sonata Examples
Hash calculator for local files and strings.
Usage: Sonata -f/--file <local_filepath> OR Sonata -s/--string <string>
Sonata File

Sonata String

Locate Example
This CNA functions like the locate Linux command. Additionally, it performs case-insensitive keyword searches. This CNA requires a Linux CS client.
ℹ️ When you insert a new file on the host disk, it is recommended to run the updatedb command to update the file database and sync the system with the newly added files.

评论