User Guide - Part 1

Welcome to Cobalt Strike

Cobalt Strike is a platform for adversary simulations and red team operations. The product is designed to execute targeted attacks and emulate the post-exploitation actions of advanced threat actors. This section describes the attack process supported by Cobalt Strike’s feature set. The rest of this manual discusses these features in detail.

Overview Cobalt Strike

A thought-out targeted attack begins with reconnaissance . Cobalt Strike’s system profiler is a web application that maps your target’s client-side attack surface. The insights gleaned from reconnaissance will help you understand which options have the best chance of success on your target.

Weaponization is pairing a post-exploitation payload with a document or exploit that will execute it on target. Cobalt Strike has options to turn common documents into weaponized artifacts. Cobalt Strike also has options to export its post-exploitation payload, Beacon, in a variety of formats for pairing with artifacts outside of this toolset.

Use Cobalt Strike’s spear phishing tool to deliver your weaponized document to one or more people in your target’s network. Cobalt Strike’s phishing tool repurposes saved emails into pixel- perfect phishes.

Control your target’s network with Cobalt Strike’s Beacon. This post-exploitation payload uses an asynchronouslow and slowcommunication pattern that’s common with advanced threat malware. Beacon will phone home over DNS, HTTP, or HTTPS. Beacon walks through common proxy configurations and calls home to multiple hosts to resist blocking.

Exercise your target’s attack attribution and analysis capability with Beacon’s Malleable Command and Control language. Reprogram Beacon to use network indicators that look like known malware or blend in with existing traffic.

Pivot into the compromised network, discover hosts, and move laterally with Beacon’s helpful automation and peer-to-peer communication over named pipes and TCP sockets. Cobalt Strike is optimized to capture trust relationships and enable lateral movement with captured credentials, password hashes, access tokens, and Kerberos tickets.

Demonstrate meaningful business risk with Cobalt Strike’s user-exploitation tools. Cobalt Strike’s workflows make it easy to deploy keystroke loggers and screenshot capture tools on compromised systems. Use browser pivoting to gain access to websites that your compromised target is logged onto with Internet Explorer. This Cobalt Strike-only technique works with most sites and bypasses two-factor authentication.

Cobalt Strike’s reporting features reconstruct the engagement for your client. Provide the network administrators an activity timeline so they may find attack indicators in their sensors. Cobalt Strike generates high quality reports that you may present to your clients as stand-alone products or use as appendices to your written narrative.

Throughout each of the above steps, you will need to understand the target environment, its defenses, and reason about the best way to meet your objectives with what is available to you. This is evasion. It is not Cobalt Strike’s goal to provide evasion out-of-the-box. Instead, the product provides flexibility, both in its potential configurations and options to execute offense actions, to allow you to adapt the product to your circumstance and objectives.

Installation and Updates

Cobalt Strike packages as native archives for Windows, Linux, and MacOS X.

Cobalt Strike uses a client / server model where each component can be installed on the same system, but is often deployed separately. The Cobalt Strike GUI is referred to as ‘Cobalt Strike’, the ‘Cobalt Strike GUI’ , or the command used to start the client ‘cobaltstrike’. The Cobalt Strike server is referred to as ‘Team Server’ or the command used to start the server ‘teamserver’.

The basic process to install Cobalt Strike involves downloading and extracting a distribution package onto your operating system and running an update process to download the product.

Before You Begin

Read this section before you install Cobalt Strike.

System Requirements

The following items are required for any system hosting the Cobalt Strike client and/or server components.

Java

Cobalt Strike’s GUI client and team server require one of the following Java environments:

NOTE:
If your organization does not have a license that allows commercial use of Oracle’s Java, we encourage you to use OpenJDK 11.

Supported Operating Systems

Cobalt Strike Team Server is supported on a Linux system that meets the Java requirements and has been tested on the following Debian based Linux distributions (other versions may work but have not been tested):

  • Debian
  • Ubuntu
  • Kali Linux

Cobalt Strike Client runs on the following systems:

  • Windows 7 and above
  • MacOS X 10.13 and above
  • GUI based Linux, such as: Debian, Ubuntu and Kali Linux (other versions may work but have not been tested)

Hardware

In addition to an accepted operating system, the below minimum requirements should be met:

  • 2 GHz+ processor
  • 2 GB RAM
  • 500MB+ available disk space

On Amazon’s EC2, use at least a High-CPU Medium (c1.medium, 1.7 GB) instance.

Installing OpenJDK

Cobalt Strike is tested with OpenJDK 11 and its launchers are compatible with a properly installed OpenJDK 11 environment.

Linux (Kali 2018.4, Ubuntu 18.04)

  1. Update APT:sudo apt-get update
  2. Install OpenJDK 11 with APT:sudo apt-get install openjdk-11-jdk
  3. Make OpenJDK 11 the default:sudo update-java-alternatives -s java-1.11.0-openjdk-amd64

Linux (Other)

  1. Uninstall the current OpenJDK package(s).
  2. Download OpenJDK for Linux/x64 at: https://jdk.java.net/archive/.
  3. Extract the OpenJDK binary:tar zxvf openjdk-11.0.1_linux-x64_bin.tar.gz
  4. Move the OpenJDK folder to /usr/local:mv jdk-11.0.1 /usr/local
  5. Add the following to ~/.bashrc:JAVA_HOME="/usr/local/jdk-11.0.1"PATH=$PATH:$JAVA_HOME/bin
  6. Refresh your ~/.bashrc to make the new environment variables take effect:source ~/.bashrc

MacOS X

  1. Download OpenJDK for macOS/x64 at: https://jdk.java.net/archive/.
  2. Open a Terminal and navigate to the Downloads/ folder.
  3. Extract the archive:tar zxvf openjdk-11.0.1_osx-x64_bin.tar.gz
  4. Move the extracted archive to /Library/Java/JavaVirtualMachines/:sudo mv jdk-11.0.1.jdk/ /Library/Java/JavaVirtualMachines/

The java command on MacOS X will use the highest Java version in /Library/Java as the default.

TIP:
If you are seeing a JRELoadError message this is because the JavaAppLauncher stub included with Cobalt Strike loads a library from a set path to run the JVM within the stub process. Issue the following command to fix this error:

sudo ln -fs /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin

Replace jdk-11.0.2.jdk with your Java path. The next Cobalt Strike release will use a Java Application Stub for MacOS X that is more flexible.

Windows

  1. Download OpenJDK for Windows/x64 at: https://jdk.java.net/archive/.
  2. Extract the archive to c:\program files\jdk-11.0.1.
  3. Add c:\program files\jdk-11.0.\bin to your user’s PATH environment variable:
  4. Go to Control Panel-> System-> Change Settings-> Advanced-> Environment Variables…
  5. Highlight Path in User variables for user.
  6. Press Edit .
  7. Press New .
  8. Type: c:\program files\jdk-11.0.1\bin.
  9. Press OK on all dialogs.

Wayland Desktop - Not Supported

Wayland is a modern replacement for the X Windows System. Wayland has made great strides, as a project, and some desktop environments use it as their default window system. Don’t let the adoption fool you though. Not all applications or application environments work 100% perfectly on Wayland. There are still bugs and issues to address.

There are bugs in Java (or Wayland) that may cause a graphical Java application to crash, during normal use, when run in a Wayland desktop. These bugs affect Cobalt Strike users.

Am I using Wayland?

Type echo $XDG_SESSION_TYPE to find out if you’re on wayland or x11.

How to disable Wayland on Kali Linux

The latest version of Kali Linux 2017 Rolling uses a Wayland desktop by default. To change this back to X11:

  1. Open /etc/gdm3/daemon.conf with your favorite text editor.
  2. Find the [daemon] section.
  3. Add WaylandEnable=false and reboot your system.

Installing Cobalt Strike

Follow these instructions to install Cobalt Strike.

NOTE:

The Cobalt Strike Distribution Package (steps 1 and 3) contains the OS-specific Cobalt Strike launcher(s), supporting files, and the updater program. It does not contain the Cobalt Strike program itself. Running the Update Program (step 4) downloads the Cobalt Strike product and performs the final installation steps.

Download a Cobalt Strike distribution package for a supported operating system. (an email is provided with a link to the download)
Setup a recommended Java environment. (see Installing OpenJDK for instructions)
Extract, mount or unzip the distribution package. Based on the operating system perform one of the following.

  1. For Linux:
    1. Extract the cobaltstrike-dist.tgz:tar zxvf cobaltstrike-dist.tgz
  2. For MacOS X:
    1. Double-click the cobaltstrike-dist.dmg file to mount it.
    2. Drag the Cobalt Strike folder to the Applications folder.
  3. For Windows:
    1. Disable anti-virus before you install Cobalt Strike.
    2. Use your preferred zip tool to extract the cobaltstike.zip file to an install location.
    Run the update program to finish the install. Based on the operating system perform one of the following.
  4. For Linux:
    1. Enter the following commands:cd /path/to/cobaltstrike./update
  5. For MacOS X:
    1. Navigate to the Cobalt Strike folder.
    2. Double-click Update Cobalt Strike.command.
  6. For Windows:
    1. Navigate to the Cobalt Strike folder.
    2. Double-click update.bat.

Make sure you update both your team server and client software with your license key. Cobalt Strike is generally licensed on a per user basis. The team server does not require a separate license.

License Authorization Files

The licensed version of Cobalt Strike requires a valid authorization file to start. An authorization file is an encrypted blob that provides information about your license to the Cobalt Strike product. This information includes: your license key, your license expiration date, and an ID number that is tied to your license key.

How do I get an authorization file?

The built-in update program requests an authorization file from Cobalt Strike’s update server when it’s run. The update program downloads a new authorization file, even if your Cobalt Strike version is up to date.

What happens when my license expires?

Cobalt Strike will refuse to start when its authorization file expires. There is no impact if an authorization file expires while Cobalt Strike is running. The licensed Cobalt Strike product only checks authorization files when it starts.

When does my authorization file expire?

Your authorization file expires when your Cobalt Strike license expires. If you renew your Cobalt Strike license, run the built-in update program to refresh the authorization file with the latest information.

Go to HelpSystem Information to find out when your authorization file expires. Look for the “valid to” value under the Other section. Remember, the Client Information and Team Server Information may have different values (depending on which license key was used and when the authorization file was last refreshed).

Cobalt Strike will also warn you when its authorization file is within 30 days of its valid to date.

How do I bring an authorization file into a closed environment?

The authorization file is cobaltstrike.auth . The update program always co-locates this file with cobaltstrike.jar. To use Cobalt Strike in a closed environment:

  1. Download the Cobalt Strike trial package.
  2. Update the Cobalt Strike trial package from an internet connected system
  3. Copy the contents of the updated cobaltstrike/ folder into your environment. The most important files are cobaltstrike.jar and cobaltstrike.auth.

How do I use an older version of Cobalt Strike with a refreshed authorization file?

Cobalt Strike 3.8 and below do not check for or require an authorization file.

Cobalt Strike 3.9 and later check for a cobaltstrike.auth file co-located with the cobaltstrike.jar file. Update Cobalt Strike from another folder and copy the new cobaltstrike.auth file to the folder that contains your old-version of Cobalt Strike. The authorization file is not tied to a specific version of the product.

What is the Customer ID value?

The Customer ID is a 4-byte number associated with a Cobalt Strike license key. Cobalt Strike 3.9 and later embed this information into the payload stagers and stages generated by Cobalt Strike.

How do I find the Customer ID value in a Cobalt Strike artifact?

The Customer ID value is the last 4-bytes of a Cobalt Strike payload stager in Cobalt Strike 3.9 and later.

This screenshot is the HTTP stager from the trial. The trial has a Customer ID value of 0. The last 4-bytes of this stager (0x0, 0x0, 0x0, 0x0) reflect

The Customer ID value also exists in the payload stage, but it’s more steps to recover. Cobalt Strike does not use the Customer ID value in its network traffic or other parts of the tool.

How do I protect disparate red team infrastructure from cross-identification with this ID?

If you have a unique authorization file on each team server, then each team server and the artifacts that originate from it will have a different ID.

Cobalt Strike’s update server generates a new authorization file each time the update program is run. Each authorization file has a unique ID. Cobalt Strike only propagates the team server’s ID. It does not propagate the ID from the GUI or headless client’s authorization file.

After You are Done

Congratulations! Cobalt Strike is now installed. Read the following for additional information and your next steps.

Next Steps

Starting the Team Server

Starting a Cobalt Strike Client

Starting the Team Server

Cobalt Strike is split into client and a server components. The server, referred to as the team server, is the controller for the Beacon payload and the host for Cobalt Strike’s social engineering features. The team server also stores data collected by Cobalt Strike and it manages logging.

The Cobalt Strike team server must run on a supported Linux system. To start a Cobalt Strike team server, issue the following command to run the team server script included with the Cobalt Strike Linux package:

./teamserver <ip_address> [ <kill_date>]

The team server script uses the following two mandatory and two optional parameters:

IP Address - (mandatory) Enter the externally reachable IP address of the team server. Cobalt Strike uses this value as a default host for its features.

Password - (mandatory) Enter a password that your team members will use to connect the Cobalt Strike client to the team server.

Malleable C2 Profile - (optional) Specify a valid Malleable C2 Profile. See Malleable Command and Control for more information on this feature.

Kill Date - (optional) Enter a date value in YYYY-MM-DD format. The team server will embed this kill date into each Beacon stage it generates. The Beacon payload will refuse to run on or after this date and will also exit if it wakes up on or after this date.

When the team server starts, it will publish the SHA256 hash of the team server’s SSL certificate. Distribute this hash to your team members. When your team members connect, their Cobalt Strike client will ask if they recognize this hash before it authenticates to the team server. This is an important protection against man-in-the-middle attacks.

Starting a Cobalt Strike Client

