Extract and catalog attack patterns from cyber threat intelligence reports into a structured STIX-based library mapped to MITRE ATT&CK for detection engineering and threat-informed defense.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Extract and catalog attack patterns from cyber threat intelligence reports into a structured STIX-based library mapped to MITRE ATT&CK for detection engineering and threat-informed defense.
Cyber threat intelligence (CTI) reports from vendors like Mandiant, CrowdStrike, Talos, and Microsoft contain detailed descriptions of adversary behaviors that can be extracted, normalized, and cataloged into a structured attack pattern library. This skill covers parsing CTI reports to extract adversary techniques, mapping behaviors to MITRE ATT&CK technique IDs, creating STIX 2.1 Attack Pattern objects, building a searchable library indexed by tactic, technique, and threat actor, and generating detection rule templates from documented patterns.
When to Use
When deploying or configuring building attack pattern library from cti reports capabilities in your environment
When establishing security controls aligned to compliance requirements
When building or improving security architecture for this domain
When conducting security assessments that require this implementation
Common Misconfigurations & Verification
Keyword-mapping false positives: the TECHNIQUE_KEYWORDS substring match maps any sentence containing "smb" or "powershell" to a technique, including benign mentions and quoted defender advice. Require a behavior verb + object proximity, not a bare keyword, before emitting a mapping.
Sub-technique precision loss: mapping "phishing" to T1566 when the report describes an attachment (T1566.001) flattens detection value; prefer the most specific ID the text supports.
STIX 2.1 validity: Attack Pattern external_id must match the ATT&CK ID, the URL must use / not . for sub-techniques (T1566/001), and kill_chain_phases.phase_name must be the ATT&CK tactic shortname -- malformed objects fail bundle validation or import silently.
Stale ATT&CK data:attackcti pulls a versioned snapshot; deprecated/revoked technique IDs map to nothing.
To verify: validate the generated bundle round-trips through stix2.parse() and imports into a TIP without schema errors; spot-check a sample of mappings against the source sentence and measure precision/recall on a labeled report. Confirm dedup collapses repeated techniques (seen_techniques) and that generated Sigma templates carry the right attack.tXXXX tags and required data sources before handing them to detection engineering.
Prerequisites
Python 3.9+ with stix2, mitreattack-python, , libraries
spacy
requests
Collection of CTI reports (PDF, HTML, or text format)
MITRE ATT&CK STIX data (local or via TAXII)
Understanding of ATT&CK technique structure and naming conventions
Familiarity with detection engineering concepts (Sigma, YARA)
Key Concepts
Attack Pattern Extraction
CTI reports describe adversary behaviors in natural language. Extraction involves identifying action verbs and technical terms that map to ATT&CK techniques, recognizing tool names and malware families, identifying infrastructure indicators, and mapping sequences of behaviors to attack chains (kill chain phases).
STIX 2.1 Attack Pattern Objects
STIX defines Attack Pattern as a Structured Domain Object (SDO) that describes ways threat actors attempt to compromise targets. Each pattern links to ATT&CK via external references, includes kill chain phases (tactics), and can be related to Intrusion Sets, Malware, and Tool objects.
Detection Rule Generation
Extracted attack patterns inform detection engineering by providing: specific procedure examples for Sigma rule creation, behavioral sequences for correlation rules, IOC patterns for YARA and Snort rules, and data source requirements for telemetry gaps.
Workflow
Step 1: Parse CTI Reports and Extract Behaviors
import re
import json
from collections import defaultdict
classCTIReportParser:
"""Parse CTI reports to extract adversary behaviors."""
BEHAVIOR_INDICATORS = [
"used", "executed", "deployed", "leveraged", "exploited",
"established", "created", "modified", "downloaded", "uploaded",
"exfiltrated", "injected", "enumerated", "spawned", "dropped",
"persisted", "escalated", "moved laterally", "collected",
"encrypted", "compressed", "encoded", "obfuscated",
]
TOOL_PATTERNS = [
r'\b(Cobalt Strike|Mimikatz|PsExec|BloodHound|Rubeus|Impacket)\b',
r'\b(PowerShell|cmd\.exe|WMI|WMIC|certutil|bitsadmin)\b',
r'\b(Metasploit|Empire|Covenant|Sliver|Brute Ratel)\b',
r'\b(Lazagne|SharpHound|ADFind|Sharphound|Invoke-Obfuscation)\b',
]
TECHNIQUE_KEYWORDS = {
"spearphishing": "T1566",
"phishing attachment": "T1566.001",
"phishing link": "T1566.002",
"powershell": "T1059.001",
"command line": "T1059.003",
"scheduled task": "T1053.005",
"registry run key": "T1547.001",
"process injection": "T1055",
"dll side-loading": "T1574.002",
"credential dumping": "T1003",
"lsass": "T1003.001",
"kerberoasting": "T1558.003",
"pass the hash": "T1550.002",
"remote desktop": "T1021.001",
"smb": "T1021.002",
"winrm": "T1021.006",
"data staging": "T1074",
"exfiltration over c2": "T1041",
"dns tunneling": "T1071.004",
"web shell": "T1505.003",
}
defparse_report(self, text, report_metadata=None):
"""Parse a CTI report and extract behaviors."""
sentences = re.split(r'[.!?]\s+', text)
behaviors = []
for sentence in sentences:
sentence_lower = sentence.lower()
# Check for behavior indicatorsfor indicator inself.BEHAVIOR_INDICATORS:
if indicator in sentence_lower:
behavior = {
"sentence": sentence.strip(),
"action": indicator,
"tools": self._extract_tools(sentence),
"technique_hints": self._match_techniques(sentence_lower),
}
if behavior["technique_hints"]:
behaviors.append(behavior)
breakprint(f"[+] Extracted {len(behaviors)} behavioral indicators from report")
return behaviors
def_extract_tools(self, text):
"""Extract tool/malware names from text."""
tools = set()
for pattern inself.TOOL_PATTERNS:
matches = re.findall(pattern, text, re.IGNORECASE)
tools.update(matches)
returnlist(tools)
def_match_techniques(self, text):
"""Match text to ATT&CK technique hints."""
matches = []
for keyword, tech_id inself.TECHNIQUE_KEYWORDS.items():
if keyword in text:
matches.append({"keyword": keyword, "technique_id": tech_id})
return matches
parser = CTIReportParser()
sample_report = """
The threat actor used spearphishing attachments with macro-enabled documents to
gain initial access. Once inside, they executed PowerShell scripts to download
additional tooling. The actor leveraged Mimikatz to dump credentials from LSASS
memory. They then used pass the hash techniques for lateral movement via SMB
to multiple systems. Data was staged in a compressed archive and exfiltrated
over the existing C2 channel. The actor established persistence through
scheduled tasks and registry run keys.
"""
behaviors = parser.parse_report(sample_report)
Step 2: Map Behaviors to ATT&CK Techniques
from attackcti import attack_client
classATTACKMapper:
def__init__(self):
self.lift = attack_client()
self.techniques = {}
self._load_techniques()
def_load_techniques(self):
"""Load all ATT&CK techniques for mapping."""
all_techs = self.lift.get_enterprise_techniques()
for tech in all_techs:
tech_id = ""for ref in tech.get("external_references", []):
if ref.get("source_name") == "mitre-attack":
tech_id = ref.get("external_id", "")
breakif tech_id:
self.techniques[tech_id] = {
"name": tech.get("name", ""),
"description": tech.get("description", "")[:500],
"tactics": [p.get("phase_name") for p in tech.get("kill_chain_phases", [])],
"platforms": tech.get("x_mitre_platforms", []),
"data_sources": tech.get("x_mitre_data_sources", []),
}
print(f"[+] Loaded {len(self.techniques)} ATT&CK techniques")
defmap_behaviors(self, behaviors):
"""Map extracted behaviors to ATT&CK techniques."""
mapped = []
for behavior in behaviors:
for hint in behavior.get("technique_hints", []):
tech_id = hint["technique_id"]
if tech_id inself.techniques:
tech_info = self.techniques[tech_id]
mapped.append({
"technique_id": tech_id,
"technique_name": tech_info["name"],
"tactics": tech_info["tactics"],
"source_sentence": behavior["sentence"],
"tools_observed": behavior["tools"],
"keyword_matched": hint["keyword"],
"data_sources": tech_info["data_sources"],
})
print(f"[+] Mapped {len(mapped)} behaviors to ATT&CK techniques")
return mapped
mapper = ATTACKMapper()
mapped_behaviors = mapper.map_behaviors(behaviors)