Go Further with Cobalt Strike: Introducing Certified Operator II

We’re excited to announce Cobalt Strike Certified Operator II – a new training course focused on advanced Cobalt Strike customisation and evasion.  Building on our introductory training, this course is designed for operators who want to leverage custom evasion tradecraft in their red team exercises.

This is our first course release since Fortra’s acquisition of Zero-Point Security, bringing Cobalt Strike’s product expertise and Zero-Point Security’s training experience together within Fortra.  It marks the next step in our commitment to helping security professionals develop their offensive security skills.

When we announced our introductory course, we shared plans for advanced training covering custom payload generation, User-Defined Reflective Loaders, and evasion.  Cobalt Strike Certified Operator II delivers on that promise, exploring the customisation options that give operators greater control over payload behaviour, execution, and communications.

What You’ll Learn

The course explores opportunities for customisation and evasion throughout the Beacon lifecycle.  Topics include:

  • User-Defined Reflective Loaders – Examine detection opportunities during Beacon loading and approaches to managing that exposure using custom loaders.
  • Runtime Evasion – Explore both Cobalt Strike’s built-in capabilities for managing Beacon’s behaviours during execution; as well as operator-defined approaches through IAT hooking via Crystal Palace.
  • Post-Exploitation Evasion – Understand the detection considerations associated with post-exploitation activity, including DLLs and BOFs.
  • Custom Process Injection – Explore how to integrate custom injection techniques into Cobalt Strike’s workflows.
  • User-Defined Command and Control – Extend Beacon’s communications with custom C2 channels.

Together, these topics help operators understand how Cobalt Strike’s evasion through flexibility philosophy can enable them to bring novel evasion tradecraft to Beacon and its post-ex capabilities.  Evasion tradecraft can be written once and reused across the whole ecosystem.

Who Should Enroll

Cobalt Strike Certified Operator II is aimed at practitioners who are already comfortable with Cobalt Strike’s core functionalities and are ready to explore advanced customisation.  It’s a natural next step for learners progressing from our introductory training, as well as experienced operators looking to deepen their understanding of the platform’s extension points and evasion capabilities.

What’s Next?

Ready to take the next step?  Get in touch with the offensive security sales team for more information about Cobalt Strike Certified Operator II.

Interested and Want More Info?

The training is available on demand, so you can learn at your own pace anytime, anywhere.

For more information, get in touch with the offensive security sales team.

Cobalt Strike 4.13: Lost In Translation

Cobalt Strike 4.13 is now available. This release brings C scripting directly into Cobalt Strike via the new Beacon Interpreter, solves some long-standing issues with BOFs by adding BOF-PE support, and adds a new LLVM Beacon. It also enables centralised management and version control of all exported payloads through the Payload Store, resolves the need to restart the Teamserver to change Malleable C2 settings via Malleable Profile Overrides, and adds support for full streaming via WebSockets and gRPC.

Additionally, we have added support for modern docking and customisable tables in the Cobalt Strike UI, overhauled credential management, and made numerous UX and QoL improvements to significantly enhance existing Red Team workflows.

4.13 Release Comic
Click to expand

Do the Post-Ex Evolution

Beacon Object Files (BOFs) have been a hugely important development in Beacon’s Post-Ex capabilities. They have proven to be extremely popular and a very powerful way to expand Beacon’s functionality.

BOFs were originally designed by Cobalt Strike founder Raphael Mudge as an abstraction over writing position independent code (PIC) with some of the conveniences restored (e.g. dynamic function resolution etc.). Hence, BOFs were  intended to be lightweight and have minimal overhead when executing in memory by design.

Over time, operators have pushed this design to its limit. Many users have wanted to write more complex tradecraft (i.e. ‘abstract up’) and have got frustrated with the lack of support for higher-level language abstractions (e.g. exception handlers).

Additionally, there are also times when the workflow of BOFs feels clunky due to the requirement of needing to allocate memory. For example, if you write a BOF to simply free memory, Beacon still needs to allocate (and free) memory in order to execute it.

