Skip to main content

A lightweight Python module to interact with the Mitre Att&ck Enterprise framework.

Project description

Downloads PyPI version License: MIT image image

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:

pip install enterpriseattack

Alternatively clone the repository:

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

(back to top)

Docker:

Build the docker image:

docker build enterpriseattack:0.1.4 .
docker tag enterpriseattack:0.1.4 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: 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.

  • update - boolean forces a refresh download (each time this is called), overwriting the previous file.
  • include_deprecated - boolean to include Mitre Att&ck deprecated objects (from previous Att&ck versions).
attack = enterpriseattack.Attack(
   enterprise_json=None,
   url='https://raw.githubusercontent.com/mitre/cti/master/enterprise-attack/enterprise-attack.json',
   include_deprecated=False,
   update=False,
   proxies={'http':'http://127.0.0.1:1337'}
)

Example: Iterate over tactics/techniques/sub_techniques:

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:

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enterpriseattack-0.1.5.tar.gz (9.7 kB view details)

Uploaded Source

Built Distributions

enterpriseattack-0.1.5-py3.9.egg (35.3 kB view details)

Uploaded Source

enterpriseattack-0.1.5-py2-none-any.whl (17.5 kB view details)

Uploaded Python 2

File details

Details for the file enterpriseattack-0.1.5.tar.gz.

File metadata

  • Download URL: enterpriseattack-0.1.5.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for enterpriseattack-0.1.5.tar.gz
Algorithm Hash digest
SHA256 543bd5de630a7336742ae5512b59aae6faa6e87ce8dbdf4a7013d705d5c30f32
MD5 37d7e3ac8b4281e6ea69de470430c694
BLAKE2b-256 d7f85654ec0620ac5b7c06a3132a99cc177db6b984824be3d503da085dd7603a

See more details on using hashes here.

File details

Details for the file enterpriseattack-0.1.5-py3.9.egg.

File metadata

  • Download URL: enterpriseattack-0.1.5-py3.9.egg
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for enterpriseattack-0.1.5-py3.9.egg
Algorithm Hash digest
SHA256 242d607110f1f62b8e4a1786ceffeb2cbafdae32a133143c40823ec8cdc67d6f
MD5 ca6fc68970b3eff439128df1acdbe875
BLAKE2b-256 34975a2b79743ef267fd783846ab57a5f5f8a75cb99a01ffd806ed431ee8e37c

See more details on using hashes here.

File details

Details for the file enterpriseattack-0.1.5-py2-none-any.whl.

File metadata

  • Download URL: enterpriseattack-0.1.5-py2-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for enterpriseattack-0.1.5-py2-none-any.whl
Algorithm Hash digest
SHA256 1c680d047df0312433067a0e3e82b3870f5aa59a8943b6febb72d1eb5b96cb15
MD5 fb5547e4f4ca2dc875811e0700813dba
BLAKE2b-256 bc1665c431b32ea5ad2c5d6a3f8225d93ba9a78f709701de765b6e618c937e9c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page