Kill Chain Analysis¶
Maps agent behavior to a cyber kill chain model, identifying multi-stage attack progressions from reconnaissance through actions on objectives.
Key Classes¶
| Class | Description |
|---|---|
KillChainStage |
7-stage model: RECONNAISSANCE, WEAPONIZATION, DELIVERY, EXPLOITATION, INSTALLATION, COMMAND_CONTROL, ACTIONS_ON_OBJECTIVES |
AttackSophistication |
Sophistication rating (SCRIPT_KIDDIE to NATION_STATE) |
ChainStatus |
Chain progression status (PARTIAL, COMPLETE, ACTIVE) |
AgentAction |
Categorized agent action with metadata |
KillChainAnalyzer |
Main analyzer — maps action sequences to kill chain stages |
Usage¶
from replication.killchain import KillChainAnalyzer
analyzer = KillChainAnalyzer()
actions = [
{"agent_id": "a1", "action": "scan_network", "target": "internal"},
{"agent_id": "a1", "action": "craft_payload", "target": "exploit-db"},
{"agent_id": "a1", "action": "deploy_backdoor", "target": "server-2"},
]
report = analyzer.analyze(actions)
for chain in report.chains:
print(f"Stages covered: {[s.name for s in chain.stages_present]}")
print(f"Sophistication: {chain.sophistication}")
print(f"Completeness: {chain.completeness_ratio:.0%}")
killchain
¶
Kill Chain Analyzer — models multi-stage agent attack sequences.
Maps observed agent behaviors to a kill chain framework inspired by MITRE ATT&CK, identifying how agents combine individual techniques (reconnaissance, resource acquisition, privilege escalation, lateral movement, exfiltration, replication) into coordinated attack campaigns.
Why this matters¶
Individual detectors (escalation, hoarding, covert channels, etc.) flag isolated events. But sophisticated agents chain techniques: first probe permissions (recon), then acquire resources (staging), then escalate privileges (weaponization), then replicate or exfiltrate (objective). Viewing these in isolation misses the attack narrative.
Kill chain stages¶
- Reconnaissance — probing environment, testing boundaries
- Resource Acquisition — hoarding compute, memory, data
- Privilege Escalation — gaining broader permissions/access
- Lateral Movement — reaching other agents/services
- Defense Evasion — avoiding detection, stealth tactics
- Command & Control — establishing covert channels
- Objective Execution — replication, exfiltration, sabotage
Usage (CLI)::
python -m replication.killchain # default scenario
python -m replication.killchain --agents 5 # 5 agents
python -m replication.killchain --strategy apt # APT-style
python -m replication.killchain --json # JSON output
Programmatic::
from replication.killchain import KillChainAnalyzer, KillChainConfig
analyzer = KillChainAnalyzer()
result = analyzer.analyze()
print(result.render())
KillChainStage
¶
Bases: Enum
Stages of a multi-step agent attack, modeled after MITRE ATT&CK.
Source code in src/replication/killchain.py
AttackSophistication
¶
Bases: Enum
Classification of how sophisticated an observed attack campaign is.
Source code in src/replication/killchain.py
ChainStatus
¶
Bases: Enum
Current progression status of an agent's kill chain.
Source code in src/replication/killchain.py
ActionCategory
¶
Bases: Enum
Broad category of an agent action, used for stage classification fallback.
Source code in src/replication/killchain.py
AgentAction
dataclass
¶
A single observed action taken by an agent, with timestamp and outcome.
Source code in src/replication/killchain.py
StageObservation
dataclass
¶
Aggregated observations for a single kill chain stage within one agent.
Source code in src/replication/killchain.py
KillChain
dataclass
¶
Complete kill chain model for a single agent, tracking stage progression and risk.
Source code in src/replication/killchain.py
active_stages: List[KillChainStage]
property
¶
Return observed stages sorted by enum value.
stage_count: int
property
¶
Return the number of distinct stages observed.
total_actions: int
property
¶
Return total action count across all stages.
timeline_span: float
property
¶
Return wall-clock span from earliest to latest observation.
ChainPattern
dataclass
¶
A recurring sub-sequence of kill chain stages observed across multiple agents.
Source code in src/replication/killchain.py
StageTransition
dataclass
¶
A recorded transition between two kill chain stages, with frequency and timing.
Source code in src/replication/killchain.py
KillChainReport
dataclass
¶
Aggregated analysis report across all observed agent kill chains.
Source code in src/replication/killchain.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
render() -> str
¶
Render a human-readable text report with stage distribution, chains, patterns, and transitions.
Source code in src/replication/killchain.py
to_dict() -> Dict[str, Any]
¶
Serialize the report to a JSON-compatible dictionary.
Source code in src/replication/killchain.py
KillChainConfig
dataclass
¶
Configuration for kill chain analysis and simulation parameters.
Source code in src/replication/killchain.py
StrategyProfile
dataclass
¶
Defines an attack strategy's stage probability distribution and behavioral traits.
Source code in src/replication/killchain.py
KillChainAnalyzer
¶
Analyzes agent behavior patterns for kill chain progression.
Source code in src/replication/killchain.py
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | |
analyze(actions: Optional[List[AgentAction]] = None) -> KillChainReport
¶
Analyze agent actions and produce a kill chain report.
If no actions are provided, simulates agent behavior based on config. Groups actions by agent, builds individual kill chains, detects cross-agent patterns, and computes stage transitions.
Source code in src/replication/killchain.py
main(argv: Optional[Sequence[str]] = None) -> None
¶
CLI entry point: parse arguments, run analysis, and print or export the report.