In Cobalt Strike 4.13, we are introducing the Beacon Interpreter and BOF-PE support to solve these problems.

The Beacon Interpreter

The Beacon Interpreter enables Cobalt Strike users to write scriptable C code which can be directly executed by Beacon. When you run a Beacon Interpreter script (e.g. helloworld.c), the Teamserver will compile it to intermediate byte code and then send it to Beacon to be executed in a virtual machine, as shown in the diagram below:

Fig 1:A high-level diagram showing how the Beacon Interpreter works under the hood.

As the VM is native to Beacon, it does not need to allocate any additional memory (or fluctuate the memory permissions of previously allocated memory). Furthermore, because the compilation is handled by the Teamserver, users do not need to compile their C scripts ala BOFs. The Beacon Interpreter was initially based off the open-source picoc project, however we have significantly re-architected / expanded upon it to suit Beacon’s requirements.

Users can interact with the Beacon Interpreter via the beacon-interpreter command, the aggressor function bbeacon_interpreter, and via the REST API. However, we have also added a Script Editor view (i.e. IDE) directly into the Cobalt Strike GUI. This idea came from dogfooding the Beacon Interpreter and from some frustrations with the slow feedback loop associated with BOF development (write BOF, compile it, re-run it, check Beacon Console, repeat etc.). With the Script Editor you can rapidly develop capabilities from within the Cobalt Strike client and get near instantaneous feedback.

It is very easy to write or port existing C code to the Beacon Interpreter and it attempts to align closely to the C standard between C89/C99. However, there are some subtleties when interacting with the Windows API. For the Beacon Interpreter to know how to call a given Windows API, it needs a BOF style DFR function definition as shown below for LoadLibraryA:

KERNEL32$LoadLibraryA: ptr (ptr);

A full explanation of the syntax above is out of scope for the release blog, but see the documentation here and here for more information. However, once declared, LoadLibrary can be used as per standard Windows development.

To make life as easy as possible, the Teamserver comes bundled with a number of headers for common Windows functionality. These can be accessed via standard C includes, e g. #include <msvcrt.h> to access the Microsoft C runtime. Beacon Interpreter scripts also have full access to the BOF API via the #include <beacon.h> header. Additionally, if you need to debug scripts via tools such as DebugView, we have included a DbgPrintf function available in internal.h.

As a word of caution, these headers are not a 1:1 mapping with their respective Windows headers and there will be gaps, but you can add your own headers to the Teamserver via the server/interpreter/includes/user folder which will be picked up immediately.

The video below goes through all these steps and gives a feel for the Beacon Interpreter in action:

Video 1: A demo showing how to get up and running with the Beacon Interpreter.

We have been experimenting with the Beacon Interpreter throughout development and have endeavoured to make it as robust as possible but there still may be edge cases in the compiler that need to be resolved. If you do find an issue, please let us know via our feedback form (Support -> Cobalt Strike Feedback Form) and if possible, a copy of a test script to reproduce the issue.

Lastly, to help script development we have open sourced a Beacon Interpreter repository on our public Github which contains a copy of the headers Cobalt Strike ships with, a skills.md to aid AI agents, and an example Beacon Interpreter script.

BOF-PE

In Cobalt Strike 4.13, we have added support for BOF-PEs. This new format was originally proposed by @CCob and was designed to solve some of the limitations of BOFs previously raised.

This means operators can now develop tradecraft in DLL/EXE format that supports error handling, advanced C++ features, external libs, and the BOF API, without needing to employ work arounds that BOF writers frequently employed. The beauty of BOF-PEs is that you can decide on how small or feature rich the tradecraft you employ is. It also opens the door to writing post-ex tooling in other languages (i.e. Rust).

You can run BOF-PEs via the new inline-execute-pe command (or via aggressor binline _execute _pe), as shown below:

Fig 2: A screenshot showing the new inline-execute-pe command in the Beacon console.

We are planning to release our own BOF-PE template but for now we recommend using CCob’s, which can be found here.

