Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 2.29 KB

File metadata and controls

64 lines (42 loc) · 2.29 KB

Cobalt Strike REST API Python Script Examples

This project provides Python Examples for interacting with the Cobalt Strike REST API. The examples are built on top of the Code generated by the OpenAPI Generator.

py2rest

Note

This tool is still in early development stage and subject to breaking changes.

Video Walkthrough

Watch a demo

Requirements

  • The Cobalt Strike API Server should be running.
  • Cobalt Strike should be installed and configured.
  • Cobalt Strike should be properly licensed

Setup Environment

Download the openapi-generator-cli

curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar -o openapi-generator-cli.jar

Get the Cobalt Strike REST API Specification

curl -k -o api-docs.json https://172.22.192.130:50443/v3/api-docs

Generate the client lib for Python

java -jar openapi-generator-cli.jar generate -i  .\api-docs.json -g python -o .\CS_python_SDK --skip-validate-spec

Setup Python Environment

python -m venv cs_env
cs_env\Scripts\activate
pip install ./CS_python_SDK
pip install -r requirements.txt

🎮 Usage

Check this Jupyter Notebook for the actual examples.

🚑 Support

For issues and questions:


Warning

This tool provides direct access to Cobalt Strike capabilities, which include powerful adversary simulation capabilities. Use responsibly and only in environments where you have explicit permission to perform security testing.