Blog··8 min read

Attack Graphs, Knowledge Graphs and Causal Reasoning: What Is Actually Different?

Attack graphs derive what could happen, knowledge graphs encode what usually happens, causal claims concern what happened here. Why the difference matters.

DarkMoon research series·A. Architecture & attack paths·Article 3 of 23·All 23 articles

Introduction

"Attack graph", "security knowledge graph" and "causal attack chain" are often used as if they were three names for one picture: boxes for vulnerabilities, arrows for "leads to". They are not the same object. They differ in where the arrows come from and in what an arrow claims.

DarkMoon, an autonomous AI pentest system, tried all three while trying to link its findings into attack paths. This article uses that record to make the differences concrete. The underlying literature review is public in the attack-paths research repository.

The problem

Suppose a pentest produced two findings: an unauthenticated Redis instance (A) and remote command execution through Redis EVAL (B). Should the report draw A → B?

  • An attack graph says: given this network model and these pre/post-conditions, an attacker could go from A to B.
  • A knowledge graph says: in general, the technique behind A is often followed by the technique behind B.
  • A causal claim says: in this campaign, B's exploitation used something obtained in A.

The three can disagree. In DarkMoon's own campaigns, "SLAVEOF / CONFIG SET / EVAL ← unauthenticated Redis" was a recurring false link: the three findings share one root cause (no authentication) but none enabled the others. A plausibility graph happily accepts that edge. A causal reading does not.

Methodology

This comparison reads each family through three questions: who creates the edge, what the edge asserts, and what would make it wrong. Each family is then tied to an approach DarkMoon actually tested, with the evidence label the repository gives it.

Attack graphs: deriving what could happen

Classic attack graphs (Phillips and Swiler, Sheyner et al., Ammann et al., Topological Vulnerability Analysis, MulVAL) derive edges from a model of the network and of exploit pre/post-conditions. MulVAL encodes this as Datalog rules over scanner facts and produces logical attack graphs polynomial in network size. The edges are potential: correct relative to the model, silent about whether anyone executed them.

DarkMoon tested a MulVAL-like capability graph built from CWE, CAPEC and ATT&CK pre/post-conditions over 51 real findings (EXP-039): 10 of 78 edges correct (12.8 %), 9 of 87 paths fully correct, recall 10 of 22 (SIMULATED, SUPERSEDED). The graph was not wrong as a model of possibilities; it was wrong as a model of what happened.

Knowledge graphs: encoding what usually happens

Security knowledge graphs (MITRE ATT&CK, SEPSES, BRON, AttacKG and its LLM successor) link techniques, weaknesses and vulnerabilities across many incidents and reports. Their edges are type-level: "technique X often precedes Y". ATT&CK's own design document describes a curated knowledge base, not a causal model or a complete enumeration.

DarkMoon used ATT&CK tactic order as a filter on agent-declared pairs. An internal review found that it accepted 74 % of pairs and 10 of 10 false chains (VERIFIED). It was downgraded to context warnings, never a verdict. Type-level priors can rule out the implausible; they cannot separate a direct edge from a common cause in one campaign.

Causal reasoning: deciding what happened here

Causal theory (Spirtes, Glymour and Scheines; Pearl) makes one point that matters here: observational co-occurrence cannot separate A → B from A ← C → B without further assumptions or interventions. In a pentest, hidden common causes are the normal case, because the underlying misconfiguration is often not itself a finding. And token-level ("actual") causation in a single run is harder than type-level structure.

Recent work on LLMs and causality points both ways. Kıcıman et al. report strong results on pairwise causal discovery benchmarks while noting unpredictable failure modes; Jin et al. (Corr2Cause) report that LLMs perform close to chance at inferring causation from correlation statements.

DarkMoon's attempts at genuine interventions, counterfactual replay on lab targets, were accurate where they applied but had low recall: wire flows 20 of 20 correct, recall 4 of 29, and 2 false proven links in the first round (EXP-019, SIMULATED).