Additionally, we have also added BOF-PE support to UDC2. Hence, if you want to write a more complex C2 channel that requires 3rd part libs etc., BOF-PE makes it easier to incorporate these requirements into your custom tooling.

Transforming Beacon

Beacon has historically relied upon the Microsoft Visual C++ (MSVC) compiler. However, a long-term ambition for the Cobalt Strike team has been to migrate Beacon to use the LLVM compiler toolchain due to its novel capabilities. We have previously demonstrated some of our research into these capabilities via our release of the Mutator Kit and Austin Hudson’s booth presentation at Black Hat 2025.

In this release, we have taken a huge step forward in our research and are introducing a new LLVM Beacon. This is a Beacon built using the LLVM toolchain which contains a custom C runtime and has a much smaller payload size.

You can choose which Beacon you would like to use (MSVC or LLVM) when creating a listener, as shown in the screenshot below:

Fig 3: A screenshot of the Listener Creation dialogue with the new ‘Template’ option highlighted.

This is just the start of our LLVM journey (watch this space) and we intend to deprecate the MSVC Beacon in the next release.

Payload Management: Malleable Profile Overrides and Payload Store

One common challenge when working with Cobalt Strike’s customisation features, such as UDRLs/Sleepmasks, is version control of specific payloads. This process often entails multiple iterations of payload creation and the sharing of specific payload versions across a wider team which can get unwieldy.

To overcome these issues, we have added the Payload store, which adds centralised storage and versioning of Beacon payloads (h/t to Cody Thomas for his work on Mythic which inspired some of these changes).

Now every running Beacon can be traced back to its specific version in the payload store (and hence the configuration it was exported with), and all exported Beacon payloads are now automatically tracked by Cobalt Strike. Additionally, the inject/spawn commands now support being passed a specific payload name from the payload store, which greatly simplifies workflows.

Furthermore, for those customers that have subscribed to Cobalt Strike Research Labs (CS:RL) the payload store provides a seamless integration with CS:RL and Beacon Booster. As an example, you can export a “boosted” Beacon from CS:RL, add it to the payload store, and incorporate it throughout your operations.

Additionally, we have introduced Malleable Profile Overrides to solve the longstanding problem of needing to restart the Teamserver in order to modify a specific Malleable C2 setting.

You can now modify your Malleable Profile to enable / disable specific settings when exporting a payload. For example, if you’re experimenting with UDRL development, you can create/save a Malleable C2 override (.mpo) to disable the Sleepmask and apply this setting to specific payloads. This metadata is also captured in the payload store.

note
Malleable Profile Overrides only apply to payload specific settings. If you want to modify options which impact a listener, you will still need to restart the Teamserver.

The demo below shows the payload management features (as well as the LLVM Beacon) in action:

Video 2: A demo showing the new payload management features in Cobalt Strike 4.13.

UX

We have continued to build upon the GUI updates made in 4.12 by adding:

  • Support for docking in the UI.
  • New fonts and improved copy and paste behaviour. As an example, you can now copy by value/row for any table/tree view.
  • Ctrl-left/right now jumps words in the Beacon console.
  • Customisable tables via Aggressor. The idea behind this was to provide a more user-friendly way of rendering information which may be dumped to the Beacon console (e.g. the results of an LDAP query). Furthermore, these tables support custom actions (i.e. you can right click on a field within the table and use it to trigger a specific action).

The demo below shows these features being combined to dump the results of an LDAP query into a custom table and then fire off further actions (‘Query CN’) based on the results:

Video 3: A demo showing the new customisable tables in action in combination with Trusted Sec’s ldapsearch BOF.

Credential Management

We have refreshed the credential store to support modern credentials and provide a better user experience by:

  • Adding support for highlighting text in the Beacon console and adding it to the credential store via a right-click. This means it is much simpler to parse and manage Kerberos tickets from the Beacon console.
  • Adding support for custom right-click actions in the credential store (this works the same way as for user customisable tables).
  • Decluttered the credential tab and updated the credential data model.

