How havocframework/havoc works
Havoc is a post-exploitation command-and-control framework. An operator launches the Qt client, connects to a configured teamserver, and uses session views to send tasks and receive agent results. The teamserver loads a profile, exposes listeners, builds payloads, registers Demon or custom agents, dispatches jobs, and publishes events. Demon transports callbacks and executes commands on targets. The sampled code also shows Python script extensibility, SQLite persistence, external-agent services, and hardware-breakpoint support; some subsystem links remain conservative because their callers were not sampled.
Main entry points: teamserver.go Teamserver Core · handlers.go Agent Handlers · Connector.cc Teamserver Connector · http.go HTTP C2
Components 26
Operator Client
- Client App
client/src/Main.cc - Qt Interface
client/src/UserInterface/HavocUi.cc - Connect Dialog
client/src/UserInterface/Dialogs/Connect.cc - Teamserver Connector
client/src/Havoc/Connector.cc - Session Views
client/src/UserInterface/Widgets/TeamserverTabSession.cc
Teamserver
- Server Command
teamserver/cmd/server.go - Teamserver Core
teamserver/cmd/server/teamserver.go - C2 Profile
teamserver/pkg/profile/profile.go - Listener Services
teamserver/pkg/service/listener.go - HTTP C2
teamserver/pkg/handlers/http.go - Agent Handlers
teamserver/pkg/handlers/handlers.go - Agent Registry
teamserver/pkg/agent/agent.go - Task Dispatch
teamserver/pkg/agent/commands.go - Event Bus
teamserver/pkg/events/events.go - Payload Builder
teamserver/pkg/common/builder/builder.go
Demon Runtime
- Demon Runtime
payloads/Demon/src/Demon.c - Demon Transport
payloads/Demon/src/core/Transport.c - Demon Commands
payloads/Demon/src/core/Command.c - Post-Exploitation
payloads/Demon/src/core - Hardware Breakpoints
payloads/Demon/src/core/HwBpEngine.c
Extensions Storage
- Script Manager
client/src/UserInterface/Widgets/ScriptManager.cc - External Gateway
teamserver/pkg/service/service.go - Python API
client/src/Havoc/PythonApi/PythonApi.cc - Client Database
client/src/Havoc/DBManger/DBManager.cc
Other components
- Operator
- External C2
Connections 25
- Operator → Client App: launches
- Client App → Qt Interface: initializes
- Qt Interface → Connect Dialog: opens
- Connect Dialog → Teamserver Connector: invokes
- Teamserver Connector → Teamserver Core: connects
- Teamserver Connector → Session Views: updates
- Server Command → Teamserver Core: starts
- Server Command → C2 Profile: loads
- Teamserver Core → Listener Services: starts
- Teamserver Core → Payload Builder: builds
- Listener Services → HTTP C2: serves
- HTTP C2 → Agent Handlers: dispatches
- Agent Handlers → Agent Registry: updates
- Agent Handlers → Task Dispatch: dispatches
- Agent Handlers → Demon Runtime: returns
- Demon Runtime → Demon Transport: uses
- Demon Transport → HTTP C2: callbacks
- Demon Commands → Post-Exploitation: executes
- Post-Exploitation → Hardware Breakpoints: supports
- Teamserver Core → Event Bus: publishes
- External Gateway → Teamserver Core: dispatches
- External C2 → External Gateway: integrates
- Script Manager → Python API: runs
- Script Manager → Client Database: stores
- Event Bus → Teamserver Connector: delivers