Follow the steps below to connect the Cobalt Strike client to the team server.

Steps

  1. To start the Cobalt Strike client, use the launcher included with your platform’s package.
  2. For Linux:
    1. Enter the following commands:./cobaltstrike
  3. For MacOS X:
    1. Navigate to the Cobalt Strike folder.
    2. Double-click cobaltstrike.
  4. For Windows:
    1. Navigate to the Cobalt Strike folder.
    2. Double-click cobaltstrike.exe.The Connect Dialog screen displays.

start-client_startup-panel

  1. Cobalt Strike keeps track of the team servers you connect to and remembers your information. Select one of these team server profiles from the left-hand-side of the connect dialog to populate the connect dialog with its information. Use the Alias Names and Host Names buttons to toggle how the list of hosts are displayed. Active connections will be displayed in blue text. You may control how the host list is initially displayed, active connection text color, and prune the list through Cobalt StrikePreferencesTeam Servers .
Parameters:

Alias - Enter an alias for the host or use the default. The alias name can not be empty, start with an ‘*’, or use the same alias name of an active connection.

Host - Specify your team server’s address in the Host field. The host name can not be empty.

Port - Displays the default Port for the team server (50050). This is rarely change. The port can not be empty and must be a numeric number.

User - The User field is your nickname on the team server. Change this to your call sign, handle, or made-up hacker fantasy name. The user name can not be empty.

Password - Enter the shared password for the team server.
2. Press Connect to connect to the Cobalt Strike team server.If this is your first connection to this team server, Cobalt Strike will ask if you recognize the SHA256 hash of this team server.

  1. If you do, press Yes , and the Cobalt Strike client will connect to the server and open the client user interface.

NOTE:

Cobalt Strike will also remember this SHA256 hash for future connections. You may manage these hashes through Cobalt Strike → Preferences → Fingerprints .

Distributed and Team Operations

Use Cobalt Strike to coordinate a distributed red team effort. Stage Cobalt Strike on one or more remote hosts. Start your team servers and have your team connect.

Once connected to a team server, your team will:

  • Use the same sessions
  • Share hosts, captured data, and downloaded files
  • Communicate through a shared event log.

The Cobalt Strike client may connect to multiple team servers. Go to Cobalt StrikeNew Connection to initiate a new connection. When connected to multiple servers, a switchbar will show up at the bottom of your Cobalt Strike window.

This switchbar allows you to switch between active Cobalt Strike server instances. Each server has its own button. Right-click a button and select Rename to make the button’s text reflect the role of the server during your engagement. The server button will display the active button in bold text and color based on color preference found in Preferences → TeamServers to better indicate which button is active. This button name will also identify the server in the Cobalt Strike Activity Report.

When connected to multiple servers, Cobalt Strike aggregates listeners from all of the servers it’s connected to. This aggregation allows you to send a phishing email from one server that references a malicious website hosted on another server. At the end of your engagement, Cobalt Strike’s reporting feature will query all of the servers you’re connected to and merge the data to tell one story.

Reconnecting the Client

When the client disconnection is user-initiated with the Menu, Toolbar or Switchbar Server button, a red banner displays with a Reconnect and Close button.

Press Close to close the window. Press Reconnect to reconnect to the TeamServer.

If the TeamServer is not available a dialog displays asking if you want to retry (Yes/No). If Yes then connection is attempted again (repeats if needed). If No , the dialog closes.

When disconnection is initiated by the TeamServer or other network interruption the red banner will display a message with a countdown for connection retry. This will repeat until a connection is made with the TeamServer or the user clicks on Close . In this case the user can interact with other parts of the UI.

When the client reconnects, the red reconnect bar disappears.

Scripting Cobalt Strike

Cobalt Strike is scriptable through its Aggressor Script language. Aggressor Script allows you to modify and extend the Cobalt Strike client.

History

Aggressor Script is the spiritual successor to Cortana, the open source scripting engine in Armitage. Cortana was made possible by a contract through DARPA’s Cyber Fast Track program. Cortana allows its users to extend Armitage and control the Metasploit® Framework and its features through Armitage’s team server. Cobalt Strike 3.0 is a ground-up rewrite of Cobalt Strike without Armitage as a foundation. This change afforded an opportunity to revisit Cobalt Strike’s scripting and build something around Cobalt Strike’s features. The result of this work is Aggressor Script.

Aggressor Script is a scripting language for red team operations and adversary simulations inspired by scriptable IRC clients and bots. Its purpose is two-fold. You may create long running bots that simulate virtual red team members, hacking side-by-side with you. You may also use it to extend and modify the Cobalt Strike client to your needs.

Loading Scripts

Aggressor Script is built into the Cobalt Strike client. To manage scripts, go to Cobalt StrikeScript Manager and press Load .

A default script inside of Cobalt Strike defines all of Cobalt Strike’s popup menus and formats information displayed in Cobalt Strike’s consoles. Through the Aggressor Script engine, you may override these defaults and customize Cobalt Strike to your preferences.

You may also use Aggressor Script to add new features to Cobalt Strike’s Beacon and to automate certain tasks.

To learn more about Aggressor Script, see Aggressor Script .

Running the Client on MacOS X

The Cobalt Strike client may not be able to show contents of the Documents, Desktop, and Downloads folders in the file browser initially. (e.g. loading scripts, uploading files, generating payloads, etc…)

By default, OSX limits what access applications have to the Documents, Desktop, and Download folders. These applications need to explicitly be granted access to these folders.

Since Cobalt Strike is a third party application, it isn’t as straight forward as granting the app “Cobalt Strike” access. You may need to give the JRE running Cobalt Strike client access to the file system. You can give access to the specific Files and Folders or Full Disk Access.

You may be prompted for the access:

client_on-macos

Or, if the access has been previously denied, you may need to edit the access in the OSX System Preferences / Security & Privacy / Privacy dialog:

Please be advised that other applications that use the JRE will also have this access.

NOTE:

The same steps may also need to be taken for ‘/bin/bash’.

User Interface

Overview User Interface

The Cobalt Strike user interface is split into two parts. The top of the interface shows a visualization of sessions or targets. The bottom of the interface displays tabs for each Cobalt Strike feature or session you interact with. You may click the area between these two parts and resize them to your liking

Toolbar

The toolbar at the top of Cobalt Strike offers quick access to common Cobalt Strike functions. Knowing the toolbar buttons will speed up your use of Cobalt Strike considerably.

– Need to continue later.

Session and Target Visualizations

Cobalt Strike has several visualizations each designed to aid a different part of your engagement. You may switch between visualizations through buttons btn_pivot-sessions-targets_70x24 on the toolbar or the Cobalt StrikeVisualization menu.

Pivot Graph

Cobalt Strike has the ability to link multiple Beacons into a chain. These linked Beacons receive their commands and send their output through the parent Beacon in their chain. This type of chaining is useful to control which sessions egress a network and to emulate a disciplined actor who restricts their communication paths inside of a network to something plausible. This chaining of Beacons is one of the most powerful features in Cobalt Strike.

Cobalt Strike’s workflows make this chaining very easy. It’s not uncommon for Cobalt Strike operators to chain Beacons four or five levels deep on a regular basis. Without a visual aid it’s very difficult to keep track of and understand these chains. This is where the Pivot Graph comes in.

The Pivot Graph shows your Beacon chains in a natural way. Each Beacon session has an icon. As with the sessions table: the icon for each host indicates its operating system. If the icon is red with lightning bolts, the Beacon is running in a process with administrator privileges. A darker icon indicates that the Beacon session was asked to exit and it acknowledged this command.

The firewall icon represents the egress point of your Beacon payload. A dashed green line indicates the use of beaconing HTTP or HTTPS connections to leave the network. A yellow dashed line indicates the use of DNS to leave the network.

An arrow connecting one Beacon session to another represents a link between two Beacons. Cobalt Strike’s Beacon uses Windows named pipes and TCP sockets to control Beacons in this peer-to-peer fashion. An orange arrow is a named pipe channel. SSH sessions use an orange arrow as well. A blue arrow is a TCP socket channel. A red (named pipe) or purple (TCP) arrow indicates that a Beacon link is broken.

Click a Beacon to select it. You may select multiple Beacons by clicking and dragging a box over the desired hosts. Press Ctrl and Shift and click to select or unselect an individual Beacon.

Right-click a Beacon to bring up a menu with available post-exploitation options.

Several keyboard shortcuts are available in the Pivot Graph.

  • Ctrl+Plus — zoom in
  • Ctrl+Minus — zoom out
  • Ctrl+0 — reset the zoom level
  • Ctrl+A — select all hosts
  • Escape — clear selection
  • Ctrl+C — arrange hosts into a circle
  • Ctrl+S — arrange hosts into a stack
  • Ctrl+H — arrange hosts into a hierarchy.

Right-click the Pivot Graph with no selected Beacons to configure the layout of this graph. This menu also has an Unlinked menu. Select Hide to hide unlinked sessions in the pivot graph. Select Show to show unlinked sessions again.

Sessions Table

The sessions table shows which Beacons are calling home to this Cobalt Strike instance. Beacon is Cobalt Strike’s payload to emulate advanced threat actors. Here, you will see the external IP address of each Beacon, the internal IP address, the egress listener for that Beacon, when the Beacon last called home, and other information. Next to each row is an icon indicating the operating system of the compromised target. If the icon is red with lightning bolts, the Beacon is running in a process with administrator privileges. A faded icon indicates that the Beacon session was asked to exit and it acknowledged this command.

If you use a DNS Beacon listener, be aware that Cobalt Strike will not know anything about a host until it checks in for the first time. If you see an entry with a last call time and that’s it, you will need to give that Beacon its first task to see more information.

Right-click one or more Beacon’s to see your post-exploitation options.

Targets Table

The Targets Table shows the targets in Cobalt Strike’s data model. The targets table displays the IP address of each target, its NetBIOS name, and a note that you or one of your team members assigned to the target. The icon to the left of a target indicates its operating system. A red icon with lightning bolts indicates that the target has a Cobalt Strike Beacon session associated with it.

Click any of the table headers to sort the hosts. Highlight a row and right-click it to bring up a menu with options for that host. Press Ctrl and Alt and click to select and deselect individual hosts.

The target’s table is a useful for lateral movement and to understand your target’s network.

Tabs

Cobalt Strike opens each dialog, console, and table in a tab. Click the X button to close a tab. Use Ctrl+D to close the active tab. Ctrl+Shift+D will close all tabs except the active on.

You may right-click the X button to open a tab in a window, take a screenshot of a tab, or close all tabs with the same name.

Keyboard shortcuts exist for these functions too. Use Ctrl+W to open the active tab in its own window. Use Ctrl+T to quickly save a screenshot of the active tab.

Ctrl+B will send the current tab to the bottom of the Cobalt Strike window. This is useful for tabs that you need to constantly watch. Ctrl+E will undo this action and remove the tab at the bottom of the Cobalt Strike window.

Hold shift and click X to close all tabs with the same name. Hold shift + control and click X to open the tab in its own window.

Use Ctrl+Left and Ctrl+Right to quickly switch tabs. You may drag and drop tabs to change their order.

Consoles

Cobalt Strike provides a console to interact with Beacon sessions, scripts, and chat with your teammates.

The consoles track your command history. Use the up arrow to cycle through previously typed commands. The down arrow moves back to the last command you typed. The history command lists previously typed commands. The ! command allows previously typed commands to be ran again.

NOTE:

The list of previously typed commands is not maintained between sessions. Closing a console window and then reopening it will start with no previously typed commands.

Use the Tab key to complete commands and parameters.

Use Ctrl+Plus to make the console font size larger, Ctrl+Minus to make it smaller, and Ctrl+0 to reset it. This change is local to the current console only. Visit Cobalt StrikePreferences to permanently change the font.

Press Ctrl+F to show a panel that will let you search for text within the console. Use Ctrl+A to select all text in the console’s buffer.

Tables

Cobalt Strike uses tables to display sessions, credentials, targets, and other engagement information.

Most tables in Cobalt Strike have an option to assign a color highlight to the highlighted rows. These highlights are visible to other Cobalt Strike clients. Right-click and look for the Color menu.

Press Ctrl+F within a table to show the table search panel. This feature lets you filter the current table.

The text field is where you type your filter criteria. The format of the criteria depends on the column you choose to apply the filter to. Use CIDR notation (e.g., 192.168.1.0/24) and host ranges (192.168.1-192.169.200) to filter columns that contain addresses. Use numbers or ranges of numbers for columns that contain numbers. Use wildcard characters (*, ?) to filter columns that contain strings.

The ! button negates the current criteria. Press enter to apply the specified criteria to the current table. You may stack as many criteria together as you like. The Reset button will remove the filters applied to the current table.

Data Management

Overview

Cobalt Strike’s team server is a broker for information collected by Cobalt Strike during your engagement. Cobalt Strike parses output from its Beacon payload to extract targets, services, and credentials.

If you’d like to export Cobalt Strike’s data, you may do so through ReportingExport Data . Cobalt Strike provides options to export its data as TSV and XML files. The Cobalt Strike client’s export data feature merges data from all of the team servers you’re currently connected to and export TSV and XML files with data in Cobalt Strike’s data model…

Targets

You may interact with Cobalt Strike’s target information through ViewTargets . This tab displays the same information as the Targets Visualization.

Press Import to import a file with target information. Cobalt Strike accepts flat text files with one host per line. It also accepts XML files generated by Nmap (the –oX option).

Press Add to add new targets to Cobalt Strike’s data model.

targets_add

This dialog allows you to add multiple hosts to Cobalt Strike’s database. Specify a range of IP addresses or use CIDR notation in the Address field to add multiple hosts at one time. Hold down shift when you click Save to add hosts to the data model and keep this dialog open.

