meltedinhex/analyst-ai-pack / skills/profiling-a-threat-actor-from-ttps
profiling-a-threat-actor-from-ttps
VerifiedProfiles a threat actor by aggregating observed ATT&CK techniques into a TTP profile and comparing it against known-group technique sets to estimate similarity and candidate attribution. Activates for requests to profile a threat actor, compare observed TTPs to known groups, or estimate attribution from technique overlap.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.7 KB |
| references/api-reference.md | markdown | 1.3 KB |
| scripts/analyst.py | script | 2.8 KB |
scripts/analyst.py
View on GitHub#!/usr/bin/env python3
"""Compare an observed ATT&CK technique set against known-group technique sets.
Computes Jaccard and overlap-coefficient similarity between the observed techniques and each group,
ranking candidate groups and listing overlapping techniques. Inputs: observed (one technique ID per
line) and groups (JSON mapping group->list of technique IDs, or list of {name, techniques}).
Parses data only; executes nothing. TTP overlap is suggestive, not confirmed attribution.
"""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
def _load_observed(path: str) -> set[str]:
out = set()
for line in Path(path).read_text(encoding="utf-8-sig").splitlines():
v = line.strip().upper()
if v and v.startswith("T"):
out.add(v)
return out
def _load_groups(path: str) -> dict[str, set[str]]:
data = json.loads(Path(path).read_text(encoding="utf-8-sig"))
groups: dict[str, set[str]] = {}
if isinstance(data, dict):
for name, techs in data.items():
groups[name] = {str(t).upper() for t in techs}
else:
for item in data:
name = item.get("name") or item.get("group")
techs = item.get("techniques", [])
if name:
groups[name] = {str(t).upper() for t in techs}
return groups
def compare(observed_path: str, groups_path: str) -> dict:
observed = _load_observed(observed_path)
groups = _load_groups(groups_path)
results = []
for name, techs in groups.items():
inter = observed & techs
union = observed | techs
jaccard = round(len(inter) / len(union), 4) if union else 0.0
overlap = round(len(inter) / min(len(observed), len(techs)), 4) \
if observed and techs else 0.0
if inter:
results.append({
"group": name,
"jaccard": jaccard,
"overlap_coefficient": overlap,
"shared_techniques": sorted(inter),
"shared_count": len(inter),
})
results.sort(key=lambda d: (d["overlap_coefficient"], d["jaccard"]), reverse=True)
return {
"observed_technique_count": len(observed),
"candidates": results[:15],
"confidence_note": "TTP overlap is suggestive only; corroborate with intel before attribution",
}
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description="Profile a threat actor from TTPs")
sub = parser.add_subparsers(dest="cmd", required=True)
p = sub.add_parser("compare")
p.add_argument("--observed", required=True)
p.add_argument("--groups", required=True)
args = parser.parse_args(argv)
print(json.dumps(compare(args.observed, args.groups), indent=2))
return 0
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |