Communitygithub.com

利用MITRE ATT&CK分析威胁行为者TTP

系统地将威胁行为者行为与观测到的IOC映射到MITRE ATT&CK框架,使用ATT&CK Navigator构建技术覆盖热力图,识别检测漏洞,并生成涵盖企业、移动和ICS矩阵的可行威胁情报报告。

利用MITRE ATT&CK分析威胁行为者TTP 是什么?

该技能专为需要系统化映射威胁行为者战术、技术和程序(TTP)的安全分析师、SOC团队和威胁情报研究人员设计。它提供完整的端到端工作流:从使用attackcti Python库查询MITRE ATT&CK数据开始,到将特定威胁行为者(如APT29、APT28)映射到ATT&CK技术,生成包含评分颜色编码和元数据的ATT&CK Navigator层JSON文件,最后通过将行为者技术与现有检测能力相比较识别检测漏洞。该技能还支持多组间技术比较,揭示共同和独特TTP以帮助检测工程优先级排序。主要平台包括Enterprise、Mobile和ICS矩阵,利用TAXII服务器进行实时数据访问。主要优势在于,它将攻击分析与框架标准统一,使团队能够围绕ATT&CK矩阵精确可视化覆盖范围、漏洞和风险。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-threat-actor-ttps-with-mitre-attack

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

利用MITRE ATT&CK分析威胁行为者TTP 是做什么的?

概述

MITRE ATT&CK是一个基于真实世界观测的、全球可访问的对手战术、技术和程序(TTP)知识库。本技能涵盖如何系统地将威胁行为者行为映射到ATT&CK框架、使用ATT&CK Navigator构建技术覆盖热力图、识别检测漏洞,并生成将观测到的IOC与企业、移动和ICS矩阵中特定对手技术关联的可行情报报告。

适用场景

  • 调查涉及利用MITRE ATT&CK分析威胁行为者TTP的安全事件时
  • 构建该领域的检测规则或威胁狩猎查询时
  • SOC分析师需要此类分析类型的结构化流程时
  • 验证针对相关攻击技术的安全监控覆盖范围时

前提条件

  • Python 3.9+ 并安装 mitreattack-python、attackcti、stix2 库
  • MITRE ATT&CK Navigator(基于网页或本地部署)
  • 理解ATT&CK矩阵结构:策略、技术、子技术
  • 可访问威胁情报报告或MISP/OpenCTI以获取威胁行为者数据
  • 熟悉STIX 2.1攻击模式对象

关键概念

ATT&CK矩阵结构

ATT&CK企业矩阵将对手行为组织为14个策略(“为什么”),其中包含技术(“如何做”)和子技术(具体实现)。每个技术都关联了数据源、检测方法、缓解措施以及观测到的威胁团体使用的真实世界程序示例。

威胁团体概况

ATT&CK编录了超过140个威胁团体(例如APT28、APT29、Lazarus Group、FIN7)及其文档记录的技术使用情况。每个团体概况包括别名、目标行业、相关活动、使用的软件以及包含程序级别细节的技术映射。

ATT&CK Navigator

ATT&CK Navigator是一个基于网页的工具,用于创建自定义的ATT&CK矩阵可视化。分析师创建层(JSON文件),对技术进行评分、着色、添加注释和元数据,以可视化威胁行为者覆盖范围、检测能力或风险评估。

工作流

步骤1:以编程方式查询ATT&CK数据

from attackcti import attack_client
import json

# 初始化ATT&CK客户端(查询MITRE TAXII服务器)
lift = attack_client()

# 获取所有企业技术
enterprise_techniques = lift.get_enterprise_techniques()
print(f"企业技术总数: {len(enterprise_techniques)}")

# 获取所有威胁团体
groups = lift.get_groups()
print(f"威胁团体总数: {len(groups)}")

# 按名称获取特定团体
apt29 = [g for g in groups if 'APT29' in g.get('name', '')]
if apt29:
    group = apt29[0]
    print(f"团体: {group['name']}")
    print(f"别名: {group.get('aliases', [])}")
    print(f"描述: {group.get('description', '')[:200]}")

步骤2:将威胁行为者映射到ATT&CK技术

from attackcti import attack_client

lift = attack_client()

# 获取APT29使用的技术
apt29_techniques = lift.get_techniques_used_by_group("G0016")  # APT29团体ID

technique_map = {}
for entry in apt29_techniques:
    tech_id = entry.get("external_references", [{}])[0].get("external_id", "")
    tech_name = entry.get("name", "")
    description = entry.get("description", "")
    tactic_refs = [
        phase.get("phase_name", "")
        for phase in entry.get("kill_chain_phases", [])
    ]

    technique_map[tech_id] = {
        "name": tech_name,
        "tactics": tactic_refs,
        "description": description[:300],
    }

print(f"\nAPT29使用了{len(technique_map)}种技术:")
for tid, info in sorted(technique_map.items()):
    print(f"  {tid}: {info['name']} [{', '.join(info['tactics'])}]")