Select one or more hosts and right-click to bring up the hosts menu. This menu is where you change the note on the hosts, set their operating system information, or remove the hosts from the data model.

Services

From a targets display, right-click a host, and select Services . This will open Cobalt Strike’s services browser. Here you may browse services, assign notes to different services, and remove service entries as well.

Credentials

Go to ViewCredentials to interact with Cobalt Strike’s credential model.

Press Add to add an entry to the credential model. Again, you may hold shift and press Save to keep the dialog open and make it easier to add new credentials to the model.

Press Copy to copy the highlighted entries to your clipboard.

Use Export to export credentials in PWDump format.

Maintenance

Cobalt Strike’s data model keeps all of its state and state metadata in the data/ folder. This folder exists in the folder you ran the Cobalt Strike team server from.

To clear Cobalt Strike’s data model: stop the team server, delete the data/ folder, and its contents. Cobalt Strike will recreate the data/ folder when you start the team server next.

If you’d like to archive the data model, stop the team server, and use your favorite program to store the data/ folder and its files elsewhere. To restore the data model, stop the team server, and restore the old content to the data/ folder.

ReportingReset Data resets Cobalt Strike’s Data Model without a team server restart.

Listener and Infrastructure Management

Overview Listener and Infrastructure Management

The first step of any engagement is to setup infrastructure. In Cobalt Strike’s case, infrastructure consists of one or more team servers, redirectors, and DNS records that point to your team servers and redirectors. Once you have a team server up and running, you will want to connect to it, and configure it to receive connections from compromised systems. Listeners are Cobalt Strike’s mechanism to do this.

A listener is simultaneously configuration information for a payload and a directive for Cobalt Strike to stand up a server to receive connections from that payload. A listener consists of a user- defined name, the type of payload, and several payload-specific options.

Listener Management

To manage Cobalt Strike listeners, go to Cobalt StrikeListeners . This will open a tab listing all of your configured payloads and listeners.

Press Add to create a new listener. The New Listener panel displays.

Use the Payload drop-down to select one of the available payload/listener types you wish to configure. Each has different parameters and are described in the following sections:

DNS Beacon

HTTP Beacon and HTTPS Beacon

SMB Beacon

TCP Beacon

External C2

Foreign Listeners

To edit a listener, highlight a listener and press Edit . To remove a listener, highlight the listener and press Remove .

Cobalt Strike’s Beacon Payload

Most commonly, you will configure listeners for Cobalt Strike’s Beacon payload. Beacon is Cobalt Strike’s payload to model advanced attackers. Use Beacon to egress a network over HTTP, HTTPS, or DNS. You may also limit which hosts egress a network by controlling peer- to-peer Beacons over Windows named pipes and TCP sockets.

Beacon is flexible and supports asynchronous and interactive communication. Asynchronous communication is low and slow. Beacon will phone home, download its tasks, and go to sleep. Interactive communication happens in real-time.

Beacon’s network indicators are malleable. Redefine Beacon’s communication with Cobalt Strike’s malleable C2 language. This allows you to cloak Beacon activity to look like other malware or blend-in as legitimate traffic. See Malleable Command and Control for more information.

Payload Staging

One topic that deserves mention, as background information, is payloading staging. Many attack frameworks decouple the attack from the stuff that the attack executes. This stuff that an attack executes is known as a payload. Payloads are often divided into two parts: the payload stage and the payload stager. A stager is a small program, usually hand-optimized assembly, that downloads a payload stage, injects it into memory, and passes execution to it. This process is known as staging.

The staging process is necessary in some offense actions. Many attacks have hard limits on how much data they can load into memory and execute after successful exploitation. This greatly limits your post-exploitation options, unless you deliver your post-exploitation payload in stages.

Cobalt Strike does use staging in its user-driven attacks. These are most of the items under AttacksPackages and Attack s → Web Drive-by . The stagers used in these places depend on the payload paired with the attack. For example, the HTTP Beacon has an HTTP stager. The DNS Beacon has a DNS TXT record stager. Not all payloads have stager options. Payloads with no stager cannot be delivered with these attack options.

If you don’t need payload staging, you can turn it off. Set the host_stage option in your Malleable C2 profile to false. This will prevent Cobalt Strike from hosting payload stages on its web and DNS servers. There is a big OPSEC benefit to doing this. With staging on, anyone can connect to your server, request a payload, and analyze its contents to find information from your payload configuration.

In Cobalt Strike 4.0 and later, post-exploitation and lateral movement actions eschew stagers and opt to deliver a full payload where possible. If you disable payload staging, you shouldn’t notice it once you’re ready to do post-exploitation.

DNS Beacon

The DNS Beacon is a favorite Cobalt Strike feature. This payload uses DNS requests to beacon back to you. These DNS requests are lookups against domains that your Cobalt Strike team server is authoritative for. The DNS response tells Beacon to go to sleep or to connect to you to download tasks. The DNS response will also tell the Beacon how to download tasks from your team server.

dns-beacon_example

Cobalt Strike 4.0 and later, the DNS Beacon is a DNS-only payload. There is no HTTP communication mode in this payload. This is a change from prior versions of the product.

Data Channels

Today, the DNS Beacon can download tasks over DNS TXT records, DNS AAAA records, or DNS A records. This payload has the flexibility to change between these data channels while its on target. Use Beacon’s mode command to change the current Beacon’s data channel. mode dns is the DNS A record data channel. mode dns6 is the DNS AAAA record channel. And, mode dns-txt is the DNS TXT record data channel. The default is the DNS TXT record data channel.

Be aware that DNS Beacon does not check in until there’s a task available. Use the checkin command to request that the DNS Beacon check in next time it calls home.

DNS Listener Setup

To create a DNS Beacon listener select Cobalt Strike → Listeners on the main menu and press the Add button at the bottom of the Listeners tab display.

The New Listener panel displays.

Select Beacon DNS as the Payload type and give the listener a Name . Make sure to give the new listener a memorable name as this name is how you will refer to this listener through Cobalt Strike’s commands and workflows.

Parameters

DNS Hosts - Press [+] to add one or more domains to beacon to. Your Cobalt Strike team server system must be authoritative for the domains you specify. Create a DNS A record and point it to your Cobalt Strike team server. Use DNS NS records to delegate several domains or sub-domains to your Cobalt Strike team server’s A record.

The length of the beacon host list in beacon payload is limited to 255 characters. This includes a randomly assigned URI for each host and delimiters between each item in the list. If the length is exceeded, hosts will be dropped from the end of the list until it fits in the space. There will be messages in the team server log for dropped hosts.

Host Rotation Strategy - This value configures the beacons behavior for choosing which host(s) from the list to use for egress. Select one of the following:

round-robin : Select to loop through the list of host names in the order they are provided. Each host is used for one connection.

random : Select to randomly select a host name from the list each time a connection is attempted.

failover-xx : Select to use a working host as long as possible. Use each host in the list until they reach a consecutive failover count (x) or duration time period (m,h,d), then use the next host.

rotate-xx : Select to use each host for a period of time. Use each host in the list for the specified duration (m,h,d), then use the next host.

Max Retry Stategy - This configures the beacons behavior for exiting after a number of consecutive failed connection attempts to the Team Server. There are several default options to choose from or you can create your own list with the LISTENER_MAX_RETRY_STRATEGIES hook. See LISTENER_MAX_RETRY_STRATEGIES .

none : Select to ensure beacon will not exit because of failed connection attempts.

exit-xxx : These settings use the syntax of exit-[max_attempts]-[increase_attempts]-[duration][m,h,d]. The max_attempt value is the number of consecutive failed attempts before beacon will exit. The increase_attempts is the number of consecutive failed attempts before increasing the sleep time. The duration value is the number of minutes, hours, or days to set the new sleep time.

The sleep time will not be updated if the current sleep time is greater than the newly specified duration value. The sleep time will be affected by the current jitter value. On any successful connection the failed attempts count will be reset to zero and the sleep time will be reset to the prior value.

DNS Host (Stager) - This configures the DNS Beacon’s TXT record stager. This stager is only used with Cobalt Strike features that require an explicit stager. Your Cobalt Strike team server system must be authoritative for this domain as well.

Profile - Allows a beacon to be configured with a selected Malleable C2 profile variant.

DNS Port (Bind) - This field specifies the port your DNS Beacon payload server will bind to. This option is useful if you want to set up port bending redirector such as a redirector that accepts connections on port 53 but routes the connection to your team server on another port.

DNS Resolver - Allows a DNS Beacon to egress using a specific DNS resolver, rather than using the default DNS resolver for the target server. Specify the IP Address of the desired resolver. This DNS Resolver is not used by the stager of the DNS Beacon.

Testing

To test your DNS configuration, open a terminal and type nslookup jibberish.beacon domain . If you get an A record reply of 0.0.0.0—then your DNS is correctly setup. If you do not get a reply, then your DNS configuration is not correct and the DNS Beacon will not communicate with you.

Notes

  • Make sure your DNS records reference the primary address on your network interface. Cobalt Strike’s DNS server will always send responses from your network interface’s primary address. DNS resolvers tend to drop replies when they request information from one server, but receive a reply from another.
  • If you are behind a NAT device, make sure that you use your public IP address for the NS record and set your firewall to forward UDP traffic on port 53 to your system. Cobalt Strike includes a DNS server to control Beacon.
  • To customize the network traffic indicators for your DNS beacons, see DNS Beacons in the Malleable C2 hel

HTTP Beacon and HTTPS Beacon

The HTTP and HTTPS beacons download tasks with an HTTP GET request. These beacons send data back with an HTTP POST request. This is the default. You have incredible control over the behavior and indicators in this payload via Malleable C2.

HTTP(S) Listener Setup

To create a HTTP or HTTPS Beacon listener select Cobalt Strike → Listeners on the main menu and press the Add button at the bottom of the Listeners tab display.

The New Listener panel displays.

Select Beacon HTTP or Beacon HTTPS as the Payload type and give the listener a Name . Make sure to give the new listener a memorable name as this name is how you will refer to this listener through Cobalt Strike’s commands and workflows.

Parameters

HTTP(S) Hosts - Press [+] to add one or more hosts for the HTTP Beacon to call home to. Press [-] to remove one or more hosts. Press [X] to clear the current hosts. If you have multiple hosts, you can still paste a comma-separated list of callback hosts into this dialog.

The length of the beacon host list in beacon payload is limited to 255 characters. This includes a randomly assigned URI for each host and delimiters between each item in the list. If the length is exceeded, hosts will be dropped from the end of the list until it fits in the space. There will be messages in the team server log for dropped hosts.

Host Rotation Strategy - This value configures the beacons behavior for choosing which host(s) from the list to use for egress. Select one of the following:

round-robin : Select to loop through the list of host names in the order they are provided. Each host is used for one connection.

random : Select to randomly select a host name from the list each time a connection is attempted.

failover-xx : Select to use a working host as long as possible. Use each host in the list until they reach a consecutive failover count (x) or duration time period (m,h,d), then use the next host.

rotate-xx : Select to use each host for a period of time. Use each host in the list for the specified duration (m,h,d), then use the next host.

Max Retry Stategy - This configures the beacons behavior for exiting after a number of consecutive failed connection attempts to the Team Server. There are several default options to choose from or you can create your own list with the LISTENER_MAX_RETRY_STRATEGIES hook. See LISTENER_MAX_RETRY_STRATEGIES .

none : Select to ensure beacon will not exit because of failed connection attempts.

exit-xxx : These settings use the syntax of exit-[max_attempts]-[increase_attempts]-[duration][m,h,d]. The max_attempt value is the number of consecutive failed attempts before beacon will exit. The increase_attempts is the number of consecutive failed attempts before increasing the sleep time. The duration value is the number of minutes, hours, or days to set the new sleep time.

The sleep time will not be updated if the current sleep time is greater than the newly specified duration value. The sleep time will be affected by the current jitter value. On any successful connection the failed attempts count will be reset to zero and the sleep time will be reset to the prior value.

HTTP Host (Stager) - This controls the host of the HTTP Stager for the HTTP Beacon. This value is only used if you pair this payload with an attack that requires an explicit stager.

Profile - This is where you select a Malleable C2 profile variant. A variant is a way of specifying multiple profile variations in one file. With variants, each HTTP or HTTPS listener you setup can have different network indicators.

HTTP Port (C2) - This field sets the port your HTTP Beacon will phone home to.

HTTP Port (Bind) - This field specifies the port your HTTP Beacon payload web server will bind to. These options are useful if you want to setup port bending redirectors (e.g., a redirector that accepts connections on port 80 or 443 but routes the connection to your team server on another port).

HTTP Host Header -This value, if specified, is propagated to your HTTP stagers and through your HTTP communication. This option makes it easier to take advantage of domain fronting with Cobalt Strike.

HTTP Proxy - Press the button to specify an explicit proxy configuration for this payload.

Manual HTTP Proxy Configuration

The (Manual) Proxy Settings dialog offers several options to control the proxy configuration for Beacon’s HTTP and HTTPS requests. The default behavior of Beacon is to use the Internet Explorer proxy configuration for the current process/user context.

http-https-beacon_proxy-settings

The Type field configures the type of proxy. The Host and Port fields tell Beacon where the proxy lives. The Username and Password fields are optional. These fields specify the credentials Beacon uses to authenticate to the proxy.

Check the Ignore proxy settings; use direct connection box to force Beacon to attempt its HTTP and HTTPS requests without going through a proxy.

Press Set to update the Beacon dialog with the desired proxy settings. Press Reset to set the proxy configuration back to the default behavior.

NOTE:

The manual proxy configuration affects the HTTP and HTTPS Beacon payload stages only. It does not propagate to the payload stagers.

Redirectors

A redirector is a system that sits between your target’s network and your team server. Any connections that come to the redirector are forwarded to your team server to process. A redirector is a way to provide multiple hosts for your Beacon payloads to call home to. A redirector also aids operational security as it makes it harder to trace the true location of your team server.

