Skip to main content

enterpriseattack - MITRE's Enterprise ATT&CK®

A lightweight Python module to interact with the MITRE ATT&CK Enterprise dataset. Built to be used in production applications due to it's speed and minimal depedancies. Read the docs for more info.

MITRE ATT&CK®

MITRE ATT&CK® is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations. The ATT&CK knowledge base is used as a foundation for the development of specific threat models and methodologies in the private sector, in government, and in the cybersecurity product and service community.

Dependancies

  • Python 3.x
  • ujson >= 3.0.0
  • requests >= 2.9.2

Installation

Install via Pip:

pip3 install enterpriseattack

Alternatively clone the repository:

git clone https://gitlab.com/xakepnz/enterpriseattack.git
cd enterpriseattack
python3 setup.py install

(back to top)

Docker:

Build the docker image:

docker build enterpriseattack:0.1.8 .
docker tag enterpriseattack:0.1.8 enterpriseattack:latest

Run the benchmarks on the container:

docker run enterpriseattack

(back to top)

Usage

Initialise an Attack object:

import enterpriseattack

attack = enterpriseattack.Attack()

Example Subscriptable objects:

Access any object directly from the Attack class, rather than iterating to find specific objects.

attack = enterpriseattack.Attack(subscriptable=True)

wizard_spider = attack.groups.get('Wizard Spider')
print(len(wizard_spider.tactics))

execution = attack.tactics.get('Execution')
print(len(execution.techniques))

Example: Passing custom args:

In this example, you can choose where to download the official Mitre Att&ck json from, including proxies to pass through. Alternatively, if you want to save the json file in a separate location, you can alter the enterprise_json arg. By default this is saved within your default site-packages location.

  • enterprise_json - (optional) location of enterprise json file, (saved automatically in pip location)
  • url - (optional) location of enterprise json file to download from.
  • update - (optional) boolean forces a refresh download (each time this is called), overwriting the previous file.
  • include_deprecated - (optional) boolean to include MITRE ATT&CK deprecated objects (from previous Att&ck versions).
  • mitre_version - (optional) specify a MITRE ATT&CK data version.
  • proxies - (optional) dict of proxies to pass through to reach the MITRE GitHub for the enterprise-attack.json.
attack = enterpriseattack.Attack(
   enterprise_json=None,
   url='https://raw.githubusercontent.com/mitre/cti/master/enterprise-attack/enterprise-attack.json',
   include_deprecated=False,
   update=False,
   subscriptable=True,
   mitre_version='latest',
   proxies={'http':'http://127.0.0.1:1337'}
)

Example: Force Download/use an older MITRE ATT&CK data set:

attack = enterpriseattack.Attack(
   mitre_version='11.3',
   update=True
)

print(attack.mitre_version)

Example: Iterate over tactics/techniques/sub_techniques:

attack = enterpriseattack.Attack()

for tactic in attack.tactics:
   print(tactic.name)
   for technique in tactic.techniques:
      print(technique.name)
      print(technique.detection)

for software in attack.software:
    for technique in software.techniques:
        for sub_technique in technique.sub_techniques:
            print(software.name, technique.name, sub_technique.name)

Example: Create a json object of any tactic/technique/sub_technique/group/software/datasource:

attack = enterpriseattack.Attack()

for tactic in attack.tactics:
   print(tactic.to_json())

for group in attack.groups:
   print(group.to_json())

...

For more examples, please refer to the Documentation

(back to top)

Metadata

Release files for enterpriseattack 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enterpriseattack 1.0.4
File Size Uploaded Provenance Actions
enterpriseattack-1.0.4.tar.gz 5.8 MB Without provenance Details for enterpriseattack-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for enterpriseattack 1.0.4
File Interpreter ABI Platform Actions
enterpriseattack-1.0.4-py3-none-any.whl Python 3 none any Details for enterpriseattack-1.0.4-py3-none-any.whl

Total release size: 5.9 MB

Release files / enterpriseattack-1.0.4.tar.gz

Download URL enterpriseattack-1.0.4.tar.gz
Size 5.8 MB
Tags Source
SHA-256 checksum
How to use checksums
75806637ecba649033419bf1c945d0f11b75d6a1760a8688c764d891518b954b
BLAKE2b-256 checksum
How to use checksums
603ddb3371cfaf3d45e27d3065c37558a142655544957c0fb039adc85fcf813a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.9

Release files / enterpriseattack-1.0.4-py3-none-any.whl

Download URL enterpriseattack-1.0.4-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40e6dae24960679e8d0e5ca3dce19771d9612c727bb5689b9da235ccf2c4bcbe
BLAKE2b-256 checksum
How to use checksums
748c171357163c813e4dc0362f2d234215704d36ac3e38adecfa5906261081c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.9

Security for enterpriseattack 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page