Real results

FamilyEdge authorWhat an edge claimsDarkMoon testResult
Attack graph (MulVAL-like)rules over pre/post-conditionscould happencapability graph on 51 real findings10/78 edges correct (SIMULATED)
Knowledge graph (ATT&CK order)curated type-level knowledgeusually happensplausibility filter on declared pairsaccepted 10/10 false chains (VERIFIED)
Causal claim by an LLM agentacting agent (enabled_by)happened herereal campaigns with oraclesstrict precision 0.6 / 0.556 / 0.316, single runs (VERIFIED)
Server lineage checkserver, on its own recordsa value flowed from A to Barchitecture D on real campaigns0 qualified links on real data (VERIFIED)

The repository's interpretation (HYPOTHESIS, consistent with the causal literature): the roughly one-third precision of agent-declared links and the dominance of "same root cause" errors are what you would expect when an agent states edges from co-occurrence and narrative. Architecture D's answer is mechanistic evidence, a value that must flow from A's output into B's input, which is a design choice that follows from causal theory. It is not a new causal-discovery method.

Limits

  • DarkMoon does not have a reliable causal model of attack paths, and none of these families gave it one.
  • The comparison mixes measurement types: a replay of a rule graph, a review of a filter and real campaigns scored by oracles. Samples are small and not on the same targets.
  • The mapping of DarkMoon link states to causal vocabulary (an observed flow is not necessity; necessity for one request is not an attack chain) is the repository's own and is labelled HYPOTHESIS where the code does not state it.
  • Knowledge graphs and attack graphs remain useful as context. The point is only that they cannot be counted as evidence that a link was executed.

Figures

Diagram. Figure 1. Why co-occurrence is not enablement. Both patterns produce two related findings; only the first is an attack-path edge. Example classes taken from the repository's error analysis.
Figure 1. Why co-occurrence is not enablement. Both patterns produce two related findings; only the first is an attack-path edge. Example classes taken from the repository's error analysis.
Diagram. Figure 2. How DarkMoon positions the three families: priors and models inform, only recorded lineage promotes.
Figure 2. How DarkMoon positions the three families: priors and models inform, only recorded lineage promotes.

Scientific sources

  • Sheyner, Haines, Jha, Lippmann, Wing. Automated generation and analysis of attack graphs. IEEE S&P 2002. doi:10.1109/SECPRI.2002.1004377
  • Ou, Boyer, McQueen. A scalable approach to attack graph generation. ACM CCS 2006. doi:10.1145/1180405.1180446
  • Strom et al. MITRE ATT&CK: Design and Philosophy. MITRE, 2018. mitre.org
  • Hemberg et al. Linking Threat Tactics, Techniques, and Patterns with Defensive Weaknesses, Vulnerabilities and Affected Platform Configurations for Cyber Hunting (BRON). 2020. arXiv:2010.00533
  • Li, Zeng, Chen, Liang. AttacKG: Constructing Technique Knowledge Graph from Cyber Threat Intelligence Reports. ESORICS 2022. doi:10.1007/978-3-031-17140-6_29
  • Spirtes, Glymour, Scheines. Causation, Prediction, and Search. MIT Press, 2000. doi:10.7551/mitpress/1754.001.0001
  • Pearl. Causality: Models, Reasoning, and Inference. 2009. doi:10.1017/CBO9780511803161
  • Kıcıman, Ness, Sharma, Tan. Causal Reasoning and Large Language Models: Opening a New Frontier for Causality. 2023. arXiv:2305.00050
  • Jin et al. Can Large Language Models Infer Causation from Correlation? ICLR 2024. arXiv:2306.05836

Research, source code & reproducibility


If you build attack graphs or security knowledge graphs and have a way to tell a direct edge from a common cause in a single run, we would like to compare notes in the research repository's issues.

Next
Run it against your own lab

Darkmoon is open source (AGPL-3.0) and self hosted. Clone it, point it at a target you own, and read every line.