Cobalt Strike’s listener management features support the use of redirectors. Simply specify your redirector hosts when you setup an HTTP or HTTPS Beacon listener. Cobalt Strike does not validate this information. If the host you provide is not affiliated with the current host, Cobalt Strike assumes it’s a redirector. One simple way to turn a server into a redirector is to use socat.

Here’s the socat syntax to forward all connections on port 80 to the team server at 192.168.12.100 on port 80:

socat TCP4-LISTEN:80,fork TCP4:192.168.12.100:80

SMB Beacon

The SMB Beacon uses named pipes to communicate through a parent Beacon. This peer-to-peer communication works with Beacons on the same host. It also works across the network.

Windows encapsulates named pipe communication within the SMB protocol. Hence, the name, SMB Beacon.

SMB Listener Setup

To create a SMB Beacon listener select Cobalt Strike → Listeners on the main menu and press the Add button at the bottom of the Listeners tab display.

The New Listener panel displays.

smb-beacon_new-listener_4-5

Select Beacon SMB as the Payload type and give the listener a Name . Make sure to give the new listener a memorable name as this name is how you will refer to this listener through Cobalt Strike’s commands and workflows.

The only option associated with the SMB Beacon is the Pipename (C2) . You can set an explicit pipename or accept the default option.

The SMB Beacon is compatible with most actions in Cobalt Strike that spawn a payload. The exception to this are the user-driven attacks (e.g., Attacks → Packages , Attacks → Web Drive- by ) that require explicit stagers.

Cobalt Strike post-exploitation and lateral movement actions that spawn a payload will attempt to assume control of (link) to the SMB Beacon payload for you. If you run the SMB Beacon manually, you will need to link to it from a parent Beacon.

Linking and Unlinking

From the Beacon console, use link [host] [pipe] to link the current Beacon to an SMB Beacon that is waiting for a connection. When the current Beacon checks in, its linked peers will check in too.

To blend in with normal traffic, linked Beacons use Windows named pipes to communicate. This traffic is encapsulated in the SMB protocol. There are a few caveats to this approach:

  1. Hosts with an SMB Beacon must accept connections on port 445.
  2. You may only link Beacons managed by the same Cobalt Strike instance.

If you get an error 5 (access denied) after you try to link to a Beacon: steal a domain user’s token or use make_token DOMAIN\user password to populate your current token with valid credentials for the target. Try to link to the Beacon again.

To destroy a Beacon link use unlink [ip address] [session PID] in the parent or child. The [session PID] argument is the process ID of the Beacon to unlink. This value is how you specify a specific Beacon to de-link when there are multiple childn Beacons.

When you de-link an SMB Beacon, it does not exit and go away. Instead, it goes into a state where it waits for a connection from another Beacon. You may use the link command to resume control of the SMB Beacon from another Beacon in the future.

Beacon Covert Peer-to-Peer Communication

It’s hard to stay hidden when many compromised systems call out to the internet. Use Beacon’s peer-to-peer communication to solve this problem. This feature lets you link Beacons to each other. Linked Beacons download tasks and send output through their parent Beacon.

Use mode smb to transform a Beacon into a peer that waits for another Beacon to connect.

Use link [ip address] to link the current Beacon to a peer that is waiting for a connection. When the current Beacon checks in, its linked peers will check in too.

To blend in with normal traffic, linked Beacons use SMB pipes to communicate. There are a few caveats to this approach:

  1. Hosts with a Beacon peer must accept connections on port 445.
  2. You may only link Beacons managed by the same Cobalt Strike instance.

If you get an error 5 (access denied) when you try to link to a Beacon: steal a domain user’s token or use shell net use \host /U:DOMAIN\user password to establish a session with the host. An administrator user is not required for this. Any valid domain user will do. Once you have a session, try to link to the Beacon again.

To destroy a Beacon link use unlink [ip address] in the parent or child. Later, you may link to to the unlinked Beacon again (or link to it from another Beacon).

Once a Beacon becomes a peer, there is no way to make it beacon over HTTP or DNS again. If you’d like to kill a Beacon peer, use the exit command. If you’d like to make the host beacon over HTTP or DNS, task the Beacon peer to give you another Beacon session.

Beacon Peer as a Payload

Some systems can’t talk to the internet. In these cases, it’s nice to have a way to deliver a ready-to-link Beacon so you may connect to it. Use [host] → Login → psexec or [host] → Login → psexec (psh) with the beacon (connect to target) listener . This will run a Beacon peer on a host without the need to connect to the internet to stage.

You may setup a listener to deliver a peer-to-peer Beacon as well. Create a lister for windows/beacon_smb/reverse_tcp. This listener will stage your peer-to-peer Beacon. After it stages you will still need to link to it from another Beacon.

If staging is cumbersome, you may ask Cobalt Strike to export a fully staged peer-to-peer Beacon as an executable, DLL, PowerShell script, or raw blob of shellcode. Go to Attacks → Packages → Windows Executable (S) and select SMB Beacon.

TCP Beacon

The TCP Beacon uses a TCP socket to communicate through a parent Beacon. This peer-to-peer communication works with Beacons on the same host and across the network.

TCP Listener Setup

To create a TCP Beacon listener select Cobalt Strike → Listeners on the main menu and press the Add button at the bottom of the Listeners tab display.

The New Listener panel displays.

Connecting and Unlinking

From the Beacon console, use connect [ip address] [port] to connect the current session to a TCP Beacon that is waiting for a connection. When the current session checks in, its linked peers will check in too.

To destroy a Beacon link use unlink [ip address] [session PID] in the parent or child session console. Later, you may reconnect to the TCP Beacon from the same host (or a different host).

External C2

External C2 is a specification to allow third-party programs to act as a communication layer for Cobalt Strike’s Beacon payload. These third-party programs connect to Cobalt Strike to read frames destined for, and write frames with output from payloads controlled in this way. The External C2 server is what these third-party programs use to interface with your Cobalt Strike team server.

External C2 Listener Setup

To create an External C2 Beacon listener select Cobalt Strike → Listeners on the main menu and press the Add button at the bottom of the Listeners tab display.

The New Listener panel displays.

Go to Cobalt StrikeListeners , press Add , and choose External C2 as your payload.

external-c2_new-listener_4-5

Select External C2 as the Payload type and give the listener a Name . Make sure to give the new listener a memorable name as this name is how you will refer to this listener through Cobalt Strike’s commands and workflows.

Parameters

Port (Bind) - Specify the port the External C2 server waits for connections on.

Bind to localhost only - Check to make the External C2 server localhost- only.

NOTE:

External C2 listeners are not like other Cobalt Strike listeners. You cannot target these with Cobalt Strike’s post-exploitation actions. This option is just a convienence to stand up the interface itself.

Specification

The External C2 interface is described in the External C2 specification.

If you’d like to adapt the example (Appendix B) in the specification into a third-party C2, you may assume a 3-clause BSD license for the code contained within the specification.

Third-party Materials

Here’s a list of third-party projects and posts that reference, use, or build on External C2:

Foreign Listeners

Cobalt Strike supports the concept of foreign listeners. These are aliases for x86 payload handlers hosted in the Metasploit Framework or other instances of Cobalt Strike. To pass a Windows HTTPS Meterpreter session to a friend with msfconsole, setup a Foreign HTTPS payload and point the Host and Port values to their handler. You may use foreign listeners anywhere you would use an x86 Cobalt Strike listener.

Foreign Listeners Setup

To create a Foreign Beacon listener select Cobalt Strike → Listeners on the main menu and press the Add button at the bottom of the Listeners tab display.

The New Listener panel displays.

foreign-beacon_new-listener_4-5

Select Foreign HTTP or Foreign HTTPS as the Payload type and give the listener a Name . Make sure to give the new listener a memorable name as this name is how you will refer to this listener through Cobalt Strike’s commands and workflows.

Parameters

HTTP(S) Host (Stager) - This field specifies the name of the server where your foreign listener is located.

HTTP(S) Port (Stager) - This field specifies the port on the server where your foreign listener is listening for connections.

Infrastructure Consolidation

Cobalt Strike’s model for distributed operations is to stand up a separate team server for each phase of your engagement. For example, it makes sense to separate your post-exploitation and persistence infrastructure. If a post-exploitation action is discovered, you don’t want the remediation of that infrastructure to clear out the callbacks that will let you back into the network.

Some engagement phases require multiple redirector and communication channel options. Cobalt Strike 4.0 is friendly to this.

You can bind multiple HTTP, HTTPS, and DNS listeners to a single Cobalt Strike team server. These payloads also support port bending in their configuration. This allows you to use the common port for your channel (80, 443, or 53) in your redirector and C2 setups, but bind these listeners to different ports to avoid port conflicts on your team server system.

To give variety to your network indicators, Cobalt Strike’s Malleable C2 profiles may contain multiple variants. A variant is a way of adding variations of the current profile into one profile file. You may specify a Profile variant when you define each HTTP or HTTPS Beacon listener.

Further, you can define multiple TCP and SMB Beacons on one team server, each with different pipe and port configurations. Any egress Beacon, from the same team server, can control any of these TCP or SMB Beacon payloads once they’re deployed in the target environment.

Payload Security Features

Cobalt Strike takes steps to protect Beacons communication and to ensure that a Beacon can only receive tasks from and send output to its team server.

When you setup the Beacon payload for the first time, Cobalt Strike will generate a public/private key pair that is unique to your team server. The team server’s public key is embedded into Beacon’s payload stage. Beacon uses the team server’s public key to encrypt session metadata that it sends to the team server.

Beacon must always send session metadata before the team server can issue tasks and receive output from the Beacon session. This metadata contains a random session key generated by that Beacon. The team server uses each Beacon’s session key to encrypt tasks and to decrypt output.

Each Beacon implementation and data channel uses this same scheme. You have the same security with the A record data channel in the Hybrid HTTP and DNS Beacon as you do with the HTTPS Beacon.

Be aware that the above applies to Beacon once it is staged. The payload stagers, due to their size, do not have built-in security features.

Initial Access

Cobalt Strike has several options that aid in establishing an initial foothold on a target. This ranges from profiling potential targets to payload creation to payload delivery.

Client-side System Profiler

The system profiler is a reconnaissance tool for client-side attacks. This tool starts a local web- server and fingerprints any one who visits it. The system profiler provides a list of applications and plugins it discovers through the user’s browser. The system profiler also attempts to discover the internal IP address of users who are behind a proxy server.

To start the system profiler, go to AttacksWeb Drive-bySystem Profiler . To start the profiler you must specify a URI to bind to and a port to start the Cobalt Strike web- server from.

If you specify a Redirect URL, Cobalt Strike will redirect visitors to this URL once their profile is taken. Click Launch to start the system profiler.

The System Profiler uses an unsigned Java Applet to decloak the target’s internal IP address and determine which version of Java the target has. With Java’s click-to-run security feature—this could raise suspicion. Uncheck the Use Java Applet to get information box to remove the Java Applet from the System Profiler.

Check the Enable SSL box to serve the System Profiler over SSL. This box is disabled unless you specify a valid SSL certificate with Malleable C2. Chapter 11 discusses this.

Application Browser

To view the results from the system profiler, go to ViewApplications . This opens an Applications tab with a table showing all application information captured by the System Profiler.

Analyst Tips

The Application Browser has a lot of information useful to plan a targeted attack. Here’s how to get the most out of this output:

The internal IP address field is gathered from a benign unsigned Java applet. If this field says unknown, this means the Java applet probably did not run. If you see an IP address here, this means the unsigned Java applet ran.

Internet Explorer will report the base version the user installed. As Internet Explorer gets updates–the reported version information does not change. Cobalt Strike uses the JScript.dll version to estimate Internet Explorer’s patch level. Go to support.microsoft.com and search for JScript.dll’s build number (the third number in the version string) to map it to an Internet Explorer update.

A *64 next to an application means it’s an x64 application.

Cobalt Strike Web Services

Many Cobalt Strike features run from their own web server. These services include the system profiler, HTTP Beacon, and Cobalt Strike’s web drive-by attacks. It’s OK to host multiple Cobalt Strike features on one web server.

To manage Cobalt Strike’s web services, go to ViewWeb Drive-byManage . Here, you may copy any Cobalt Strike URL to the clipboard or stop a Cobalt Strike web service.

Use ViewWeb Log to monitor visits to your Cobalt Strike web services.

If Cobalt Strike’s web server sees a request from the Lynx, Wget, or Curl browser; Cobalt Strike will automatically return a 404 page. Cobalt Strike does this as light protection against blue team snooping. The can be configured with the Malleable C2 ‘.http-config.block_useragents’ option.

User-driven Attack Packages

The best attacks are not exploits. Rather, the best attacks take advantage of normal features to get code execution. Cobalt Strike makes it easy to setup several user-driven attacks. These attacks take advantage of listeners you’ve already setup. Navigate to AttacksPackages and choose one of the following options.

HTML Application

An HTML Application is a Windows program written In HTML and an Internet Explorer supported scripting language. This package generates an HTML Application that runs a Cobalt Strike listener.

Navigate to AttacksPackagesHTML Application .

attack-pkg_http-app

Parameters

Listener - Press the button to select a Cobalt Strike listener you would like to output a payload for.

Method - Use the drop-down to select one of the following methods to run the selected listener:

Executable : This method writes an executable to disk and run it.

PowerShell : This method uses a PowerShell one-liner to run your payload stager.

VBA : This method uses a Microsoft Office macro to inject your payload into memory. The VBA method requires Microsoft Office on the target system.

Press Generate to create the HTML Application.

MS Office Macro

The Microsoft Office Macro tool generates a macro to embed into a Microsoft Word or Microsoft Excel document.