The demo below shows an internal experiment in chaining these features together, via an Aggressor script for Rubeus that we will open source soon, to create much smoother workflows for handling Kerberos tickets:

Video 4: A demo showing a reimagined red team workflow for handling Rubeus tickets within Cobalt Strike.

note
This demo uses a custom Aggressor script for Rubeus to automatically parse Kerberos tickets and add them to the credential store via the Aggressor function credential_add.

Automation

We also wanted to build on the REST API which was released in Cobalt Strike 4.12:

  • We have now added support for full streaming via WebSockets and gRPC. This avoids a need for ‘status polling’ and thus provides better integration with other tooling in the Cobalt Strike ecosystem.
  • One issue in the initial release of the REST API was that not all tasks were automatically marked as completed. This was due to constraints in Beacon’s C2 communications which have now been fixed. Hence, all tasks are now marked as completed (or cancelled).

The video below shows WebSockets and gRPC in action:

Video 5: A demo showing the new WebSockets and gRPC streaming in action.

Additional Updates

This release also contains a number of additional QoL updates, including:

  • Beacon now supports the checkin_delay Malleable C2 option. This will delay Beacon’s initial check-in to break event correlation detection heuristics on reflective loading and the immediate metadata exchange.
  • There is now no size limit on either Sleepmask BOFs or UDC2 BOFs/BOF-PEs.
  • To speed up the feedback loop for Aggressor Scripting, we have added a brk() function. When this function is hit, Aggressor will break script execution and display the script engine state, local variables, stack etc.
  • The default Cobalt Strike Sleepmask now performs return address spoofing for all proxied BeaconGate calls.
  • We have added a new (opt in) payload export type for Cobalt Strike Research Labs – CS:RL. This will export Beacon in a format which can easily be ingested by the Beacon Booster to apply bespoke tradecraft. For more information on CS:RL see this blog post.
  • As per Rastamouse’s BOF Cocktails blog, there is a new Aggressor hook, BEACON_INLINE EXECUTE, which allows users to hook all BOFs pre-execution. This enables users to use tools such as Crystal Palace to merge in tradecraft on the fly to all BOFs.
  • We have updated the process explorer view so that it gathers additional context such as the integrity level, command line arguments etc. This is shown in the screenshot below:
New Process Listing in Cobalt Strike
Click to expand
Fig 4: A screenshot showing the updated process listing for Cobalt Strike 4.13, which now contains additional fields such as the integrity level, command line arguments etc.

To see a full list of what’s new in Cobalt Strike 4.13, please check out the release notes.

To purchase Cobalt Strike or learn more, please contact us.

Lastly, if you have ideas/feedback on the current state of Cobalt Strike, or thoughts on the next release, please:

  • Fill in our customer survey
  • A large part of the Cobalt Strike R&D team will be at Blackhat USA 2026 – drop by the Fortra booth if you would like to chat!
  • Send us your thoughts via the Cobalt Strike feedback form (Support -> Cobalt Strike Feedback Form)

Cobalt Strike Infrastructure Maintenance - May 2026

We will be introducing a small change to the Cobalt Strike download and authentication workflow on Monday May 18th, 2026.  This change is not expected to impact normal, interactive  downloading of the Cobalt Strike software via a web browser, but may affect certain automated processes that rely on direct, programmatic retrieval of the Cobalt Strike installer.

Additional Verification for Download and Authentication Endpoints

To improve the resilience and reliability of our distribution infrastructure, we are adding Cloudflare Turnstile as an additional verification step to the following endpoints:

  • Cobalt Strike download
  • Arsenal Kit download
  • Auth file generator

This verification mechanism is designed to help distinguish between typical interactive user activity and brute force attacks.

We understand that some customers rely on automation for internal workflows. While interactive access through a browser will continue to function as expected, workflows that depend on fully automated retrieval of these resources may require adjustment. For customers that rely on automated provisioning it is recommended to download the Distribution Package interactively and host it yourself.


