For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cobalt Strike

Run as a daemon:

/etc/systemd/system/cobaltstrike.service
[Unit]
Description=CobaltStrike
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=on-failure
RestartSec=3
User=root
ExecStart=/opt/CobaltStrike/start.sh

[Install]
WantedBy=multi-user.target
/opt/CobaltStrike/start.sh
#!/bin/bash

CS_IP=`hostname -I | awk '{print $1}'`
CS_PASS='Passw0rd1!'
CS_PATH='/opt/CobaltStrike'

rm -{f} "${CS_PATH}/Profiles/random_c2_profile/output/*.profile"
CS_PROFILE=`cd "${CS_PATH}/Profiles/random_c2_profile"; python3 ./random_c2profile.py | tail -1 | awk -F/ '{print $2}'`

if [ ! -f "${CS_PATH}/cobaltstrike.store" ]; then
        /usr/bin/keytool -keystore ./cobaltstrike.store -storepass 'Passw0rd2!' -keypass 'Passw0rd2!' -genkey -keyalg RSA -alias cobaltstrike -dname 'CN=google.com, O=Google Inc, L=Mountain View, ST=California, C=US'
fi

${CS_PATH}/TeamServerImage -Dcobaltstrike.server_port=1337 -Dcobaltstrike.server_bindto="${CS_IP}" -Djavax.net.ssl.keyStore=./cobaltstrike.store -Djavax.net.ssl.keyStorePassword='Passw0rd2!' teamserver "${CS_IP}" "${CS_PASS}" "${CS_PATH}/Profiles/random_c2_profile/output/${CS_PROFILE}"

Malleable C2 Profiles

SourcePoint

Aggressor Scripts

Community Kit

P2P Beacons

Beacon TCP and Beacon SMB are Peer-to-Peer beacons which means they're used to chain a connection to an existent beacon. They act like bind shells and waits for the attacker to connect to them.

Connect to a TCP beacon:

Connect to an SMB beacon:

DNS Beacons

Create an A record ns66.example.com pointing to IP address of the redirector and then an NS record pointing to ns66.example.com.

socat Redirector

On the redirector:

On the team server:

iptables Redirector

DNSMasq Redirector

Overpass-the-Hash

More opsec PtH than builtin pth command (which does the Mimikatz sekurlsa::pth thing with named pipe impersonation):

Same with Rubeus (must be in elevated context):

Use Rubeus with lower privileges:

Pass-the-Ticket

Create a sacrificial process, import the TGT into its logon session and steal its security token:

Pivoting

Make any traffic hitting port 8443 on Victim to be redirected to 10.10.13.37 on port 443 (traffic flows through the team server):

Make any traffic hitting port 8080 on Victim to be redirected to localhost:80 on Attacker (traffic flows through the CS client):

Forward SOCKS server's port from team server to the client:

Credentials

DPAPI

List credential blobs:

List vault credentials:

Check which master keys correspond to credential blobs (look for guidMasterKey field with GUID):

The master key is stored here:

Decrypt the master key via RPC on the Domain Controller and show it:

Decrypt the blob with decrypted master key:

Evasion

Sleep Mask

Shellcode In-Memory Fluctuation (Obfuscate and Sleep)

Detection

Last updated