Import CNA Scripts

Load Cobalt Strike Aggressor (CNA) scripts to extend NexusC2 with third-party BOF collections.

NexusC2 includes a CNA interpreter that allows you to load Cobalt Strike Aggressor scripts from popular BOF (Beacon Object File) collections. This enables you to use existing offensive tooling without modification.

What is CNA?

CNA (Cobalt Strike Aggressor) is a scripting language used by Cobalt Strike to extend its functionality. Many open-source BOF collections ship with CNA scripts that define:

  • Command registrations
  • BOF file locations
  • Argument packing formats
  • Help text and usage information

NexusC2 implements a subset of the CNA language focused specifically on BOF integration.

Supported CNA Features

The interpreter supports these CNA constructs:

FeatureDescription
beacon_command_registerRegister new commands with help text
beacon_inline_executeExecute BOF files
aliasDefine command aliases
bof_packPack arguments for BOF execution
readbofLoad BOF files relative to CNA script
iffBasic conditional logic
btask, blog, berrorLogging functions

Loading a CNA Script

Use the cna-load command to load a script:

cna-load /path/to/bof.cna

The interpreter will:

  1. Parse command registrations
  2. Extract alias definitions
  3. Map commands to their BOF implementations
  4. Auto-locate BOF files relative to the CNA script

Example: TrustedSec BOF Collection

The TrustedSec SA (Situational Awareness) BOF collection is a popular set of reconnaissance tools.

Setup

# Clone the repository
git clone https://github.com/trustedsec/CS-Situational-Awareness-BOF.git

# The CNA script is at the root
ls CS-Situational-Awareness-BOF/
# SA.cna  src/  ...

Load the Scripts

In your NexusC2 client, with an active Windows agent:

cna-load /path/to/CS-Situational-Awareness-BOF/SA.cna

Use the New Commands

After loading, the BOF commands become available:

# List network adapters
ipconfig

# List scheduled tasks
schtasksenum

# Enumerate local users
netLocalGroupList

# Check running AV products
enumLocalSessions

Listing Loaded Scripts

View all loaded CNA scripts and their commands:

cna-list

This displays:

  • Script file path
  • Number of commands registered
  • List of available commands from each script

Here are some compatible BOF collections:

CollectionDescriptionURL
TrustedSec SASituational awareness toolsGitHub
TrustedSec Remote OpsRemote operations BOFsGitHub
Outflank C2 Tool CollectionVarious offensive BOFsGitHub
BOF CollectionCommunity BOF compilationVarious sources

Troubleshooting

“BOF file not found”

The interpreter looks for BOF files relative to the CNA script location. Ensure the directory structure matches what the CNA script expects:

my-bofs/
├── bof.cna          # CNA script
├── src/
│   ├── tool1.x64.o  # x64 BOF
│   └── tool1.x86.o  # x86 BOF

“Command not registered”

Some CNA scripts use advanced features not yet supported. Check that the script uses supported constructs listed above.

“Unsupported CNA function”

The interpreter implements a subset focused on BOF loading. Functions like popup, menubar, or GUI-related features are not supported.

Script Persistence

Loaded CNA scripts are remembered between client sessions. When you restart the NexusC2 client, previously loaded scripts are automatically re-loaded.

To view persisted scripts, check:

  • Linux/macOS: ~/.config/nexus/cna_scripts.json
  • Windows: %APPDATA%\nexus\cna_scripts.json

Architecture Notes

  • CNA scripts are processed client-side in the NexusC2 GUI
  • BOF execution happens on the agent (target system)
  • Only Windows agents support BOF execution
  • x64 vs x86 BOF selection is automatic based on agent architecture
to navigate to select ESC to close
Powered by Pagefind