MITRE ATT&CK Python Library

5.4.4 · active · verified Thu Apr 16

mitreattack-python is a Python library developed by MITRE for working with ATT&CK data. It provides various tools and utilities for interacting with MITRE ATT&CK STIX 2.0 content, including functionalities for handling ATT&CK Navigator layers, converting ATT&CK data to Excel spreadsheets, and managing ATT&CK Collections. The library is actively maintained and frequently updated to align with the latest versions of the ATT&CK knowledge base, typically on a quarterly release cadence.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the MitreAttackData object for a specific ATT&CK domain, retrieve all techniques, and fetch a specific technique by its ATT&CK ID. It also shows how to retrieve all adversary groups.

from mitreattack.MitreAttackData import MitreAttackData

# Initialize with a specific domain (e.g., 'enterprise-attack', 'mobile-attack', 'ics-attack')
# The data will be downloaded and cached locally if not present.
attack_data = MitreAttackData("enterprise-attack")

# Get all techniques
techniques = attack_data.get_techniques()
print(f"Found {len(techniques)} Enterprise ATT&CK techniques.")

# Get a specific technique by ATT&CK ID
spec_technique = attack_data.get_techniques_by_attack_id("T1566.001")
if spec_technique:
    print(f"\nSpecific Technique: {spec_technique[0].name} (ID: {spec_technique[0].attack_id})")

# Get all groups
groups = attack_data.get_groups()
print(f"\nFound {len(groups)} Enterprise ATT&CK groups.")

view raw JSON →