The Cobalt Strike Update Program will continue to work as usual.

Me, Myself and AI: Internal Experiments with the CS REST API

This blog is all about experimenting and having fun with the new CS REST API and the generative AI ecosystem.

We’ll demonstrate how we used Claude Desktop and its Model Context Protocol (MCP) integration to automate and orchestrate attacks through the CS REST API. We will also share the following internal (vibe-coded) experiments, intended to serve as inspiration for future community projects:

  • Calling the REST API from the Cobalt Strike GUI.
  • A Cobalt Strike WEB UI.
  • AI Assistance for Data Analysis.

So, grab a coffee and let’s dive in!

Experiment 1: Using Cobalt Strike with Claude Desktop

Anthropic recently published a blog post titled “Disrupting the first reported AI-orchestrated cyber espionage campaign”, where they break down how a cyber-crime group used agentic AI to run a sophisticated espionage operation. The attackers used the models not just to gather intelligence, but to plan and execute parts of the intrusion itself. Therefore, it is essential for Red Teams to be able to simulate these attacks so that they can better understand the role of AI augmentation in offensive security and better help clients with their defensive thinking.

note
We don’t mean to state the obvious, BUT, if you want to experiment with Cobalt strike and LLMs, be careful on exposing sensitive customer data to external services. In the examples below, we rely on Anthropic’s Claude for simplicity. The general concepts apply also to a local self-hosted model.

Model Context Protocol (MCP)

The Model Context Protocol (MCP) is an open-source standard introduced by Anthropic that makes it possible to connect AI applications to external systems. Anthropic refers to MCP as a “USB-C port for AI applications” meaning that it provides a standardized way to connect AI applications like Claude or Chat GPT to third-party components like Cobalt Strike.

MCP follows a client-server architecture, where an MCP Host coordinates and manages one or more MCP Clients that each connect to a single MCP Server that provides context about the external component. Put simply, the MCP Server is essentially a proxy between Claude and the external service.

Claude Desktop is Anthropic’s chat application that runs locally and interacts with the Claude LLM. In addition to general chat functionality, it can also act as an MCP Host which makes it possible to quickly and easily integrate third-party MCP Servers.

To experiment, we created a Cobalt Strike MCP Server that allows Claude Desktop to interact with the Cobalt Strike REST API so that it can understand and act on prompts like:

  • “List all Beacons”
  • “Execute a command in Beacon X”
  • “Harvest credentials”
  • “Query listeners”

A high-level architecture diagram of Claude, the Cobalt Strike MCP Server, and the REST API can be seen below.

Fig 1: High-level architecture diagram of Claude, the Cobalt Strike MCP Server, and the REST API.

Integration with Cobalt Strike

We built the MCP Server using FastMCP, which loads an OpenAPI schema and automatically turns endpoints into “MCP Tools” which are functions that the LLMs can call— reducing manual setup. This means REST endpoints like updateHTTPsListener become available to Claude.

The short python script below fetches the OpenAPI spec (which can be found at /v3/api-docs in the REST API) and creates the FastMCP server from it.

# Fetch the OpenAPI specification
openapi_spec = await self.cs_client.fetch_openapi_spec(spec_url)

# Get the authenticated HTTP client for FastMCP to use
http_client = self.cs_client.get_authenticated_client()

# Create the FastMCP Server from the OpenAPI spec
# Exclude authentication endpoints since MCP handles auth automatically
create_kwargs = {
    "openapi_spec": openapi_spec,
    "client": http_client,
    "name": self.server_name,
    "tags": {"openapi", "cobalt-strike"},
    "route_maps": [
        RouteMap(tags={"Security"}, mcp_type=MCPType.EXCLUDE),
        RouteMap(pattern=r"^/.*/config/resetData", mcp_type=MCPType.EXCLUDE),
    ],
}


#
self._mcp_server = FastMCP.from_openapi(**create_kwargs)

#
if self.instructions:
    self._mcp_server.instructions = self.instructions