步骤3:生成ATT&CK Navigator层

import json

def create_navigator_layer(group_name, technique_map, description=""):
    """为威胁团体生成ATT&CK Navigator层JSON。"""
    techniques_list = []
    for tech_id, info in technique_map.items():
        techniques_list.append({
            "techniqueID": tech_id,
            "tactic": info["tactics"][0] if info["tactics"] else "",
            "color": "#ff6666",  # 观测到的技术标为红色
            "comment": info["description"][:200],
            "enabled": True,
            "score": 100,
            "metadata": [
                {"name": "group", "value": group_name},
            ],
        })

    layer = {
        "name": f"{group_name} TTP覆盖",
        "versions": {
            "attack": "16.1",
            "navigator": "5.1.0",
            "layer": "4.5",
        },
        "domain": "enterprise-attack",
        "description": description or f"归因于{group_name}的技术",
        "filters": {"platforms": ["Windows", "Linux", "macOS", "Cloud"]},
        "sorting": 0,
        "layout": {
            "layout": "side",
            "aggregateFunction": "average",
            "showID": True,
            "showName": True,
            "showAggregateScores": False,
            "countUnscored": False,
        },
        "hideDisabled": False,
        "techniques": techniques_list,
        "gradient": {
            "colors": ["#ffffff", "#ff6666"],
            "minValue": 0,
            "maxValue": 100,
        },
        "legendItems": [
            {"label": "已观测到的技术", "color": "#ff6666"},
            {"label": "未观测到", "color": "#ffffff"},
        ],
        "showTacticRowBackground": True,
        "tacticRowBackground": "#dddddd",
        "selectTechniquesAcrossTactics": True,
        "selectSubtechniquesWithParent": False,
        "selectVisibleTechniques": False,
    }

    return layer


# 生成并保存层
layer = create_navigator_layer("APT29", technique_map, "APT29 (Cozy Bear) TTP分析")
with open("apt29_navigator_layer.json", "w") as f:
    json.dump(layer, f, indent=2)
print("[+] Navigator层已保存至 apt29_navigator_layer.json")

步骤4:识别检测漏洞

from attackcti import attack_client

lift = attack_client()

# 获取所有带数据源的技术
all_techniques = lift.get_enterprise_techniques()

# 构建数据源覆盖图
data_source_coverage = {}
for tech in all_techniques:
    tech_id = tech.get("external_references", [{}])[0].get("external_id", "")
    data_sources = tech.get("x_mitre_data_sources", [])

    for ds in data_sources:
        if ds not in data_source_coverage:
            data_source_coverage[ds] = []
        data_source_coverage[ds].append(tech_id)

# 比较威胁行为者技术与现有检测能力
detected_techniques = {"T1059", "T1071", "T1566"}  # 示例:你能检测的技术
actor_techniques = set(technique_map.keys())

covered = actor_techniques.intersection(detected_techniques)
gaps = actor_techniques - detected_techniques

print(f"\n=== APT29检测漏洞分析 ===")
print(f"行为者技术数: {len(actor_techniques)}")
print(f"已检测: {len(covered)} ({len(covered)/len(actor_techniques)*100:.0f}%)")
print(f"漏洞: {len(gaps)} ({len(gaps)/len(actor_techniques)*100:.0f}%)")
print(f"\n未检测到的技术:")
for tech_id in sorted(gaps):
    if tech_id in technique_map:
        print(f"  {tech_id}: {technique_map[tech_id]['name']}")

步骤5:跨团体技术比较

from attackcti import attack_client

lift = attack_client()

# 比较多个团体的技术
groups_to_compare = {
    "G0016": "APT29",
    "G0007": "APT28",
    "G0032": "Lazarus Group",
}

group_techniques = {}
for gid, gname in groups_to_compare.items():
    techs = lift.get_techniques_used_by_group(gid)
    tech_ids = set()
    for t in techs:
        tid = t.get("external_references", [{}])[0].get("external_id", "")
        if tid:
            tech_ids.add(tid)
    group_techniques[gname] = tech_ids

# 找出共同和独特的技术
all_groups = list(group_techniques.keys())
common_to_all = set.intersection(*group_techniques.values())
print(f"\n所有{len(all_groups)}个团体共用的技术数: {len(common_to_all)}")
for tid in sorted(common_to_all):
    print(f"  {tid}")

for gname, techs in group_techniques.items():
    unique = techs - set.union(*[t for n, t in group_techniques.items() if n != gname])
    print(f"\n{gname}独有的技术: {len(unique)}种")

验证标准

  • 通过TAXII服务器或本地副本成功查询到ATT&CK数据
  • 威胁行为者已映射到特定技术并附有程序示例
  • ATT&CK Navigator层JSON有效且能正确渲染
  • 检测漏洞分析能识别出未监控的技术
  • 跨团体比较揭示了共享和独特的TTP
  • 输出对检测工程优先级排序具有可操作性

参考

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

相关技能