A lightweight Python module to interact with the Mitre Att&ck Enterprise framework.
Project description
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://github.com/xakepnz/enterpriseattack.git
cd enterpriseattack
python3 setup.py install
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
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
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
Built Distributions
File details
Details for the file enterpriseattack-0.1.8.tar.gz
.
File metadata
- Download URL: enterpriseattack-0.1.8.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc43ede88e517b4f4a1cfb2dbb9a86e231bb44b03d7bcff0bc99baca03e0e4fa |
|
MD5 | 6710e14f198f5bd4641d56ab2b06134a |
|
BLAKE2b-256 | 9c3b88479ddc33d59029e5fa565d9dffdf9888b6a36f361d753863d46891d40d |
File details
Details for the file enterpriseattack-0.1.8-py3.10.egg
.
File metadata
- Download URL: enterpriseattack-0.1.8-py3.10.egg
- Upload date:
- Size: 42.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f380eff10a818e94183e33b910625617ee6153b8bcfbc5ab5a89c3a88e02f8f |
|
MD5 | 779a80cd8f26b571c4f581022a869811 |
|
BLAKE2b-256 | 839512d59db36cfcb69e6105c09e337626274af801c4b7ea41ad81de5895bfc0 |
File details
Details for the file enterpriseattack-0.1.8-py2.py3-none-any.whl
.
File metadata
- Download URL: enterpriseattack-0.1.8-py2.py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaa4b0472e943014a3f13a06ef969deb81f3320c8417e2aad532e9c1f10b0c2d |
|
MD5 | f83c8a5199f5abb5818fbb25fc0dd734 |
|
BLAKE2b-256 | 04b6f300d4faab57fa30cd3959171694551e7bbd435d52b2d690f33bc94f735b |