return self._mcp_server

When the FastMCP server is run (mcp_server.run()), Claude will automatically register the tools published by the MCP Server created above.

tip
In the provided example, we excluded the authentication route as well as resetData (via MCPType.EXCLUDE). To apply additional “guard rails” to the Cobalt Strike MCP Server update cs_server.py file following the FastMCP documentation.

The CS API’s granular endpoints let you implement command restrictions. For example, you can define exactly what actions the model can perform which provides control over its capabilities. For example, we could use Claude to augment our workflow and help with host enumeration (ps/ls/reg/etc) but only perform high impact actions ourselves manually.

To connect Claude Desktop to our newly created MCP Server, we simply update the Claude Desktop config file (see README for details). Once configured, Claude sees the list of MCP Tools. From Claude’s perspective, these simply appear as functions it can call. In the picture below you can see the list of available tools listed in Claude Desktop:

Fig 2: List of available tools for the Cobalt Strike MCP server in Claude Desktop.

Claude understands the structure of the tools and the types of arguments required, so it can build complex attack chains autonomously (independently but not uncontrolled).

For example:

  1. Identify the Beacon running on a user workstation.
  2. Query its process list.
  3. Attempt credential harvesting.
  4. Parse the output.
  5. Add the harvested credentials to the inventory to later laterally move on another host.
  6. Report back.
note
This approach is very similar to the one published by Ibai Castells a.k.a. kreep, developed independently but inspired by the same idea.

Seeing it in Action

To test this experiment, we connected Claude to our Cobalt Strike MCP Server and provided the following prompt:

You are assisting a Red Team operator during an internal engagement. The objective is to simulate a realistic intrusion scenario to evaluate detection, response and resilience capabilities of the target environment.
I have established initial access on several machines and am operating through Beacon sessions in Cobalt Strike.
I need your help to make an analysis of the processes in the compromised targets. Besides that, if you find a machine with a logged in user, run a search in his files and folders looking for clear text passwords.
When possible, use native commands instead of launching Operating system shell. Leverage the MCP Servers you have available.

Video 1: A PoC MCP Server for Cobalt Strike.

In response, Claude performed the following actions:

  1. Listed available Beacons: It found our foothold on the user workstation.
  2. Inspected the environment: It looked at processes, user sessions, and domain info.
  3. Triggered credential harvesting: The MCP Server called the correct REST endpoint, returning creds that the model could immediately reason on about.
  4. Analyzed the harvested data: Claude checked which credentials could be used for lateral movement, the likely reachable hosts, and privilege levels.
  5. Executed lateral movement: Using the allowed tools (and staying within the access boundaries we configured), it pivoted to a second machine.

All via the REST API, with the MCP Server mediating every step. The result is a safely executed, fully autonomous, controlled attack flow.

Closing the Loop: Augmenting, Not Replacing

These workflows give Red Team operators smarter assistants that can enrich data, propose next steps, and handle repetitive tasks, all while humans remain in control of strategy and decision-making.

The combination of the Cobalt Strike REST API and modern LLM/AI tooling unlocks a brand-new space for Red Teams.

We’ve only scratched the surface here, but mixing them together offers new opportunities for operators to enhance and streamline their existing workflows but also create new and interesting ways to tackle problems.

For example, a setup like the one shown below, in which LLMs consume data from multiple sources like Nemesis, Bloodhound, Cobalt Strike, Red Elk and/or VirusTotal to support and augment Red Team engagements.

Fig 3: Setup for an AI augmented Red Team operation.

Experiment 2: Calling the REST API from the Cobalt Strike Client

The REST API provides centralized artifact management so that all users can operate with the same payloads/tools etc. However, server-side storage is not currently supported natively in the Cobalt Strike GUI . Therefore, in this experiment, we wanted to bridge the gap between the Cobalt Strike client and the REST API to show how users can extend their client-side workflows without leaving the familiarity of the Cobalt Strike interfaces (or their new favorite theme).

