{"library":"mitreattack-python","title":"MITRE ATT&CK Python Library","description":"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.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install mitreattack-python"],"cli":null},"imports":["from mitreattack.MitreAttackData import MitreAttackData","from mitreattack.navlayers import Layer","from mitreattack.attackToExcel import attackToExcel"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from mitreattack.MitreAttackData import MitreAttackData\n\n# Initialize with a specific domain (e.g., 'enterprise-attack', 'mobile-attack', 'ics-attack')\n# The data will be downloaded and cached locally if not present.\nattack_data = MitreAttackData(\"enterprise-attack\")\n\n# Get all techniques\ntechniques = attack_data.get_techniques()\nprint(f\"Found {len(techniques)} Enterprise ATT&CK techniques.\")\n\n# Get a specific technique by ATT&CK ID\nspec_technique = attack_data.get_techniques_by_attack_id(\"T1566.001\")\nif spec_technique:\n    print(f\"\\nSpecific Technique: {spec_technique[0].name} (ID: {spec_technique[0].attack_id})\")\n\n# Get all groups\ngroups = attack_data.get_groups()\nprint(f\"\\nFound {len(groups)} Enterprise ATT&CK groups.\")\n","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}