Navigate to AttacksPackagesMS Office Macro .

attack-pkg_office-macro

Choose a listener and pess Generate to create the step-by-step instructions to embed your macro into a Microsoft Word or Excel document.

This attack works well when you can convince a user to run macros when they open your document.

Payload Generator

Cobalt Strike’s Payload Generator outputs sourcecode and artifacts to stage a Cobalt Strike listener onto a host. Think of this as the Cobalt Strike version of msfvenom.

Navigate to AttacksPackagesPayload Generator .

attack-pkg_payload-gen

Parameters

Listener - Press the button to select a Cobalt Strike listener you would like to output a payload for.

Output - Use the drop-down to select one of the following output types. Most options give you shellcode formatted as a byte array for that language. There are a few options that give you something you can immediately use though:

C : Shellcode formatted as a byte array.

C# : Shellcode formatted as a byte array.

COM Scriptlet : A .sct file to run a listener

Java : Shellcode formatted as a byte array.

Perl : Shellcode formatted as a byte array.

PowerShell : PowerShell script to run shellcode

PowerShell Command : PowerShell one-liner to run a Beacon stager.

Python : Shellcode formatted as a byte array.

Raw : blob of position independent shellcode.

Ruby : Shellcode formatted as a byte array.

Veil : Custom shellcode suitable for use with the Veil Evasion Framework.

VBA : Shellcode formatted as a byte array.

x64 - Check the box to generate an x64 stager for the selected listener.

Press Generate to create a Payload for the selected output type.

Windows Executable

This package generates a Windows executable artifact that delivers a payload stager.

Navigate to Attacks → Packages → Windows Executable .

attack-pkg_win-execute

This package provides the following output options:

Parameters

Listener - Press the button to select a Cobalt Strike listener you would like to output a payload for.

Output - Use the drop-down to select one of the following output types.

Windows EXE : A Windows executable.

Windows Service EXE : A Windows executable that responds to Service Control Manager commands. You may use this executable to create a Windows service with sc or as a custom executable with the Metasploit Framework’s PsExec modules.

Windows DLL : A Windows DLL that exports a StartW function that is compatible with rundll32.exe. Use rundll32.exe to load your DLL from the command line.

rundll32 foo.dll,StartW

x64 - Check the box to generate x64 artifacts that pair with an x64 stager. By default, this dialog exports x64 payload stagers.

sign - Check the box to sign an EXE or DLL artifact with a code-signing certificate. You must specify a certificate in a Malleable C2 profile.

Press Generate to create a payload stager artifact.

Cobalt Strike uses its Artifact Kit to generate this output.

Windows Executable(S)

This package exports Beacon, without a stager, as an executable, service executable, 32-bit DLL, or 64-bit DLL. A payload artifact that does not use a stager is called a stageless artifact. This package also has a PowerShell option to export Beacon as a PowerShell script and a raw option to export Beacon as a blob of position independent code.

Navigate to Attacks → Packages → Windows Executable (S) .

attack-pkg_win-execute-s

This package provides the following output options:

Parameters

Listener - Press the button to select a Cobalt Strike listener you would like to output a payload for.

Output - Use the drop-down to select one of the following output types.

PowerShell : A PowerShell script that injects a stageless Beacon into memory.

Raw : A blob of position independent code that contains Beacon.

Windows EXE : A Windows executable.

Windows Service EXE : A Windows executable that responds to Service Control Manager commands. You may use this executable to create a Windows service with sc or as a custom executable with the Metasploit Framework’s PsExec modules.

Windows DLL : A Windows DLL that exports a StartW function that is compatible with rundll32.exe. Use rundll32.exe to load your DLL from the command line.

rundll32 foo.dll,StartW

x64 - Check the box to generate an x64 artifact that contains an x64 payload. By default, this dialog exports x64 payloads.

sign - Check the box to sign an EXE or DLL artifact with a code-signing certificate. You must specify a certificate in a Malleable C2 profile.

Press Generate to create a stageless artifact.

Cobalt Strike uses its Artifact Kit to generate this output.

Hosting Files

Cobalt Strike’s web server can host your user-driven packages for you. Go to AttacksWeb Drive-byHost File and perform the following to set up:

  1. Choose the file to host
  2. Select an arbitrary URL
  3. Choose the mime type for the file.

By itself, the capability to host a file isn’t very impressive. However, in sections that follow, you will learn how to embed Cobalt Strike URLs into a spear phishing email. When you do this, Cobalt Strike can cross-reference visitors to your file with sent emails and include this information in the social engineering report.

Check Enable SSL to serve this content over SSL. This option is available when you specify a valid SSL certificate in your Malleable C2 profile.

User-driven Web Drive-by Attacks

Cobalt Strike makes several tools to setup web drive-by attacks available to you. To quickly start an attack, navigate to AttacksWeb Drive-by and choose one of the following option:

Java Signed Applet Attack

This attack starts a web server hosting a self-signed Java applet. Visitors are asked to give the applet permission to run. When a visitor grants this permission, you gain access to their system.

The Java Signed Applet Attack uses Cobalt Strike’s Java injector. On Windows, the Java injector will inject shellcode for a Windows listener directly into memory for you.

Navigate to Attacks → Web Drive-by → Signed Applet Attack .

init_java-signed

Parameters

Local URL/Host/Path - Set the Local URL Path, Host and Port to configure the webserver.

Listener - Press the button to select a Cobalt Strike listener you would like to output a payload for.

SSL - Check to serve this content over SSL. This option is available when you specify a valid SSL certificate in your Malleable C2 profile.

Press Launch to start the attack.

Signing Cobalt Strike’s Applet Attack

Cobalt Strike’s Java Signed Applet attack is not effective without a valid code signing certificate. This tutorial shows how to sign Cobalt Strike’s Java Signed Applet attack with your own code signing certificate.

To get the most mileage from this attack, you will want to download the Applet Kit from the Cobalt Strike arsenal and sign it with a code signing certificate.

Java Smart Applet Attack

Cobalt Strike’s Smart Applet Attack combines several exploits to disable the Java security sandbox into one package. This attack starts a web server hosting a Java applet. Initially, this applet runs in Java’s security sandbox and it does not require user approval to start.

The applet analyzes its environment and decides which Java exploit to use. If the Java version is vulnerable, the applet will disable the security sandbox, and execute a payload using Cobalt Strike’s Java injector.

Navigate to Attacks → Web Drive-by → Smart Applet Attack .

init_java-smart

Parameters

Local URL/Host/Path - Set the Local URL Path, Host and Port to configure the webserver.

Listener - Press the button to select a Cobalt Strike listener you would like to output a payload for.

SSL - Check to serve this content over SSL. This option is available when you specify a valid SSL certificate in your Malleable C2 profile.

Press Launch to start the attack.

Scripted Web Delivery (S)

This feature generates a stageless Beacon payload artifact, hosts it on Cobalt Strike’s web server, and presents a one-liner to download and run the artifact.

Navigate to Attacks → Web Drive-by → Scripted Web Delivery (S) from the menu.

init_java-scripted

Parameters

Local URL/Host/Path - Set the Local URL Path, Host and Port to configure the webserver. Make sure the Host field matches the CN field of your SSL certificate. This will avoid a situation where this feature fails because of a mismatch between these fields.

Listener - Press the button to select a Cobalt Strike listener you would like to output a payload for.

Type - Use the drop-down menu to select one of the following types:

bitsadmin : This option hosts an executable and uses bitsadmin to download it. The bitsadmin method runs the executable via cmd.exe.

exe : This option generates an executable and hosts it on Cobalt Strike’s web server.

powershell This option hosts a PowerShell script and uses powershell.exe to download the script and evaluate it.

powershell IEX : This option hosts a PowerShell script and uses powershell.exe to download the script and evaluate it. Similar to prior powershell option, but it provides a shorter Invoke-Execution one-liner command.

python : This option hosts a Python script and uses python.exe to download the script and run it. Each of these options is a different way to run a Cobalt Strike listener.

x64 - Check the box to generate an x64 stager for the selected listener.

SSL - Check to serve this content over SSL. This option is available when you specify a valid SSL certificate in your Malleable C2 profile.

Press Launch to start the attack.

Client-side Exploits

You may use a Metasploit Framework exploit to deliver a Cobalt Strike Beacon. Cobalt Strike’s Beacon is compatible with the Metasploit Framework’s staging protocol. To deliver a Beacon with a Metasploit Framework exploit:

  • Use windows/meterpreter/reverse_http[s] as your PAYLOAD and set LHOST and LPORT to point to your Cobalt Strike listener. You’re not really delivering Meterpreter here, you’re telling the Metasploit Framework to generate the HTTP[s] stager that downloads a payload from the specified LHOST/LPORT.
  • Set DisablePayloadHandler to True. This will tell the Metasploit Framework to avoid standing up a handler within the Metasploit Framework to service your payload connection.
  • Set PrependMigrate to True. This option tells the Metasploit Framework to prepend shellcode that runs the payload stager in another process. This helps your Beacon session survives if the exploited application crashes or if it’s closed by a user.

Here’s a screenshot of msfconsole used to stand up a Flash Exploit to deliver Cobalt Strike’s HTTP Beacon hosted at 192.168.1.5 on port 80:

Clone a Site

Before sending an exploit to a target, it helps to dress it up. Cobalt Strike’s website clone tool can help with this. The website clone tool makes a local copy of a website with some code added to fix links and images so they work as expected.

To clone a website, go to AttacksWeb Drive-byClone Site .

attacks_clone-site

It’s possible to embed an attack into a cloned site. Write the URL of your attack in the Embed field and Cobalt Strike will add it to the cloned site with an IFRAME. Click the button to select one of the running client-side exploits.

Cloned websites can also capture keystrokes. Check the Log keystrokes on cloned site box. This will insert a JavaScript key logger into the cloned site.

To view logged keystrokes or see visitors to your cloned site, go to ViewWeb Log .

Check Enable SSL to serve this content over SSL. This option is available when you specify a valid SSL certificate in your Malleable C2 profile. Make sure the Host field matches the CN field of your SSL certificate. This will avoid a situation where this feature fails because of a mismatch between these fields.

Spear Phishing

Now that you have an understanding of client-side attacks, let’s talk about how to get the attack to the user. The most common way into an organization’s network is through spear phishing. Cobalt Strike’s spear phishing tool allows you to send pixel perfect spear phishing messages using an arbitrary message as a template.

Targets

Before you send a phishing message, you should assemble a list of targets. Cobalt Strike expects targets in a text file. Each line of the file contains one target. The target may be an email address. You may also use an email address, a tab, and a name. If provided, a name helps Cobalt Strike customize each phish.

Templates

Next, you need a phishing template. The nice thing about templates is that you may reuse them between engagements. Cobalt Strike uses saved email messages as its templates. Cobalt Strike will strip attachments, deal with encoding issues, and rewrite each template for each phishing attack.

If you’d like to create a custom template, compose a message and send it to yourself. Most email clients have a way to get the original message source. In Gmail, click the down arrow next to Reply and select Show original . Save this message to a file and then congratulate yourself— you’ve made your first Cobalt Strike phishing template.

You may want to customize your template with Cobalt Strike’s tokens. Cobalt Strike replaces the following tokens in your templates:

Token Description
%To% The email address of the person the message is sent to
%To_Name% The name of the person the message is sent to.
%URL% The contents of the Embed URL field in the spear phishing dialog.

Sending Messages

Now that you have your targets and a template, you’re ready to go phishing. To start the spear phishing tool, go to AttacksSpear Phish .

attacks_spear-phishing

To send a phishing message, you must first import your list of Targets . You may import a flat text-file containing one email address per line. Import a file containing one email address and name separated by a tab or comma for stronger message customization. Click the folder next to the Targets field to import your targets file.

Set Template to an email message template. A Cobalt Strike message template is simply a saved email message. Cobalt Strike will strip unnecessary headers, remove attachments, rewrite URLs, re-encode the message, and rewrite it for you. Click on the folder next to the Template field to choose one.

You have the option to add an Attachment . This is a great time to use one of the social engineering packages discussed earlier. Cobalt Strike will add your attachment to the outgoing phishing message.

Cobalt Strike does not give you a means to compose a message. Use an email client, write a message, and send it to yourself. Most webmail clients include a means to see the original message source. In GMail, click the down arrow next to Reply and select Show original.

You may also ask Cobalt Strike to rewrite all URLs in the template with a URL of your choosing. Set Embed URL to have Cobalt Strike rewrite each URL in the message template to point to the embedded URL. URLs added in this way will contain a token that allows Cobalt Strike to trace any visitor back to this particular spear phishing attack. Cobalt Strike’s reporting and web log features take advantage of this token. Press … to choose one of the Cobalt Strike hosted sites you’ve started.

When you embed a URL, Cobalt Strike will attach ?id=%TOKEN% to it. Each sent message will get its own token. Cobalt Strike uses this token to map website visitors to sent emails. If you care about reporting, be sure to keep this value in place.

Set Mail Server to an open relay or the mail exchange record for your target. If necessary, you may also authenticate to a mail server to send your phishing messages.

Press next to the Mail Server field to configure additional server options. You may specify a username and password to authenticate with. The Random Delay option tells Cobalt Strike to randomly delay each message by a random time, up to the number of seconds you specify. If this option is not set, Cobalt Strike will not delay its messages.

spear-phishing_mail-server

Set Bounce To to an email address where bounced messages should go. This value will not affect the message your targets see. Press Preview to see an assembled message to one of your recipients. If the preview looks good, press Send to deliver your attack.

Cobalt Strike sends phishing messages through the team server.

Payload Artifacts and Anti-virus Evasion

Help/Systems LLC regularly fields questions about evasion. Does Cobalt Strike bypass anti-virus products? Which anti-virus products does it bypass? How often is this checked?