To make that task easier, we have released the Sleep2Rest prototype, a library that provides Aggressor Script functions for interacting with the REST API from the Cobalt Strike client. It supports authentication, GET/POST/PUT/DELETE requests, and automatic parsing of JSON responses into native Sleep hashes and arrays.

Below is a short example aimed at showing how to use the Sleep2Rest library to call the REST API from Aggressor Script.

#import sleep2rest
include(script_resource("cs_rest_api_lib.cna"));

# Authenticate and get beacons
$response = apiGET("/api/v1/beacons");
if ($response["status"] == 200) {
    $beacons = $response["content"];
    println("Beacons: " . $beacons);
} else {
    println("API error: " . $response["status"]);
}

# POST example
$beacon_id = "123456789";
$body = '{"command": "ps"}';
$response = apiPOST("/api/v1/beacons/".$beacon_id."/consoleCommand", $body);
if ($response["status"] == 200) {
    println("Response: " . $response);
    $statusUrl = $response["content"]["statusUrl"];
    
    # Get task result
    $task_response = apiGET($statusUrl);
    $status = $task_response["content"]["taskStatus"];
    println("Final GET Response: " . $task_response);
} else {
    println("API error: " . $response["status"]);
}

To enable Cobalt Strike users to access the REST API’s centralized storage from the Cobalt Strike GUI we have created two prototypes:

  • Server-side payload generation: This script adds a menu to generate Stager Payloads, Stageless Payloads and to download previously generated server-side payloads. The full code can be found here.

Video 2: Server-side payload generation from the Cobalt Strike client.

  • Server-side artifact execution: This script adds a new command that provides the capability to run server-side stored .NET assemblies. It can be easily extended to run BOFs. The full code can be found here.

Video 3: Server-side .NET assembly execution from the Cobalt Strike client.

Experiment 3: Vibe-coding a Web/Mobile User Interface for Cobalt Strike

It’s Sunday evening, your laptop is stowed away, but you need to act quickly after receiving a notification that a phishing email was clicked—and you need to deploy persistence…

In this experiment, we wanted to see if the CS REST API makes it realistic for users to create their own UIs and run basic actions (despite the lack of event subscription). However, in the spirit of this post, we put away intellisense and vibe-coded a web/mobile app to see if we could continue to operate engagements in unexpected situations.

An introduction to vibe-coding and how it works is beyond the scope of this blog. However, we started with a simple prompt in Copilot from Visual Studio Code and then refined it to create the cobaltstrike-web-client prototype.

The following video shows the Web UI running through a web browser on a mobile device to demonstrate the new capabilities enabled by the REST API.

Video 4: Cobalt Strike Web client prototype.

Experiment 4: AI Assistance for Data Analysis

In a previous blog post, we introduced the py2rest project to show how to interact with the REST API with Python (from a Jupyter notebook).

In this experiment, we built upon py2rest to integrate it with Google Gemini and demonstrate an alternative approach to the model we used in our experiments with Claude. In the following sections, we will show how we can use py2rest to enumerate a host via the CS REST API and then enrich the output via Generative AI.

The key difference from the MCP Server described earlier is that, in this scenario, the AI has no direct access to Cobalt Strike and operates purely as a typical LLM-driven chatbot. This approach allows us to enhance our findings with generative AI without directly connecting our Cobalt Strike instance to an LLM. It also provides an opportunity to anonymize/remove any sensitive data before making a request.

note
We used Google Gemini for this example, but it would be easy to port it to any LLM that has an API.

To interact with Google Gemini via the API, we can send a POST request with a JSON structure containing our prompts, and it will respond back. Below you can see a basic example of a JSON body that takes a single text input:

{
    "contents": [
      {
        "parts": [
          {
            "text": "How does AI work?"
          }
        ]
      }
    ]
  }

To handle the integration with Google Gemini, we created the GenAIClient class shown below. This class contains a single generate() function that takes a prompt, creates the required JSON structure, sends the request to the Gemini API endpoint and gets the response.

