<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: deploying-cobalt-strike-infrastructure
description: >-
  Deploy and configure Cobalt Strike team server infrastructure including listeners, Malleable C2 profiles, and redirector chains.
domain: cybersecurity
subdomain: c2-frameworks
tags:
  - cobalt-strike
  - team-server
  - malleable-c2
  - beacon
  - infrastructure
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1071", "T1573"]
  cwe: ["CWE-300"]
  tools: ["Cobalt Strike", "cs2modrewrite", "Apache", "Nginx", "iptables"]
---

# Deploying Cobalt Strike Infrastructure

## Overview

Deploy and configure Cobalt Strike team server infrastructure including listeners, Malleable C2 profiles, and redirector chains.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `Cobalt Strike` | Security tooling |
| `cs2modrewrite` | Security tooling |
| `Apache` | Security tooling |
| `Nginx` | Security tooling |
| `iptables` | Security tooling |
| Isolated lab environment for testing | Environment requirement |
| Authorization and signed Rules of Engagement (RoE) | Environment requirement |
| Relevant target samples or systems acquired through authorized channels | Environment requirement |

## Quick Reference

```bash
# Start team server
./teamserver <team-server-ip> <password> c2.profile

# Generate Malleable C2 profile
cat <<'EOF' > c2.profile
set sleeptime "60000";
set jitter    "37";
set useragent "Mozilla/5.0 (Windows NT 10.0; Win64; x64)";

http-get {
    set uri "/api/v1/status";
    client { header "Accept" "application/json"; }
    server { header "Content-Type" "application/json"; output { print; } }
}
EOF

# Validate profile
./c2lint c2.profile
```

## Workflow

### Step 1: Preparation and Reconnaissance

```bash
# Identify target and gather initial intelligence
file ./target_sample
cobalt-strike --version 2>/dev/null || echo "Install Cobalt Strike"

# Set up working directory
mkdir -p /tmp/deploying-cobalt-strike-infrastructure/{output,logs,artifacts}
```

### Step 2: Primary Analysis

```bash
# Execute primary analysis with Cobalt Strike
# Refer to Quick Reference above for detailed commands
echo "[*] Running Deploying Cobalt Strike Infrastructure with Cobalt Strike..."

# Log all operations
script -q /tmp/deploying-cobalt-strike-infrastructure/logs/session.log
```

### Step 3: Deep Investigation

```bash
# Apply cs2modrewrite for secondary analysis
echo "[*] Deep investigation with cs2modrewrite..."

# Cross-reference findings
diff /tmp/deploying-cobalt-strike-infrastructure/output/primary.json /tmp/deploying-cobalt-strike-infrastructure/output/secondary.json
```

### Step 4: Documentation and Reporting

```bash
# Generate structured findings report
cat <<'EOF' > /tmp/deploying-cobalt-strike-infrastructure/output/report.json
{
  "technique": "deploying-cobalt-strike-infrastructure",
  "domain": "c2-frameworks",
  "tools_used": ["Cobalt Strike", "cs2modrewrite"],
  "findings": [],
  "recommendations": []
}
EOF
```

## Detection

```yaml
title: Cobalt Strike Infrastructure Detection
id: f7815f1d-18ca-496b-ae2d-88caa9ea8c86
status: experimental
description: Detects suspicious activity related to deploying cobalt strike infrastructure techniques in c2 frameworks context
logsource:
  category: network_connection
  product: windows
detection:
  selection:
    DestinationPort: 443
    Initiated: "true"
  condition: selection
level: high
tags:
  - attack.t1071
  - attack.t1573
  - attack.command_and_control
falsepositives:
  - Authorized penetration testing tools during scheduled assessments
```


**Detection Opportunities**

| Indicator | Source | Detection Logic |
|---|---|---|
| Cobalt Strike Infrastructure Detection | windows/network_connection | Sigma rule (high) |
| ATT&CK Coverage | MITRE ATT&CK | T1071, T1573 |

## Verification

- [ ] Environment and tools verified and operational
- [ ] Target samples acquired through authorized channels
- [ ] Primary analysis completed with findings documented
- [ ] Secondary validation performed with independent tooling
- [ ] All artifacts preserved in structured output directory
- [ ] Detection opportunities documented for blue team

## References

- [MITRE ATT&CK T1071](https://attack.mitre.org/techniques/T1071) — Related technique
- [Cobalt Strike Documentation](https://cobaltstrike.org/) — Primary tooling
- [cs2modrewrite Reference](https://cs2modrewrite.org/) — Secondary tooling