The Cobalt Strike default artifacts will likely be snagged by most endpoint security solutions. Although evasion is not a goal of the default Cobalt Strike product, Cobalt Strike does offer some flexibility.

You, the operator, may change the executables, DLLs, applets, and script templates Cobalt Strike uses in its workflows. You may also export Cobalt Strike’s Beacon payload in a variety of formats that work with third-party tools designed to assist with evasion.

This chapter highlights the Cobalt Strike features that provide this flexibility.

The Artifact Kit

Cobalt Strike uses the Artifact Kit to generate its executables and DLLs. The Artifact Kit is a source code framework to build executables and DLLs that evade some anti-virus products.

The Theory of the Artifact Kit

Traditional anti-virus products use signatures to identify known bad. If we embed our known bad shellcode into an executable, an anti-virus product will recognize the shellcode and flag the executable as malicious.

To defeat this detection, it’s common for an attacker to obfuscate the shellcode in some way and place it in the binary. This obfuscation process defeats anti-virus products that use a simple string search to identify malicious code.

Many anti-virus products go a step further. These anti-virus products simulate execution of an executable in a virtual sandbox. With each emulated step of execution, the anti-virus product checks for known bad in the emulated process space. If known bad shows up, the anti-virus product flags the executable or DLL as malicious. This technique defeats many encoders and packers that try to hide known bad from signature-based anti-virus products.

Cobalt Strike’s counter to this is simple. The anti-virus sandbox has limitations. It is not a complete virtual machine. There are system behaviors the anti-virus sandbox does not emulate. The Artifact Kit is a collection of executable and DLL templates that rely on some behavior that anti-virus product’s do not emulate to recover shellcode located inside of the binary.

One of the techniques [see: src-common/bypass-pipe.c in the Artifact Kit] generates executables and DLLs that serve shellcode to themselves over a named pipe. If an anti-virus sandbox does not emulate named pipes, it will not find the known bad shellcode.

Where Artifact Kit Fails

Of course it’s possible for anti-virus products to defeat specific implementations of the Artifact Kit. If an anti-virus vendor writes signatures for the Artifact Kit technique you use, then the

executables and DLLs it creates will get caught. This started to happen, over time, with the default bypass technique in Cobalt Strike 2.5 and below. If you want to get the most from the Artifact Kit, you will use one of its techniques as a base to build your own Artifact Kit implementation.

Even that isn’t enough though. Some anti-virus products call home to the anti-virus vendor’s servers. There the vendor makes a determination if the executable or DLL is known good or an unknown, never before seen, executable or DLL. Some of these products automatically send unknown executables and DLLs to the vendor for further analysis and warn the users. Others treat unknown executables and DLLs as malicious. It depends on the product and its settings.

The point: no amount of “obfuscation” is going to help you in this situation. You’re up against a different kind of defense and will need to work around it accordingly. Treat these situations the same way you would treat application whitelisting. Try to find a known good program (e.g., powershell) that will get your payload stager into memory.

How to use the Artifact Kit

Go to HelpArsenal from a licensed Cobalt Strike to download the Artifact Kit.

HelpSystems distributes the Artifact Kit as a .tgz file. Use the tar command to extract it. The Artifact Kit includes a build.sh script. Run this script on Kali Linux, with no arguments, to build the default Artifact Kit techniques with the Minimal GNU for Windows Cross Compiler.

The Artifact Kit build script creates a folder with template artifacts for each Artifact Kit technique. To use a technique with Cobalt Strike, go to Cobalt StrikeScript Manager , and load the artifact.cna script from that technique’s folder.

You’re encouraged to modify the Artifact Kit and its techniques to make it meet your needs. While skilled C programmers can do more with the Artifact Kit, it’s quite feasible for an adventurous non-programmer to work with the Artifact Kit too. For example, a major anti-virus product likes to write signatures for the executables in Cobalt Strike’s trial each time there is a release. Up until Cobalt Strike 2.5, the trial and licensed versions of Cobalt Strike used the named pipe technique in its executables and DLLs. This vendor would write a signature for the named pipe string the executable used. Defeating their signatures, release after release, was as simple as changing the name of the pipe in the pipe technique’s source code.

The Veil Evasion Framework

Veil is a popular framework to generate executables that get past some anti-virus products. You may use Veil to generate executables for Cobalt Strike’s payloads.

Steps

  1. Go to AttacksPackagesPayload Generator .
  2. Choose the listener you want to generate an executable for.
  3. Select Veil as the Output type.
  4. Press Generate and save the file.
  5. Launch the Veil Evasion Framework and choose the technique you want to use.
  6. Veil will eventually ask about shellcode. Select Veil’s option to supply custom shellcode.
  7. Paste in the contents of the file Cobalt Strike’s payload generator made.
  8. Press enter and you will have a fresh Veil-made executable.

Java Applet Attacks

HelpSystems distributes the source code to Cobalt Strike’s Applet Attacks as the Applet Kit. This is also available within the Cobalt Strike arsenal. Go to HelpArsenal and download the Applet Kit.

Use the included build.sh script to build the Applet Kit on Kali Linux. Many Cobalt Strike customers use this flexibility to sign Cobalt Strike’s Java Applet attacks with a code-signing certificate that they purchased. This is highly recommended.

To make Cobalt Strike use your Applet Kit over the built-in one, load the applet.cna script included with the Applet Kit.

On the Cobalt Strike Arsenal Page you will also notice the Power Applet . This is an alternate implementation of Cobalt Strike’s Java Applet attacks that uses PowerShell to get a payload into memory. The Power Applet demonstrates the flexibility you have to recreate Cobalt Strike’s standard attacks in a completely different way and still use them with Cobalt Strike’s workflows.

To make Cobalt Strike use your Applet Kit over the built-in one, load the applet.cna script included with the Applet Kit.

The Resource Kit

The Resource Kit is Cobalt Strike’s means to change the HTA, PowerShell, Python, VBA, and VBS script templates Cobalt Strike uses in its workflows. Again, the Resource Kit is available to licensed users in the Cobalt Strike arsenal. Go to HelpArsenal to download the Resource Kit.

The README.txt supplied with the Resource Kit documents the included scripts and which features use them. To evade a product, consider changing strings or behaviors in these scripts.

To make Cobalt Strike use your script templates over the built-in script templates, load the resources.cna script included with the Resource Kit.

The Sleep Mask Kit

The Sleep Mask Kit is the source code for the sleep mask function that is executed to obfuscate Beacon, in memory, prior to sleeping. This obfuscation technique may be used to identify Beacon. To defeat this detection, Cobalt Strike provids an aggressor script that allows the user to modify how the sleep mask function looks in memory. With the 4.5 release a list of heap records to mask and unmask is included. Go to Help → Arsenal to download the Sleep Mask Kit. Your license key is required.

Use the included build.sh or build.bat script to build the Sleep Mask Kit on Kali Linux or Microsoft Windows. The script builds the sleep mask object file for the three types of Beacons ( default , SMB , and TCP ) on both x86 and x64 architectures in the sleepmask directory. The default type supports HTTP, HTTPS, and DNS Beacons. You may modify the Sleep Mask Kit to meet your needs.

To make Cobalt Strike use your sleep mask function over the default, load the sleepmask.cna script from the sleepmask directory.

The following are limitations to what may be modified:

  • The executable code size can not exceed 769 bytes. If this occurs the default sleep mask function will be used.
  • Only one function can be defined in the source code file.
  • Use of external functions are not supported.

Post Exploitation

Beacon Covert C2 Payload

Beacon is Cobalt Strikes payload to model advanced attackers. Use Beacon to egress a network over HTTP, HTTPS, or DNS. You may also limit which hosts egress a network by controlling peer-to-peer Beacons over Windows named pipes.

Beacon is flexible and supports asynchronous and interactive communication. Asynchronous communication is low and slow. Beacon will phone home, download its tasks, and go to sleep. Interactive communication happens in real-time.

Beacon’s network indicators are malleable. Redefine Beacon’s communication with Cobalt Strike’s malleable C2 language. This allows you to cloak Beacon activity to look like other malware or blend-in as legitimate traffic.

The Beacon Console

Right-click on a Beacon session and select interact to open that Beacon’s console. The console is the main user interface for your Beacon session. The Beacon console allows you to see which tasks were issued to a Beacon and to see when it downloads them. The Beacon console is also where command output and other information will appear.

post-exploit_beacon-conslole

In between the Beacon console’s input and output is a status bar. This status bar contains information about the current session. In its default configuration, the statusbar shows the target’s NetBIOS name, the username and PID of the current session, and the Beacon’s last check-in time.

Each command that’s issued to a Beacon, whether through the GUI or the console, will show up in this window. If a teammate issues a command, Cobalt Strike will pre-fix the command with their handle.

You will likely spend most of your time with Cobalt Strike in the Beacon console. It’s worth your time to become familiar with its commands. Type help in the Beacon console to see available commands. Type help followed by a command name to get detailed help.

The Beacon Menu

Right-click on a Beacon or inside of a Beacon’s console to access the Beacon menu. This is the same menu used to open the Beacon console. The following items are available:

The Access menu contains options to manipulate trust material and elevate your access.

The Explore menu consists of options to extract information and interact with the target’s system.

The Pivoting menu is where you can setup tools to tunnel traffic through a Beacon.

The Session menu is where you manage the current Beacon session.

beacon_menu_thumb_300_0

Some of Cobalt Strike’s visualizations (the pivot graph and sessions table) let you select multiple Beacons at one time. Most actions that happen through this menu will apply to all selected Beacon sessions.

Asynchronous and Interactive Operations

Be aware that Beacon is an asynchronous payload. Commands do not execute right away. Each command goes into a queue. When the Beacon checks in (connects to you), it will download these commands and execute them one by one. At this time, Beacon will also report any output it has for you. If you make a mistake, use the clear command to clear the command queue for the current Beacon.

By default, Beacons check in every sixty seconds. You may change this with Beacon’s sleep command. Use sleep followed by a time in seconds to specify how often Beacon should check in. You may also specify a second number between 0 and 99. This number is a jitter factor. Beacon will vary each of its check in times by the random percentage you specify as a jitter factor. For example, sleep 300 20 , will force Beacon to sleep for 300 seconds with a 20% jitter percentage. This means, Beacon will sleep for a random value between 240s to 300s after each check-in.

To make a Beacon check in multiple times each second, try sleep 0 . This is interactive mode. In this mode commands will execute right away. You must make your Beacon interactive before you tunnel traffic through it. A few Beacon commands (e.g., browserpivot, desktop, etc.) will automatically put Beacon into interactive mode at the next check in. Asynchronous and Interactive Operations

Be aware that Beacon is an asynchronous payload. Commands do not execute right away. Each command goes into a queue. When the Beacon checks in (connects to you), it will download these commands and execute them one by one. At this time, Beacon will also report any output it has for you. If you make a mistake, use the clear command to clear the command queue for the current Beacon.

By default, Beacons check in every sixty seconds. You may change this with Beacon’s sleep command. Use sleep followed by a time in seconds to specify how often Beacon should check in. You may also specify a second number between 0 and 99. This number is a jitter factor. Beacon will vary each of its check in times by the random percentage you specify as a jitter factor. For example, sleep 300 20 , will force Beacon to sleep for 300 seconds with a 20% jitter percentage. This means, Beacon will sleep for a random value between 240s to 300s after each check-in.

To make a Beacon check in multiple times each second, try sleep 0 . This is interactive mode. In this mode commands will execute right away. You must make your Beacon interactive before you tunnel traffic through it. A few Beacon commands (e.g., browserpivot, desktop, etc.) will automatically put Beacon into interactive mode at the next check in. Asynchronous and Interactive Operations

Be aware that Beacon is an asynchronous payload. Commands do not execute right away. Each command goes into a queue. When the Beacon checks in (connects to you), it will download these commands and execute them one by one. At this time, Beacon will also report any output it has for you. If you make a mistake, use the clear command to clear the command queue for the current Beacon.

By default, Beacons check in every sixty seconds. You may change this with Beacon’s sleep command. Use sleep followed by a time in seconds to specify how often Beacon should check in. You may also specify a second number between 0 and 99. This number is a jitter factor. Beacon will vary each of its check in times by the random percentage you specify as a jitter factor. For example, sleep 300 20 , will force Beacon to sleep for 300 seconds with a 20% jitter percentage. This means, Beacon will sleep for a random value between 240s to 300s after each check-in.

To make a Beacon check in multiple times each second, try sleep 0 . This is interactive mode. In this mode commands will execute right away. You must make your Beacon interactive before you tunnel traffic through it. A few Beacon commands (e.g., browserpivot, desktop, etc.) will automatically put Beacon into interactive mode at the next check in. Asynchronous and Interactive Operations

Be aware that Beacon is an asynchronous payload. Commands do not execute right away. Each command goes into a queue. When the Beacon checks in (connects to you), it will download these commands and execute them one by one. At this time, Beacon will also report any output it has for you. If you make a mistake, use the clear command to clear the command queue for the current Beacon.

By default, Beacons check in every sixty seconds. You may change this with Beacon’s sleep command. Use sleep followed by a time in seconds to specify how often Beacon should check in. You may also specify a second number between 0 and 99. This number is a jitter factor. Beacon will vary each of its check in times by the random percentage you specify as a jitter factor. For example, sleep 300 20 , will force Beacon to sleep for 300 seconds with a 20% jitter percentage. This means, Beacon will sleep for a random value between 240s to 300s after each check-in.

To make a Beacon check in multiple times each second, try sleep 0 . This is interactive mode. In this mode commands will execute right away. You must make your Beacon interactive before you tunnel traffic through it. A few Beacon commands (e.g., browserpivot, desktop, etc.) will automatically put Beacon into interactive mode at the next check in. Asynchronous and Interactive Operations

