ARTEX-God: When Your Penetration Testing Framework Needs Its Own Attack Graph
Hook
Most autonomous pentesting tools fail because they treat every LLM invocation as a fresh start—there's no memory of which credentials were harvested, which hosts were pivoted to, or which attack steps depend on others completing first.
Context
Traditional vulnerability scanners excel at parallel detection: throw 10,000 HTTP requests at a target, pattern-match responses, report findings. But modern penetration testing isn't about finding isolated bugs—it's about chaining them. You discover subdomain A, extract credentials from endpoint B, pivot to internal service C, escalate privileges, and establish persistence. Each step depends on prior reconnaissance.
LLM-based security tools promised to automate these kill chains, but most implementations hit the same wall: stateless execution. Each agent invocation is a blank slate. GPT doesn't remember that Worker 3 already enumerated SSH keys or that the lateral movement step depends on credential harvesting finishing first. ARTEX-God, a hardened fork of the ARTEX autonomous pentesting framework, solves this with an architecture decision that feels obvious in hindsight: separate graphs for 'what exists in the world' versus 'what our attack explored,' plus a persistent todolist that survives across stateless LLM sessions.
Technical Insight
The dual-graph architecture is the beating heart of ARTEX-God. A global Asset Graph in PostgreSQL maintains the ground truth: root_domain → subdomain → service → endpoint hierarchies with company attribution. This is your normalized reconnaissance layer—every discovered asset gets deduplicated here, and multiple scan tasks can query it. Separately, each penetration task gets its own Exploration Graph tracking goal → intent → fact → finding derivation chains. This is your attack provenance—it answers 'how did we discover this RCE?' by walking backward through intent ancestry.
The elegance emerges in the anchor table that bridges both graphs:
CREATE TABLE anchors (
intent_id UUID REFERENCES exploration_intents(id),
asset_id UUID REFERENCES assets(id),
relationship_type VARCHAR(50), -- 'scanned_from', 'exploited_via', etc.
metadata JSONB
);
This O(1) bidirectional link enables queries like 'show me all intents that touched this compromised server' or 'visualize asset coverage for this task.' You get cross-task asset deduplication without polluting individual task provenance.
But the real innovation is the persistent planner todolist. In event-driven LLM architectures, graph mutations trigger the planner agent to decide next steps. Problem: the planner is stateless. It might spawn 'lateral_movement_via_ssh' and 'harvest_aws_credentials' simultaneously, even though lateral movement depends on having credentials first. ARTEX-God's solution:
type PlannerTodolist struct {
TaskID uuid.UUID
Dependencies map[uuid.UUID][]uuid.UUID // intent_id -> prerequisite_intent_ids
Status map[uuid.UUID]string // 'blocked', 'ready', 'executing'
}
func (p *Planner) OnGraphMutation(ctx context.Context, taskID uuid.UUID) {
todolist := p.loadTodolist(taskID) // persisted in Postgres
overview := p.buildGraphOverview(taskID)
prompt := fmt.Sprintf(
"Current assets: %s\nCompleted intents: %s\nBlocked intents: %s\nGenerate new intents or update dependencies.",
overview.Assets, overview.CompletedIntents, todolist.Blocked,
)
llmResponse := p.llm.Complete(prompt)
p.updateTodolist(todolist, llmResponse.NewIntents, llmResponse.Dependencies)
}
The todolist persists attack chain logic across LLM invocations. When a worker completes 'harvest_credentials,' the planner wakes up, sees the dependency satisfied, and promotes 'lateral_movement_via_ssh' from 'blocked' to 'ready' in the queue.
Workers themselves communicate at process granularity through worker trace search—a novel pattern where agents query other workers' execution logs directly:
// Worker 5 wants to avoid redundant subdomain enumeration
priorTraces := db.SearchAllWorkerTraces(taskID, "subdomain enumeration target.com")
if len(priorTraces) > 0 {
log.Info("Reusing Worker 2's subdomain results from trace #47")
return priorTraces[0].ExtractSubdomains()
}
This bypasses the formal fact graph for reconnaissance reuse. It's faster than waiting for Worker 2 to write 'subdomain_enumeration_complete' facts, but fragile—workers need exact keyword matches in activity logs.
The retester agent subsystem deserves attention. Most scanners report vulnerabilities once and forget them. ARTEX-God maintains a separate agent that periodically revalidates findings:
func (r *Retester) ValidateFinding(finding Finding) {
replay := r.buildReplayRequest(finding.EvidenceTraffic)
resp := r.executeWithMITM(replay)
if resp.StatusCode != finding.ExpectedStatusCode {
finding.Status = "likely_patched"
finding.Conclusion = "Revalidation failed: status changed from 200 to 403"
}
}
MITM proxy integration isn't just logging—every tool invocation's HTTP traffic gets recorded and linked to the specific intent execution. This provides forensic evidence for reports and enables intelligent replay for retesting.
Debounced event-driven planner wakeups optimize for stalled exploration. Graph mutations trigger a 2-second debounce timer. If 10 workers complete intents in rapid succession, the planner runs once with the full graph state instead of 10 times. The planner loads a graph overview upfront, and if it yields zero new intents, no LLM call is made—critical when tasks plateau.
Gotcha
PostgreSQL is a deployment albatross. The 'single binary' promise collapses when you need to spin up Postgres, manage schemas, and handle connection pooling. Competitors using SQLite or embedded graphs ship truly standalone executables. In air-gapped pentesting labs or ephemeral Docker containers, this external dependency is friction.
The anchor table grows without bounds. A task scanning 1,000 subdomains with 50 intents each generates 50,000 anchor rows. The codebase has no documented pruning strategy, no partitioning by task age, no archive workflow. Query performance will degrade on long-running instances. Worker trace search is keyword-based plaintext matching—it's glorified LIKE '%subdomain enumeration%' on JSON blobs. No semantic similarity, no relevance ranking. If Worker 2 logged 'enumerating subdomains for target.com' and Worker 5 searches for 'subdomain discovery target.com,' it's a miss. You need exact terminology overlap, which assumes workers know implementation details of prior executions.
The retester runs independently with no feedback into the planner. If a revalidation fails because the target deployed a WAF, the retester marks it 'likely_patched' and stops. But the planner doesn't spawn new intents to probe for WAF bypasses or test alternative exploit vectors. Verification is a dead-end outcome instead of a learning signal.
Verdict
Use if: You're automating multi-step kill chains (credential harvesting → lateral movement → privilege escalation) where intermediate reconnaissance must flow between parallel workers without manual intervention, and you already run PostgreSQL infrastructure for pentesting workflows. The dual-graph architecture genuinely solves attack serialization problems that plague prompt-only scanners, and the MITM-integrated evidence trail is production-grade for client reporting. Skip if: You need distributed scanning across multiple machines (single-process workers can't scale horizontally), you're running one-off exploit development (the graph overhead is wasted), or you want zero-dependency deployment for air-gapped labs (PostgreSQL kills portability). For pure vulnerability detection at scale, Nuclei wins. For autonomous chained exploitation with audit trails, ARTEX-God is architecturally sound.