import requests,json

class GenAIClient:
    def __init__(self, api_key: str):
        self.api_key = api_key
        self.url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent"

        # Create a persistent session
        self.session = requests.Session()
        self.session.headers.update({
            "x-goog-api-key": self.api_key,
            "Content-Type": "application/json"
        })

    def generate(self, prompt: str):
        payload = {
            "contents": [
                {
                    "parts": [
                        {
                            "text": prompt
                        }
                    ]
                }
            ]
        }

        response = self.session.post(self.url, json=payload)
        response.raise_for_status()
        return response.json()["candidates"][0]["content"]["parts"][0]["text"]
genai_client = GenAIClient(api_key="<YOUR GOOGLE GEMINI API KEY>") # Replace with your Google Gemini API Key

To enumerate the target host from the py2rest Jupyter notebook, we called some specific routes defined by the REST API. For example, ps, ls, …

def get_files_in_system_data(bid):
    interesting_directories = ["C:\\Windows\\System32\\drivers","C:\\Windows\\sysnative\\drivers", "C:\\Program Files","C:\\Program Files (x86)", "C:\\Users\\Public"]
    folders_data = {}
    for directory in interesting_directories:
        mylsdto=openapi_client.models.LsDto(path=directory)
        file_and_registry_api = openapi_client.FileAndRegistryApi(cs_api.api_client)
        task_result = file_and_registry_api.execute_ls(bid=bid, ls_dto=mylsdto)
        final_result=get_task_result(task_result.status, task_result.task_id)
        if final_result:
            folders_data[directory] = [b.__dict__ for b in final_result[0].actual_instance.contents]
    return folders_data

def get_processes_in_system_data(bid):
    […]
    return processes_data

def get_domain_info_data(bid):
    [..]
    return domain_info_data

host_info={
    "files_info":get_files_in_system_data(bid=bid), 
    "processes_info":get_processes_in_system_data(bid=bid),
    "domain_info":get_domain_info_data(bid=bid)
    }

Once host enumeration was complete, we created the prompt and sent it to Gemini:

def generate_prompt_from_data(data: dict) -> str:
    """
    Generate a prompt based on the provided data.
    """
    prompt = f"""
    You are a cybersecurity analyst reviewing Cobalt Strike beacon activity. Your task is to analyze the provided beacon data and identify:
    1. Security Solutions Detected: List any antivirus, EDR, or other security solutions.
    2. Notable processes, development tools and applications observed in the compromised machine.
    3. Potential Security Risks and Vulnerabilities
    4. Next steps for adversary simulation and red team operations.
    
    The provided data includes list of files in the system, processes running and domain information. Here is the host data for analysis:
    {json.dumps(data, indent=2)}
    """
    return prompt


prompt = generate_prompt_from_data(host_info)
generated_response = genai_client.generate(prompt)

The complete code for the example can be found here.

Seeing it in Action

We added the above experiment to the py2rest Jupyter notebook so that users can easily interact with the REST API and Google Gemini.

After running the last recipe “AI Assistance for Data Analysis” we got a list of the security solutions detected in the compromised machine. We also discovered notable processes, development tools, and applications that could represent potential security risks and vulnerabilities to finally provide the next steps for our engagement.

This video demonstrates setting up the OpenAPI SDK for Python and running the examples described:

Video 5: OpenAPI SDK for Python setup and py2rest examples.

Conclusion

We hope that you have enjoyed the examples in this post, and that you feel inspired to experiment and have fun with Cobalt Strike too.

Most of all, we hope it has shown that it is possible to take part in the security conversation by simply tinkering, having fun, and experimenting with the product. Everyone can make meaningful contributions to the community regardless of their experience.

Keep us posted and submit your projects to the Community Kit to make our users stronger together.

Lastly, if you have any idea or suggestion, please use our new feedback form where you can directly submit feedback on Cobalt Strike. You can find a link to the form on our support page under the “Support” header. You can also access this form directly from your Cobalt Strike client via Help->Support.