Be aware that Beacon is an asynchronous payload. Commands do not execute right away. Each command goes into a queue. When the Beacon checks in (connects to you), it will download these commands and execute them one by one. At this time, Beacon will also report any output it has for you. If you make a mistake, use the clear command to clear the command queue for the current Beacon.

By default, Beacons check in every sixty seconds. You may change this with Beacon’s sleep command. Use sleep followed by a time in seconds to specify how often Beacon should check in. You may also specify a second number between 0 and 99. This number is a jitter factor. Beacon will vary each of its check in times by the random percentage you specify as a jitter factor. For example, sleep 300 20 , will force Beacon to sleep for 300 seconds with a 20% jitter percentage. This means, Beacon will sleep for a random value between 240s to 300s after each check-in.

To make a Beacon check in multiple times each second, try sleep 0 . This is interactive mode. In this mode commands will execute right away. You must make your Beacon interactive before you tunnel traffic through it. A few Beacon commands (e.g., browserpivot, desktop, etc.) will automatically put Beacon into interactive mode at the next check in.
Be aware that Beacon is an asynchronous payload. Commands do not execute right away. Each command goes into a queue. When the Beacon checks in (connects to you), it will download these commands and execute them one by one. At this time, Beacon will also report any output it has for you. If you make a mistake, use the clear command to clear the command queue for the current Beacon.

By default, Beacons check in every sixty seconds. You may change this with Beacon’s sleep command. Use sleep followed by a time in seconds to specify how often Beacon should check in. You may also specify a second number between 0 and 99. This number is a jitter factor. Beacon will vary each of its check in times by the random percentage you specify as a jitter factor. For example, sleep 300 20 , will force Beacon to sleep for 300 seconds with a 20% jitter percentage. This means, Beacon will sleep for a random value between 240s to 300s after each check-in.

To make a Beacon check in multiple times each second, try sleep 0 . This is interactive mode. In this mode commands will execute right away. You must make your Beacon interactive before you tunnel traffic through it. A few Beacon commands (e.g., browserpivot, desktop, etc.) will automatically put Beacon into interactive mode at the next check in.

Running Commands

Beacon’s shell command will task a Beacon to execute a command via cmd.exe on the compromised host. When the command completes, Beacon will present the output to you.

Use the run command to execute a command without cmd.exe. The run command will post output to you. The execute command runs a program in the background and does not capture output.

Use the powershell command to execute a command with PowerShell on the compromised host. Use the powerpick command to execute PowerShell cmdlets without powershell.exe. This command relies on the Unmanaged PowerShell technique developed by Lee Christensen. The powershell and powerpick commands will use your current token.

The psinject command will inject Unmanaged PowerShell into a specific process and run your cmdlet from that location.

The powershell-import command will import a PowerShell script into Beacon. Future uses of the powershell, powerpick, and psinject commands will have cmdlets from the imported script available to them. Beacon will only hold one PowerShell script at a time. Import an empty file to clear the imported script from Beacon.

The execute-assembly command will run a local .NET executable as a Beacon post-exploitation job. You may pass arguments to this assembly as if it were run from a Windows command-line interface. This command will also inherit your current token.

If you want Beacon to execute commands from a specific directory, use the cd command in the Beacon console to switch the working directory of the Beacon’s process. The pwd command will tell you which directory you’re currently working from.

The setenv command will set an environment variable.

Beacon can execute Beacon Object Files without creating a new process. Beacon Object Files are compiled C programs, written to a specific convention, that run within a Beacon session. Use inline-execute [args] to execute a Beacon Object File with the specified arguments. See Beacon Object Files for more information.

Session Passing

Cobalt Strike’s Beacon started out as a stable lifeline to keep access to a compromised host. From day one, Beacon’s primary purpose was to pass accesses to other Cobalt Strike listeners.

Use the spawn command to spawn a session for a listener. The spawn command accepts an architecture (e.g., x86, x64) and a listener as its arguments.

By default, the spawn command will spawn a session in rundll32.exe. An alert administrator may find it strange that rundll32.exe is periodically making connections to the internet. Find a better program (e.g., Internet Explorer) and use the spawnto command to state which program Beacon should spawn for its sessions.

The spawnto command requires you to specify an architecture (x86 or x64) and a full path to a program to spawn, as needed. Type spawnto by itself and press enter to instruct Beacon to go back to its default behavior.

Type inject followed by a process id and a listener name to inject a session into a specific process. Use ps to get a list of processes on the current system. Use inject [pid] x64 to inject a 64-bit Beacon into an x64 process.

The spawn and inject commands both inject a payload stage into memory. If the payload stage is an HTTP, HTTPS, or DNS Beacon and it can’t reach you—you will not see a session. If the payload stage is a bind TCP or SMB Beacon, these commands will automatically try to link to and assume control of these payloads.

Use dllinject [pid] to inject a Reflective DLL into a process.

Use the shinject [pid] [architecture] [/path/to/file.bin] command to inject shellcode, from a local file, into a process on target. Use shspawn [architecture] [/path/to/file.bin] to spawn the “spawn to” process and inject the specified shellcode file into that process.

Use dllload [pid] [c:\path\to\file.dll] to load an on-disk DLL in another process.

Alternate Parent Processes

Use ppid [pid] to assign an alternate parent process for programs run by your Beacon session. This is a means to make your activity blend in with normal actions on the target. The current Beacon session must have rights to the alternate parent and it’s best if the alternate parent process exists in the same desktop session as your Beacon. Type ppid , with no arguments, to have Beacon launch processes with no spoofed parent.

The runu command will execute a command with another process as the parent. This command will run with the rights and desktop session of its alternate parent process. The current Beacon session must have full rights to the alternate parent. The spawnu command will spawn a temporary process, as a child of a specified process, and inject a Beacon payload stage into it.

The spawnto value controls which program is used as a temporary process.

Spoof Process Arguments

Each Beacon has an internal list of commands it should spoof arguments for. When Beacon runs a command that matches a list, Beacon:

  1. Starts the matched process in a suspended state (with the fake arguments)
  2. Updates the process memory with the real arguments
  3. Resumes the process

The effect is that host instrumentation recording a process launch will see the fake arguments. This helps mask your real activity.

Use argue [command] [fake arguments] to add a command to this internal list. The [command] portion may contain an environment variable. Use argue [command] to remove a command from this internal list. argue , by itself, lists the commands in this internal list.

The process match logic is exact. If Beacon tries to launch “net.exe”, it will not match net, NET.EXE, or c:\windows\system32\net.exe from its internal list. It will only match net.exe.

x86 Beacon can only spoof arguments in x86 child processes. Likewise, x64 Beacon can only spoof arguments in x64 child processes.

The real arguments are written to the memory space that holds the fake arguments. If the real arguments are longer than the fake arguments, the command launch will fail.

Blocking DLLs in Child Processes

Use blockdlls start to ask Beacon to launch child processes with a binary signature policy that blocks non-Microsoft DLLs from the process space. Use blockdlls stop to disable this behavior. This feature requires Windows 10.

Upload and Download Files

download - This command downloads the requested file. You do not need to provide quotes around a filename with spaces in it. Beacon is built for low and slow exfiltration of data. During each check-in, Beacon will download a fixed chunk of each file its tasked to get. The size of this chunk depends on Beacon’s current data channel. The HTTP and HTTPS channels pull data in 512KB chunks.

downloads - Use to see a list of file downloads in progress for the current Beacon.

cancel - Issue this command, followed by a filename, to cancel a download that’s in progress. You may use wildcards with your cancel command to cancel multiple file downloads at once.

upload - This command uploads a file to the host.

timestomp - When you upload a file, you will sometimes want to update its timestamps to make it blend in with other files in the same folder. This command will do this. The timestomp command matches the Modified, Accessed, and Created times of one file to another file.

Go to ViewDownloads in Cobalt Strike to see the files that your team has downloaded so far. Only completed downloads show up in this tab.

Downloaded files are stored on the team server. To bring files back to your system, highlight them here, and press Sync Files . Cobalt Strike then downloads the selected files to a folder of your choosing on your system.

File Browser

Beacon’s File Browser is an opportunity to explore the files on a compromised system. Go to [Beacon]ExploreFile Browser to open it.

The file browser will request a listing for the current working directory of Beacon. When this result arrives, the file browser will populate.

The left-hand side of the file browser is a tree which organizes the known drives and folders into one view. The right-hand side of the file browser shows the contents of the current folder.

Each file browser caches the folder listings it receives. A colored folder indicates the folder’s contents are in this file browser’s cache. You may navigate to cached folders without generating a new file listing request. Press Refresh to ask Beacon to update the contents of the current folder.

A dark-grey folder means the folder’s contents are not in this file browser’s cache. Click on a folder in the tree to have Beacon generate a task to list the contents of this folder (and update its cache). Double-click on a dark-grey folder in the right-hand side current folder view to do the same.

To go up a folder, press the folder button next to the file path above the right-hand side folder details view. If the parent folder is in this file browser’s cache, you will see the results immediately. If the parent folder is not in the file browser’s cache, the browser will generate a task to list the contents of the parent folder.

Right-click a file to download or delete it.

To see which drives are available, press List Drives .

File System Commands

You may prefer to browse and manipulate the file system from the Beacon console.

Use the ls command to list files in the current directory. Use mkdir to make a directory. rm will remove a file or folder. cp copies a file to a destination. mv moves a file.

The Windows Registry

Use reg_query [x86|x64] [HIVE\path\to\key] to query a specific key in the registry. This command will print the values within that key and a list of any subkeys. The x86/x64 option is required and forces Beacon to use the WOW64 (x86) or native view of the registry. reg_query [x86|x64] [HIVE\path\to\key] [value] will query a specific value within a registry key.

Keystrokes and Screenshots

Beacon’s tools to log keystrokes and take screenshots are designed to inject into another process and report their results to your Beacon.

To start the keystroke logger, use keylogger pid x86 to inject into an x86 process. Use keylogger pid x64 to inject into an x64 process. Use keylogger by itself to inject the keystroke logger into a temporary process. The keystroke logger will monitor keystrokes from the injected process and report them to Beacon until the process terminates or you kill the keystroke logger post- exploitation job.

Be aware that multiple keystroke loggers may conflict with each other. Use only one keystroke logger per desktop session.

To take a screenshot, use screenshot pid x86 to inject the screenshot tool into an x86 process. Use screenshot pid x64 to inject into an x64 process. This variant of the screenshot command will take one screenshot and exit. screenshot , by itself, will inject the screenshot tool into a temporary process.

The screenwatch command (with options to use a temporary process or inject into an explicit process) will continuously take screenshots until you stop the screenwatch post-exploitation job.

Use the printscreen command (also with temporary process and inject options) to take a screenshot by a different method. This command uses a PrintScr keypress to place the screenshot onto the user’s clipboard. This feature recovers the screenshot from the clipboard and reports it back to you.

When Beacon receives new screenshots or keystrokes, it will post a message to the Beacon console. The screenshot and keystroke information is not available through the Beacon console though. Go to ViewKeystrokes to see logged keystrokes across all of your Beacon sessions. Go to ViewScreenshots to browse through screenshots from all of your Beacon sessions. Both of these dialogs update as new information comes in. These dialogs make it easy for one operator to monitor keystrokes and screenshots on all of your Beacon sessions.

Controlling Beacon Jobs

Several Beacon features run as jobs in another process (e.g., the keystroke logger and screenshot tool). These jobs run in the background and report their output when it’s available. Use the jobs command to see which jobs are running in your Beacon. Use jobkill [job number] to kill a job.

The Process Browser

The Process Browser does the obvious; it tasks a Beacon to show a list of processes and shows this information to you. Go to [beacon] → Explore → Show Processes to open the Process Browser.

The left-hand side shows the processes organized into a tree. The current process for your Beacon is highlighted yellow.

The right-hand side shows the process details. The Process Browser is also a convenient place to impersonate a token from another process, deploy the screenshot tool, or deploy the keystroke logger.

Highlight one or more processes and press the appropriate button at the bottom of the tab.

If you highlight multiple Beacons and task them to show processes, Cobalt Strike will show a Process Browser that also states which host the process comes from. This variant of the Process Browser is a convenient way to deploy Beacon’s post-exploitation tools to multiple systems at once.

Simply sort by process name, highlight the interesting processes on your target systems, and press the Screenshot or Log Keystrokes button to deploy these tools to all highlighted systems.

Desktop Control

To interact with a desktop on a target host, go to [beacon] → Explore → Desktop (VNC) . This will stage a VNC server into the memory of the current process and tunnel the connection through Beacon.

When the VNC server is ready, Cobalt Strike will open a tab labeled Desktop HOST@PID .

You may also use Beacon’s desktop command to inject a VNC server into a specific process. Use desktop pid architecture low|high . The last parameter let’s you specify a quality for the VNC session.

The bottom of the desktop tab has several buttons. These are:

– Need to continue later.

If you can’t type in a Desktop tab, check the state of the Ctrl and Alt buttons. When either button is pressed, all of your keystrokes are sent with the Ctrl or Alt modifier. Press the Ctrl or Alt button to turn off this behavior. Make sure View only isn’t pressed either. To prevent you from accidentally moving the mouse , View only is pressed by default.

Privilege Escalation

Some post-exploitation commands require system administrator-level rights. Beacon includes several options to help you elevate your access including the following:

NOTE:

Type help in the Beacon console to see available commands. Type help followed by a command name to see detailed help.

Elevate with an Exploit

elevate - This command lists privilege escalation exploits registered with Cobalt Strike.

elevate [exploit] [listener] - This command attempts to elevate with a specific exploit.

You may also launch one of these exploits through [beacon]AccessElevate .

Choose a listener, select an exploit, and press Launch to run the exploit. This dialog is a front-end for Beacon’s elevate command.

priv-escl_elevate

