<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: setting-up-havoc-framework
description: >-
  Set up Havoc C2 framework with demon agents, custom listeners, and third-party integration for advanced adversary simulation.
domain: cybersecurity
subdomain: c2-frameworks
tags:
  - havoc
  - demon
  - teamserver
  - post-exploitation
  - adversary-simulation
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1071", "T1573"]
  cwe: ["CWE-300"]
  tools: ["Havoc", "havoc-client", "python3", "golang"]
---

# Setting Up Havoc Framework

## Overview

Set up Havoc C2 framework with demon agents, custom listeners, and third-party integration for advanced adversary simulation.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `Havoc` | Security tooling |
| `havoc-client` | Security tooling |
| `python3` | Security tooling |
| `golang` | 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
# Build Havoc
git clone https://github.com/HavocFramework/Havoc.git
cd Havoc && make

# Start team server
./havoc server --profile profiles/havoc.yaotl

# Havoc profile configuration
Teamserver {
    Host = "0.0.0.0"
    Port = 40056
    Build { Compiler64 = "/usr/bin/x86_64-w64-mingw32-gcc" }
}

# Generate demon agent via Havoc client
# Payload > Generate > Demon > Windows EXE
```

## Workflow

### Step 1: Preparation and Reconnaissance

```bash
# Identify target and gather initial intelligence
file ./target_sample
havoc --version 2>/dev/null || echo "Install Havoc"

# Set up working directory
mkdir -p /tmp/setting-up-havoc-framework/{output,logs,artifacts}
```

### Step 2: Primary Analysis

```bash
# Execute primary analysis with Havoc
# Refer to Quick Reference above for detailed commands
echo "[*] Running Setting Up Havoc Framework with Havoc..."

# Log all operations
script -q /tmp/setting-up-havoc-framework/logs/session.log
```

### Step 3: Deep Investigation

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

# Cross-reference findings
diff /tmp/setting-up-havoc-framework/output/primary.json /tmp/setting-up-havoc-framework/output/secondary.json
```

### Step 4: Documentation and Reporting

```bash
# Generate structured findings report
cat <<'EOF' > /tmp/setting-up-havoc-framework/output/report.json
{
  "technique": "setting-up-havoc-framework",
  "domain": "c2-frameworks",
  "tools_used": ["Havoc", "havoc-client"],
  "findings": [],
  "recommendations": []
}
EOF
```

## Detection

```yaml
title: Setting Up Havoc Framework Detection
id: 4bd495c0-e369-44cd-9c90-fe1b3376477f
status: experimental
description: Detects suspicious activity related to setting up havoc framework 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 |
|---|---|---|
| Setting Up Havoc Framework 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
- [Havoc Documentation](https://havoc.org/) — Primary tooling
- [havoc-client Reference](https://havoc-client.org/) — Secondary tooling
