Skip to main content

A Python package to interact with the Mitre ATT&CK Framework

Project description

pyattck

Documentation Status

.______   ____    ____  ___   .___________.___________.  ______  __  ___ 
|   _  \  \   \  /   / /   \  |           |           | /      ||  |/  / 
|  |_)  |  \   \/   / /  ^  \ `---|  |----`---|  |----`|  ,----'|  '  /  
|   ___/    \_    _/ /  /_\  \    |  |        |  |     |  |     |    <   
|  |          |  |  /  _____  \   |  |        |  |     |  `----.|  .  \  
| _|          |__| /__/     \__\  |__|        |__|      \______||__|\__\ 

A Python Module to interact with the Mitre ATT&CK Framework

pyattck has the following notable features in it's current release:

  • Retrieve all Tactics, Techniques, Actors, Malware, Tools, and Mitigations

  • All techniques have suggested mitigations as a property

  • For each class you can access additional information about related data points:

  • Actors

    • Tools used by the Actor or Group
    • Malware used by the Actor or Group
    • Techniques this Actor or Group uses
  • Malwares

    • Actor or Group(s) using this malware
    • Techniques this malware is used with
  • Mitigations

    • Techniques related to a specific set of mitigation suggestions
  • Tactics

    • Techniques found in a specific Tactic (phase)
  • Techniques

    • Tactics a technique is found in
    • Mitigation suggestions for a given technique
    • Actor or Group(s) identified as using this technique
  • Tools

    • Techniques that the specified tool is used within
    • Actor or Group(s) using a specified tool

Installation

OS X & Linux:

pip install pyattck

Windows:

pip install pyattck

Usage example

To use pyattck you must instantiate a Attck object:

from pyattck import Attck

attack = Attck()

By default pyattck will pull the latest json from Mitre. If you would like to reference and save a local copy of this json file you can provide a file path when an Attck object is created:

from pyattck import Attck

attack = Attck(local_file_path='/some/local/path')
# Alternatively you can provide a full filename
#attack = Attck(local_file_path='/some/local/path/attck.json')

You can access the following properties on your Attck object:

  • actor
  • malware
  • mitigation
  • tactic
  • technique
  • tools

Below are examples of accessing each of these properties:

from pyattck import Attck

attack = Attck()

# accessing actors
for actor in attack.actors:
    print(actor)

    # accessing malware used by an actor or group
    for malware in actor.malwares:
        print(malware)

    # accessing tools used by an actor or group
    for tool in actor.tools:
        print(tool)

    # accessing techniques used by an actor or group
    for technique in actor.techniques:
        print(technique)

# accessing malware
for malware in attack.malwares:
    print(malware)

    # accessing actor or groups using this malware
    for actor in malware.actors:
        print(actor)

    # accessing techniques that this malware is used in
    for technique in malware.techniques:
        print(technique)

# accessing mitigation
for mitigation in attack.mitigations:
    print(mitigation)

    # accessing techniques related to mitigation recommendations
    for technique in mitigation.techniques:
        print(technique)

# accessing tactics
for tactic in attack.tactics:
    print(tactic)

    # accessing techniques related to this tactic
    for technique in tactic.techniques:
        print(technique)

# accessing techniques
for technique in attack.techniques:
    print(technique)

    # accessing tactics that this technique belongs to
    for tactic in technique.tactics:
        print(tactic)

    # accessing mitigation recommendations for this technique
    for mitigation in technique.mitigations:
        print(mitigation)

    # accessing actors using this technique
    for actor in technique.actors:
        print(actor)


# accessing tools
for tool in attack.tools:
    print(tool)

    # accessing techniques this tool is used in
    for technique in tool.techniques:
        print(technique)

    # accessing actor or groups using this tool
    for actor in tool.actors:
        print(actor)

Release History

  • 1.0.0
    • Initial release of pyattck to PyPi
  • 1.0.1
    • Updating Documentation with new reference links
  • 1.0.2
    • Updated Documentation
  • 1.0.3
    • Fixed issue with appending techniques correctly
  • 1.0.4
    • Added ability to save a local copy of the downloaded Mitre ATT&CK JSON

Meta

Josh Rickard – @MSAdministratorrickardja@live.com

Distributed under the MIT license. See LICENSE for more information.

Contributing

  1. Fork it (https://github.com/swimlane/pyattck/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

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

pyattck-1.0.4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyattck-1.0.4-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

pyattck-1.0.4-py2-none-any.whl (12.0 kB view details)

Uploaded Python 2

File details

Details for the file pyattck-1.0.4.tar.gz.

File metadata

  • Download URL: pyattck-1.0.4.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.15

File hashes

Hashes for pyattck-1.0.4.tar.gz
Algorithm Hash digest
SHA256 62089ab316d2bcfe1d6d4e1a5299c788fee6f620e24da3723a13c95b0f6f880c
MD5 076c0556495cf15d092a11899e06828c
BLAKE2b-256 f370b426e7af48539bdc7699fb2209b6cf2a9b7f5af03c2dd8585b6eca229806

See more details on using hashes here.

File details

Details for the file pyattck-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyattck-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.15

File hashes

Hashes for pyattck-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b18469e0183b4c310ec6dc4ce63de77a42800f801f4cb860e1bd1060f9f5ec0e
MD5 e86cbff5e0e0fb25da63eb285af6c966
BLAKE2b-256 2d75841fcac3a159c8b74ef68a5092717ce0c1fa2a348bd38f8bdebb22f55948

See more details on using hashes here.

File details

Details for the file pyattck-1.0.4-py2-none-any.whl.

File metadata

  • Download URL: pyattck-1.0.4-py2-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.15

File hashes

Hashes for pyattck-1.0.4-py2-none-any.whl
Algorithm Hash digest
SHA256 e8d9234958751939a170798be2451a6d6adc558cd25a57ca7756729ed19438a0
MD5 cebde244df1c27ade6fb9082ea8d02ba
BLAKE2b-256 38d9b7fd70461771f85e41b7e374c651ed02a0d3f00ce8851568586c2d8f579e

See more details on using hashes here.

Supported by

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