You may add privilege escalation exploits to Cobalt Strike through the Elevate Kit. The Elevate Kit is an Aggressor Script that integrates several open source privilege escalation exploits into Cobalt Strike. https://github.com/rsmudge/ElevateKit.

runasadmin - This command by itself, lists command elevator exploits registered with Cobalt Strike.

runasadmin [exploit] [command + args] - This command attempts to run the specified command in an elevated context.

Cobalt Strike separates command elevator exploits and session-yielding exploits because some attacks are a natural opportunity to spawn a session. Other attacks yield a “run this command” primitive. Spawning a session from a “run this command” primitive puts a lot of weaponization decisions (not always favorable) in the hands of your tool developer. With runasadmin, it’s your choice to drop an executable to disk and run it, to run a PowerShell one-liner, or to weaken the target in some way.

If you’d like to use a PowerShell one-liner to spawn a session, go to [beacon]AccessOne- liner .

priv-escl_powershell-one-liner

This dialog will setup a localhost-only webserver within your Beacon session to host a payload stage and return a PowerShell command to download and run this payload stage.

This webserver is one-use only. Once it’s connected to once, it will clean itself up and stop serving your payload.

If you run a TCP or SMB Beacon with this tool, you will need to use connect or link to assume control of the payload manually. Also, be aware that if you try to use an x64 payload—this will fail if the x86 PowerShell is in your $PATH.

Cobalt Strike does not have many built-in elevate options. It is easy to integrate privilege escalation exploits via Cobalt Strike’s Aggressor Script programming language though. To see what this looks like, download the Elevate Kit (https://github.com/cobalt-strike/ElevateKit). The Elevate Kit is an Aggressor Script that integrates several open source privilege escalation exploits into Cobalt Strike.

Elevate with Known Credentials

runas [DOMAIN\user] [password] [command] - This runs a command as another user using their credentials. The runas command will not return any output. You may use runas from a non- privileged context though.

spawnas [DOMAIN\user] [password] [listener] - This command spawns a session as another user using their credentials. This command spawns a temporary process and injects your payload stage into it.

You may also go to [beacon]AccessSpawn As to run this command as well.

With both of these commands, be aware that credentials for a non-SID 500 account will spawn a payload in a medium integrity context. You will need to use Bypass UAC to elevate to a high integrity context. Also, be aware, that you should run these commands from a working folder that the specified account can read.

Get SYSTEM

getsystem - This command impersonates a token for the SYSTEM account. This level of access may allow you to perform privileged actions that are not possible as an Administrator user.

Another way to get SYSTEM is to create a service that runs a payload. The elevate svc-exe [listener] command does this. It will drop an executable that runs a payload, create a service to run it, assume control of the payload, and cleanup the service and executable.

UAC Bypass

Microsoft introduced User Account Control (UAC) in Windows Vista and refined it in Windows 7. UAC works a lot like sudo in UNIX. Day-to-day a user works with normal privileges. When the user needs to perform a privileged action—the system asks if they would like to elevate their rights.

Cobalt Strike ships with a few UAC bypass attacks. These attacks will not work if the current user is not an Administrator. To check if the current user is in the Administrators group, use run whoami /groups .

elevate uac-token-duplication [listener] - This command spawns a temporary process with elevated rights and inject a payload stage into it. This attack uses a UAC-loophole that allows a non-elevated process to launch an arbitrary process with a token stolen from an elevated process. This loophole requires the attack to remove several rights assigned to the elevated token. The abilities of your new session will reflect these restricted rights. If Always Notify is at its highest setting, this attack requires that an elevated process is already running in the current desktop session (as the same user). This attack works on Windows 7 and Windows 10 prior to the November 2018 update.

runasadmin uac-token-duplication [command] - This is the same attack described above, but this variant runs a command of your choosing in an elevated context.

runasadmin uac-cmstplua [command] - This command attempta to bypass UAC and run a command in an elevated context. This attack relies on a COM object that automatically elevates from certain process contexts (Microsoft signed, lives in c:\windows*).

Privileges

getprivs - This command enables the privileges assigned to your current access token.

Mimikatz

Beacon integrates mimikatz. Use mimikatz [pid] [arch] [module::command] to inject into the specified process to run a mimikatz command. Use mimikatz (without [pid] and [arch] arguments) to spawn a temporary process to run a mimikatz command.

Some mimikatz commands must run as SYSTEM to work. Prefix a command with a ! to force mimikatz to elevate to SYSTEM before it runs your command. For example, mimikatz !lsa::cache will recover salted password hashes cached by the system. Use mimikatz [pid] [arch] [!module::command] or mimikatz [!module::command] (without [pid] and [arch] arguments).

Once in awhile, you may need to run a mimikatz command with Beacon’s current access token. Prefix a command with a @ to force mimikatz to impersonate Beacon’s current access token. For example, mimikatz @lsadump::dcsync will run the dcsync command in mimikatz with Beacon’s current access token. Use mimikatz [pid] [arch] [@module::command] or mimikatz [@module::command] (without [pid] and [arch] arguments).

Credential and Hash Harvesting

To dump hashes, go to [beacon]AccessDump Hashes . You can also use the hashdump [pid] [x86|x64] command from the Beacon console to inject the hashdump tool into the specified process. Use hashdump (without [pid] and [arch] arguments) to spawn a temporary process and inject the hashdump tool into it. These commands will spawn a job that injects into LSASS and dumps the password hashes for local users on the current system. This command requires administrator privileges. If injecting into a pid that process requires administrator privileges.

Use logonpasswords [pid] [arch] to inject into the specified process to dump plaintext credentials and NTLM hashes. Use logonpasswords (without [pid] and [arch] arguments) to spawn a temporary process to dump plaintext credentials and NTLM hashes. This command uses mimikatz and requires administrator privileges.

Use dcsync [pid] [arch] [DOMAIN.fqdn] <DOMAIN\user> to inject into the specified process to extract the NTLM password hashes. Use dcsync [DOMAIN.fqdn] <DOMAIN\user> to spawn a temporary process to extract the NTLM password hashes. This command uses mimikatz to extract the NTLM password hash for domain users from the domain controller. Specify a user to get their hash only. This command requires a domain administrator trust relationship.

Use chromedump [pid] [arch] to inject into the specified process to recover credential material from Google Chrome. Use chromedump (without [pid] and [arch] arguments) to spawn a temporary process to recover credential material from Google Chrome. This command will use Mimikatz to recover the credential material and should be run under a user context.

Credentials dumped with the above commands are collected by Cobalt Strike and stored in the credentials data model. Go to ViewCredentials to pull up the credentials on the current team server.

Port Scanning

Beacon has a built in port scanner. Use portscan [pid] [arch] [targets] [ports] [arp|icmp|none] [max connections] to inject into the specified process to run a port scan against the specified hosts. Use portscan [targets] [ports] [arp|icmp|none] [max connections] (without [pid] and [arch] arguments) to spawn a temporary process to run a port scan against the specified hosts.

The [targets] option is a comma separated list of hosts to scan. You may also specify IPv4 address ranges (e.g., 192.168.1.128-192.168.2.240, 192.168.1.0/24)

The [ports] option is a comma separated list or ports to scan. You may specify port ranges as well (e.g., 1-65535)

The [arp|icmp|none] target discovery options dictate how the port scanning tool will determine if a host is alive. The ARP option uses ARP to see if a system responds to the specified address. The ICMP option sends an ICMP echo request. The none option tells the portscan tool to assume all hosts are alive.

The [max connections] option limits how many connections the port scan tool will attempt at any one time. The portscan tool uses asynchronous I/O and it’s able to handle a large number of connections at one time. A higher value will make the portscan go much faster. The default is 1024.

The port scanner will run, in between Beacon check ins. When it has results to report, it will send them to the Beacon console. Cobalt Strike will process this information and update the targets model with the discovered hosts.

You can also go to [beacon] → Explore → Port Scanner to launch the port scanner tool.

Network and Host Enumeration

Beacon’s net module provides tools to interrogate and discover targets in a Windows active directory network.

Use net [pid] [arch] [command] [arguments] to inject the network and host enumeration tool into the specified process. Use net [command] [arguments] (without [pid] and [arch] arguments) to spawn a temporary process and inject the network and host enumeration tool into it. An exception is the net domain command which is implemented as a BOF.net domain.

The commands in Beacon’s net module are built on top of the Windows Network Enumeration APIs. Most of these commands are direct replacements for many of the built-in net commands in Windows (there are also a few unique capabilities here as well). The following commands are available:

computers - lists hosts in a domain (groups)

dclist - lists domain controllers. (populates the targets model)

domain - display domain for this host

domain_controllers - lists DCs in a domain (groups)

domain_trusts - lists domain trusts

group - lists groups and users in groups

localgroup - lists local groups and users in local groups. (great during lateral movement when you have to find who is a local admin on another system).

logons - lists users logged onto a host

sessions - lists sessions on a host

share - lists shares on a host

user - lists users and user information

time - show time for a host

view - lists hosts in a domain (browser service). (populates the targets model)

Trust Relationships

The heart of Windows single sign-on is the access token. When a user logs onto a Windows host, an access token is generated. This token contains information about the user and their rights. The access token also holds information needed to authenticate the current user to another system on the network. Impersonate or generate a token and Windows will use its information to authenticate to a network resource for you.

Use steal_token [pid] to impersonate a token from an existing process. If you’d like to see which processes are running use ps . The getuid command will print your current token. Use rev2self to revert back to your original token.

If you know credentials for a user; use make_token [DOMAIN\user] [password] to generate a token that passes these credentials. This token is a copy of your current token with modified single sign-on information. It will show your current username. This is expected behavior.

The Beacon command pth [pid] [arch] [DOMAIN\user] [ntlm hash] injects into the specified process to generate AND impersonate a token. Use pth [DOMAIN\user] [ntlm hash] (without [pid] and [arch] arguments) to spawn a temporary process to generate AND impersonate a token. This command uses mimikatz to generate AND impersonate a token that uses the specified DOMAIN, user, and NTLM hash as single sign-on credentials. Beacon will pass this hash when you interact with network resources.

Beacon’s Make Token dialog ( [beacon]AccessMake Token ) is a front-end for these commands. It will present the contents of the credential model and it will use the right command to turn the selected credential entry into an access token.

Kerberos Tickets

A Golden Ticket is a self-generated Kerberos ticket. It’s most common to forge a Golden Ticket with Domain Administrator rights

Go to [beacon]AccessGolden Ticket to forge a Golden Ticket from Cobalt Strike. Provide the following pieces of information and Cobalt Strike will use mimikatz to generate a ticket and inject it into your kerberos tray:

  1. The user you want to forge a ticket.
  2. The domain you want to forge a ticket for.
  3. The domain’s SID
  4. The NTLM hash of the krbtgt user on a domain controller.

Use kerberos_ticket_use [/path/to/ticket] to inject a Kerberos ticket into the current session. This will allow Beacon to interact with remote systems using the rights in this ticket.

Use kerberos_ticket_purge to clear any Kerberos tickets associated with your session.

Lateral Movement

Once you have a token for a domain admin or a domain user who is a local admin on a target, you may abuse this trust relationship to get control of the target. Cobalt Strike’s Beacon has several built-in options for lateral movement.

Type jump to list lateral movement options registered with Cobalt Strike. Run jump [module] [target] [listener] to attempt to run a payload on a remote target.

Jump Module Arch Description
psexec x86 Use a service to run a Service EXE artifact
psexec64 x64 Use a service to run a Service EXE artifact
psexec_psh x86 Use a service to run a PowerShell one-liner
winrm x86 Run a PowerShell script via WinRM
winrm64 x64 Run a PowerShell script via WinRM

Run remote-exec , by itself, to list remote execution modules registered with Cobalt Strike. Use remote-exec [module] [target] [command + args] to attempt to run the specified command on a remote target.

Remote-exec Module Description
psexec Remote execute via Service Control Manager
winrm Remote execute via WinRM (PowerShell)
wmi Remote execute via WMI

Lateral movement is an area, similar to privilege escalation, where some attacks present a natural set of primitives to spawn a session on a remote target. Some attacks give an execute-primitive only. The split between jump and remote-exec gives you flexibility to decide how to weaponize an execute-only primitive.

Aggressor Script has an API to add new modules to jump and remote-exec. See the Aggressor Script documentation (the Beacon chapter, specifically) for more information.

Lateral Movement GUI

Cobalt Strike also provides a GUI to make lateral movement easier. Switch to the Targets Visualization or go to ViewTargets . Navigate to [target]Jump and choose your desired lateral movement option.

The following dialog will open:

To use this dialog:

First, decide which trust you want to use for lateral movement. If you want to use the token in one of your Beacons, check the Use session’s current access token box. If you want to use credentials or hashes for lateral movement—that’s OK too. Select credentials from the credential store or populate the User, Password, and Domain fields. Beacon will use this information to generate an access token for you. Keep in mind, you need to operate from a high integrity context [administrator] for this to work.

Next, choose the listener to use for lateral movement. The SMB Beacon is usually a good candidate here.

Last, select which session you want to perform the lateral movement attack from. Cobalt Strike’s asynchronous model of offense requires each attack to execute from a compromised system.

There is no option to perform this attack without a Beacon session to attack from. If you’re on an internal engagement, consider hooking a Windows system that you control and use that as your starting point to attack other systems with credentials or hashes.

Press Launch . Cobalt Strike will activate the tab for the selected Beacon and issue commands to it. Feedback from the attack will show up in the Beacon console.

Other Commands

Beacon has a few other commands not covered above.

The clear command will clear Beacon’s task list. Use this if you make a mistake.

Type exit to ask Beacon to exit.

Use kill [pid] to terminate a process.

Use timestomp to match the Modified, Accessed, and Created times of one file to those of another file.

Continue Reading User Guide - Part 2