From 1e0108a3991e7b12624d73994b70f3aa66d81059 Mon Sep 17 00:00:00 2001 From: Roberto Rodriguez Date: Tue, 6 Oct 2020 23:54:03 -0400 Subject: [PATCH 1/3] Update requirements.txt fix https://github.com/OTRF/ATTACK-Python-Client/issues/19 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fba8a61..d9e30e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ stix2 -taxii2-client \ No newline at end of file +taxii2-client +six>=1.15.0 \ No newline at end of file From e0a0aa93d2cca4d3ae7c39811fbc0221d9098335 Mon Sep 17 00:00:00 2001 From: Roberto Rodriguez Date: Mon, 23 Nov 2020 23:24:56 -0500 Subject: [PATCH 2/3] Updated 0.3.4 ICS ATT&CK https://github.com/OTRF/ATTACK-Python-Client/issues/21 https://github.com/OTRF/ATTACK-Python-Client/issues/22 --- README.md | 29 +- attackcti/attack_api.py | 609 ++++++++++- docs/source/attackcti_functions.rst | 1577 +-------------------------- docs/source/attackcti_overview.rst | 2 +- docs/source/conf.py | 23 +- docs/source/index.rst | 24 +- docs/source/license.rst | 690 +----------- docs/source/stix.rst | 2 +- docs/source/taxii_client.rst | 4 +- requirements.txt | 4 +- setup.py | 13 +- 11 files changed, 672 insertions(+), 2305 deletions(-) diff --git a/README.md b/README.md index 43c4824..eebc8d1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # ATT&CK Python Client -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/hunters-forge/ATTACK-Python-Client/master) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/OTRF/ATTACK-Python-Client/master) A Python module to access up to date ATT&CK content available in STIX via public TAXII server. This project leverages the python classes and functions of the [cti-python-stix2](https://github.com/oasis-open/cti-python-stix2) and [cti-taxii-client](https://github.com/oasis-open/cti-taxii-client) libraries developed by MITRE. -# Goals +## Goals * Provide an easy way to access and interact with up to date ATT&CK content available in STIX via public TAXII server * Allow security analysts to quickly explore ATT&CK content and apply it in their daily operations @@ -12,11 +12,15 @@ A Python module to access up to date ATT&CK content available in STIX via public * Help security analysts during the transition from the ATT&CK MediaWiki API to the STIX/TAXII 2.0 API * Learn STIX2 and TAXII Client Python libraries -# Current Status: Beta +## Current Status: Production/Stable -The project is currently in a beta stage, which means that the code and the functionality is changing, but the current main functions are stabilising. I would love to get your feedback to make it a better project. +The project is currently in a Production/Stable stage, which means that the current main functions are more stable. I would love to get your feedback to make it a better project. -# Resources +## Updates + +* 11/23/2020 - Added ICS ATT&CK functionality (PRE-ATTACK is deprecated but still available through the library to not break current deployments that leverage it) + +## Resources * [MITRE CTI](https://github.com/mitre/cti) * [OASIS CTI TAXII Client](https://github.com/oasis-open/cti-taxii-client) @@ -26,15 +30,15 @@ The project is currently in a beta stage, which means that the code and the func * [Invoke-ATTACKAPI](https://github.com/Cyb3rWard0g/Invoke-ATTACKAPI) * [Mitre-Attack-API](https://github.com/annamcabee/Mitre-Attack-API) -# Getting Started +## Getting Started [Attackcti Docs](https://attackcti.readthedocs.io/en/latest/) -## Requirements +### Requirements Python 3+ -## Installation +### Installation You can install it via PIP: @@ -50,15 +54,10 @@ cd ATTACK-Python-Client pip install . ``` -# Author +## Author * Roberto Rodriguez [@Cyb3rWard0g](https://twitter.com/Cyb3rWard0g) -# Contributors +## Official Committers * Jose Luis Rodriguez [@Cyb3rPandaH](https://twitter.com/Cyb3rPandaH) - -# To-Do - -* [X] Revokation logic to update Groups Objects -* [ ] Integration with HELK diff --git a/attackcti/attack_api.py b/attackcti/attack_api.py index eb041da..dfb15b5 100644 --- a/attackcti/attack_api.py +++ b/attackcti/attack_api.py @@ -15,40 +15,48 @@ import json import os -ATTCK_STIX_COLLECTIONS = "https://cti-taxii.mitre.org/stix/collections/" -ENTERPRISE_ATTCK = "95ecc380-afe9-11e4-9b6c-751b66dd541e" -PRE_ATTCK = "062767bd-02d2-4b72-84ba-56caef0f8658" -MOBILE_ATTCK = "2f669986-b40b-4423-b720-4396ca6a462b" +ATTACK_STIX_COLLECTIONS = "https://cti-taxii.mitre.org/stix/collections/" +ENTERPRISE_ATTACK = "95ecc380-afe9-11e4-9b6c-751b66dd541e" +PRE_ATTACK = "062767bd-02d2-4b72-84ba-56caef0f8658" +MOBILE_ATTACK = "2f669986-b40b-4423-b720-4396ca6a462b" +ICS_ATTACK = "02c3ef24-9cd4-48f3-a99f-b74ce24f1d34" -ENTERPRISE_ATTCK_LOCAL_DIR = "enterprise-attack" -PRE_ATTCK_LOCAL_DIR = "pre-attack" -MOBILE_ATTCK_LOCAL_DIR = "mobile-attack" +ENTERPRISE_ATTACK_LOCAL_DIR = "enterprise-attack" +PRE_ATTACK_LOCAL_DIR = "pre-attack" +MOBILE_ATTACK_LOCAL_DIR = "mobile-attack" +ICS_ATTACK_LOCAL_DIR = "ics-attack" class attack_client(object): + """A Python Module for ATT&CK""" TC_ENTERPRISE_SOURCE = None TC_PRE_SOURCE = None TC_MOBILE_SOURCE = None + TC_ICS_SOURCE = None COMPOSITE_DS = None def __init__(self, local_path=None): - if local_path is not None and os.path.isdir(os.path.join(local_path, ENTERPRISE_ATTCK_LOCAL_DIR)) \ - and os.path.isdir(os.path.join(local_path, PRE_ATTCK_LOCAL_DIR)) \ - and os.path.isdir(os.path.join(local_path, MOBILE_ATTCK_LOCAL_DIR)): - self.TC_ENTERPRISE_SOURCE = FileSystemSource(os.path.join(local_path, ENTERPRISE_ATTCK_LOCAL_DIR)) - self.TC_PRE_SOURCE = FileSystemSource(os.path.join(local_path, PRE_ATTCK_LOCAL_DIR)) - self.TC_MOBILE_SOURCE = FileSystemSource(os.path.join(local_path, MOBILE_ATTCK_LOCAL_DIR)) + if local_path is not None and os.path.isdir(os.path.join(local_path, ENTERPRISE_ATTACK_LOCAL_DIR)) \ + and os.path.isdir(os.path.join(local_path, PRE_ATTACK_LOCAL_DIR)) \ + and os.path.isdir(os.path.join(local_path, MOBILE_ATTACK_LOCAL_DIR)) \ + and os.path.isdir(os.path.join(local_path, ICS_ATTACK_LOCAL_DIR)): + self.TC_ENTERPRISE_SOURCE = FileSystemSource(os.path.join(local_path, ENTERPRISE_ATTACK_LOCAL_DIR)) + self.TC_PRE_SOURCE = FileSystemSource(os.path.join(local_path, PRE_ATTACK_LOCAL_DIR)) + self.TC_MOBILE_SOURCE = FileSystemSource(os.path.join(local_path, MOBILE_ATTACK_LOCAL_DIR)) + self.TC_ICS_SOURCE = FileSystemSource(os.path.join(local_path, ICS_ATTACK_LOCAL_DIR)) else: - ENTERPRISE_COLLECTION = Collection(ATTCK_STIX_COLLECTIONS + ENTERPRISE_ATTCK + "/") - PRE_COLLECTION = Collection(ATTCK_STIX_COLLECTIONS + PRE_ATTCK + "/") - MOBILE_COLLECTION = Collection(ATTCK_STIX_COLLECTIONS + MOBILE_ATTCK + "/") + ENTERPRISE_COLLECTION = Collection(ATTACK_STIX_COLLECTIONS + ENTERPRISE_ATTACK + "/") + PRE_COLLECTION = Collection(ATTACK_STIX_COLLECTIONS + PRE_ATTACK + "/") + MOBILE_COLLECTION = Collection(ATTACK_STIX_COLLECTIONS + MOBILE_ATTACK + "/") + ICS_COLLECTION = Collection(ATTACK_STIX_COLLECTIONS + ICS_ATTACK + "/") self.TC_ENTERPRISE_SOURCE = TAXIICollectionSource(ENTERPRISE_COLLECTION) self.TC_PRE_SOURCE = TAXIICollectionSource(PRE_COLLECTION) self.TC_MOBILE_SOURCE = TAXIICollectionSource(MOBILE_COLLECTION) + self.TC_ICS_SOURCE = TAXIICollectionSource(ICS_COLLECTION) self.COMPOSITE_DS = CompositeDataSource() - self.COMPOSITE_DS.add_data_sources([self.TC_ENTERPRISE_SOURCE, self.TC_PRE_SOURCE, self.TC_MOBILE_SOURCE]) + self.COMPOSITE_DS.add_data_sources([self.TC_ENTERPRISE_SOURCE, self.TC_PRE_SOURCE, self.TC_MOBILE_SOURCE, self.TC_ICS_SOURCE]) def translate_stix_objects(self, stix_objects): technique_stix_mapping = { @@ -270,6 +278,15 @@ def remove_deprecated(self, stix_objects, extract=False): # ******** Enterprise ATT&CK Technology Domain ******* def get_enterprise(self, stix_format=True): + """ Extracts all the available STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_filter_objects = { "techniques": Filter("type", "=", "attack-pattern"), "mitigations": Filter("type", "=", "course-of-action"), @@ -290,49 +307,120 @@ def get_enterprise(self, stix_format=True): return enterprise_stix_objects def get_enterprise_techniques(self, stix_format=True): + """ Extracts all the available techniques STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + """ enterprise_techniques = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "attack-pattern")) if not stix_format: enterprise_techniques = self.translate_stix_objects(enterprise_techniques) return enterprise_techniques def get_enterprise_mitigations(self, stix_format=True): + """ Extracts all the available mitigations STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_mitigations = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "course-of-action")) if not stix_format: enterprise_mitigations = self.translate_stix_objects(enterprise_mitigations) return enterprise_mitigations def get_enterprise_groups(self, stix_format=True): + """ Extracts all the available groups STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_groups = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "intrusion-set")) if not stix_format: enterprise_groups = self.translate_stix_objects(enterprise_groups) return enterprise_groups def get_enterprise_malware(self, stix_format=True): + """ Extracts all the available malware STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_malware = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "malware")) if not stix_format: enterprise_malware = self.translate_stix_objects(enterprise_malware) return enterprise_malware def get_enterprise_tools(self, stix_format=True): + """ Extracts all the available tools STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_tools = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "tool")) if not stix_format: enterprise_tools = self.translate_stix_objects(enterprise_tools) return enterprise_tools def get_enterprise_relationships(self, stix_format=True): + """ Extracts all the available relationships STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_relationships = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "relationship")) if not stix_format: enterprise_relationships = self.translate_stix_objects(enterprise_relationships) return enterprise_relationships def get_enterprise_tactics(self, stix_format=True): + """ Extracts all the available tactics STIX objects in the Enterprise ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_tactics = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "x-mitre-tactic")) if not stix_format: enterprise_tactics = self.translate_stix_objects(enterprise_tactics) return enterprise_tactics - # ******** Pre ATT&CK Domain ******* + # ******** Pre ATT&CK Domain [DEPRECATED] 11/23/2020 ******* def get_pre(self, stix_format=True): + """ Extracts all the available STIX objects in the Pre ATT&CK matrix [ DEPRECATED AS OF 11/23/2020 ] + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ pre_filter_objects = { "techniques": Filter("type", "=", "attack-pattern"), "groups": Filter("type", "=", "intrusion-set"), @@ -350,24 +438,60 @@ def get_pre(self, stix_format=True): return pre_stix_objects def get_pre_techniques(self, stix_format=True): + """ Extracts all the available techniques STIX objects in the Pre ATT&CK matrix [ DEPRECATED AS OF 11/23/2020 ] + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ pre_techniques = self.TC_PRE_SOURCE.query(Filter("type", "=", "attack-pattern")) if not stix_format: pre_techniques = self.translate_stix_objects(pre_techniques) return pre_techniques def get_pre_groups(self, stix_format=True): + """ Extracts all the available groups STIX objects in the Pre ATT&CK matrix [ DEPRECATED AS OF 11/23/2020 ] + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ pre_groups = self.TC_PRE_SOURCE.query(Filter("type", "=", "intrusion-set")) if not stix_format: pre_groups = self.translate_stix_objects(pre_groups) return pre_groups def get_pre_relationships(self, stix_format=True): + """ Extracts all the available relationships STIX objects in the Pre ATT&CK matrix [ DEPRECATED AS OF 11/23/2020 ] + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ pre_relationships = self.TC_PRE_SOURCE.query(Filter("type", "=", "relationship")) if not stix_format: pre_relationships = self.translate_stix_objects(pre_relationships) return pre_relationships def get_pre_tactics(self, stix_format=True): + """ Extracts all the available tactics STIX objects in the Pre ATT&CK matrix [ DEPRECATED AS OF 11/23/2020 ] + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ pre_tactics = self.TC_PRE_SOURCE.query(Filter("type", "=", "x-mitre-tactic")) if not stix_format: pre_tactics = self.translate_stix_objects(pre_tactics) @@ -375,6 +499,15 @@ def get_pre_tactics(self, stix_format=True): # ******** Mobile ATT&CK Technology Domain ******* def get_mobile(self, stix_format=True): + """ Extracts all the available STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_filter_objects = { "techniques": Filter("type", "=", "attack-pattern"), "mitigations": Filter("type", "=", "course-of-action"), @@ -395,52 +528,233 @@ def get_mobile(self, stix_format=True): return mobile_stix_objects def get_mobile_techniques(self, stix_format=True): + """ Extracts all the available techniques STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_techniques = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "attack-pattern")) if not stix_format: mobile_techniques = self.translate_stix_objects(mobile_techniques) return mobile_techniques def get_mobile_mitigations(self, stix_format=True): + """ Extracts all the available mitigations STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_mitigations = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "course-of-action")) if not stix_format: mobile_mitigations = self.translate_stix_objects(mobile_mitigations) return mobile_mitigations def get_mobile_groups(self, stix_format=True): + """ Extracts all the available groups STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_groups = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "intrusion-set")) if not stix_format: mobile_groups = self.translate_stix_objects(mobile_groups) return mobile_groups def get_mobile_malware(self, stix_format=True): + """ Extracts all the available malware STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_malware = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "malware")) if not stix_format: mobile_malware = self.translate_stix_objects(mobile_malware) return mobile_malware def get_mobile_tools(self, stix_format=True): + """Extracts all the available tools STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_tools = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "tool")) if not stix_format: mobile_tools = self.translate_stix_objects(mobile_tools) return mobile_tools def get_mobile_relationships(self, stix_format=True): + """ Extracts all the available relationships STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_relationships = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "relationship")) if not stix_format: mobile_relationships = self.translate_stix_objects(mobile_relationships) return mobile_relationships def get_mobile_tactics(self, stix_format=True): + """ Extracts all the available tactics STIX objects in the Mobile ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ mobile_tactics = self.TC_MOBILE_SOURCE.query(Filter("type", "=", "x-mitre-tactic")) if not stix_format: mobile_tactics = self.translate_stix_objects(mobile_tactics) return mobile_tactics + + # ******** ICS ATT&CK Technology Domain ******* + def get_ics(self, stix_format=True): + """ Extracts all the available STIX objects in the ICS ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ + ics_filter_objects = { + "techniques": Filter("type", "=", "attack-pattern"), + "mitigations": Filter("type", "=", "course-of-action"), + "groups": Filter("type", "=", "intrusion-set"), + "malware": Filter("type", "=", "malware"), + "relationships": Filter("type", "=", "relationship"), + "tactics": Filter("type", "=", "x-mitre-tactic"), + "matrix": Filter("type", "=", "x-mitre-matrix") + } + ics_stix_objects = {} + for key in ics_filter_objects: + ics_stix_objects[key] = self.TC_ICS_SOURCE.query(ics_filter_objects[key]) + if not stix_format: + ics_stix_objects[key] = self.translate_stix_objects(ics_stix_objects[key]) + return ics_stix_objects + + def get_ics_techniques(self, stix_format=True): + """ Extracts all the available techniques STIX objects in the ICS ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ + ics_techniques = self.TC_ICS_SOURCE.query(Filter("type", "=", "attack-pattern")) + if not stix_format: + ics_techniques = self.translate_stix_objects(ics_techniques) + return ics_techniques + + def get_ics_mitigations(self, stix_format=True): + """ Extracts all the available mitigations STIX objects in the ICS ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ + ics_mitigations = self.TC_ICS_SOURCE.query(Filter("type", "=", "course-of-action")) + if not stix_format: + ics_mitigations = self.translate_stix_objects(ics_mitigations) + return ics_mitigations + + def get_ics_groups(self, stix_format=True): + """ Extracts all the available groups STIX objects in the ICS ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ + ics_groups = self.TC_ICS_SOURCE.query(Filter("type", "=", "intrusion-set")) + if not stix_format: + ics_groups = self.translate_stix_objects(ics_groups) + return ics_groups + + def get_ics_malware(self, stix_format=True): + """ Extracts all the available malware STIX objects in the ICS ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ + ics_malware = self.TC_ICS_SOURCE.query(Filter("type", "=", "malware")) + if not stix_format: + ics_malware = self.translate_stix_objects(ics_malware) + return ics_malware + + def get_ics_relationships(self, stix_format=True): + """ Extracts all the available relationships STIX objects in the ICS ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ + ics_relationships = self.TC_ICS_SOURCE.query(Filter("type", "=", "relationship")) + if not stix_format: + ics_relationships = self.translate_stix_objects(ics_relationships) + return ics_relationships + + def get_ics_tactics(self, stix_format=True): + """ Extracts all the available tactics STIX objects in the ICS ATT&CK matrix + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ + ics_tactics = self.TC_ICS_SOURCE.query(Filter("type", "=", "x-mitre-tactic")) + if not stix_format: + ics_tactics = self.translate_stix_objects(ics_tactics) + return ics_tactics # ******** Get All Functions ******** def get_stix_objects(self, stix_format=True): enterprise_objects = self.get_enterprise() pre_objects = self.get_pre() mobile_objects = self.get_mobile() + ics_objects = self.get_ics() for keypre in pre_objects.keys(): for preobj in pre_objects[keypre]: if keypre in enterprise_objects.keys(): @@ -451,56 +765,118 @@ def get_stix_objects(self, stix_format=True): if keymob in enterprise_objects.keys(): if mobobj not in enterprise_objects[keymob]: enterprise_objects[keymob].append(mobobj) + for keyics in ics_objects.keys(): + for icsobj in ics_objects[keyics]: + if keyics in enterprise_objects.keys(): + if icsobj not in enterprise_objects[keyics]: + enterprise_objects[keyics].append(icsobj) if not stix_format: for enterkey in enterprise_objects.keys(): enterprise_objects[enterkey] = self.translate_stix_objects(enterprise_objects[enterkey]) return enterprise_objects def get_techniques(self, stix_format=True): + """ Extracts all the available techniques STIX objects across all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ all_techniques = self.COMPOSITE_DS.query(Filter("type", "=", "attack-pattern")) if not stix_format: all_techniques = self.translate_stix_objects(all_techniques) return all_techniques def get_groups(self, stix_format=True): + """ Extracts all the available groups STIX objects across all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ all_groups = self.COMPOSITE_DS.query(Filter("type", "=", "intrusion-set")) if not stix_format: all_groups = self.translate_stix_objects(all_groups) return all_groups def get_mitigations(self, stix_format=True): + """ Extracts all the available mitigations STIX objects across all ATT&CK matrices + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + """ enterprise_mitigations = self.get_enterprise_mitigations() mobile_mitigations = self.get_mobile_mitigations() + ics_mitigations = self.get_ics_mitigations() for mm in mobile_mitigations: if mm not in enterprise_mitigations: enterprise_mitigations.append(mm) + for im in ics_mitigations: + if im not in enterprise_mitigations: + enterprise_mitigations.append(im) if not stix_format: enterprise_mitigations = self.translate_stix_objects(enterprise_mitigations) return enterprise_mitigations def get_software(self, stix_format=True): + """ Extracts all the available software STIX objects across all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ enterprise_malware = self.get_enterprise_malware() enterprise_tools = self.get_enterprise_tools() mobile_malware = self.get_mobile_malware() mobile_tools = self.get_mobile_tools() + ics_malware = self.get_ics_malware() for mt in mobile_tools: if mt not in enterprise_tools: enterprise_tools.append(mt) for mmal in mobile_malware: if mmal not in enterprise_malware: enterprise_malware.append(mmal) + for imal in ics_malware: + if imal not in enterprise_malware: + enterprise_malware.append(imal) all_software = enterprise_tools + enterprise_malware if not stix_format: all_software = self.translate_stix_objects(all_software) return all_software def get_relationships(self, stix_format=True): + """ Extracts all the available relationships STIX objects across all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ all_relationships = self.COMPOSITE_DS.query(Filter("type", "=", "relationship")) if not stix_format: all_relationships = self.translate_stix_objects(all_relationships) return all_relationships def get_tactics(self, stix_format=True): + """ Extracts all the available tactics STIX objects across all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ all_tactics = self.COMPOSITE_DS.query(Filter("type", "=", "x-mitre-tactic")) if not stix_format: all_tactics = self.translate_stix_objects(all_tactics) @@ -508,6 +884,16 @@ def get_tactics(self, stix_format=True): # ******** Custom Functions ******** def get_technique_by_name(self, name, case=True, stix_format=True): + """ Extracts technique STIX object by name across all ATT&CK matrices + + Args: + case (bool) : case sensitive or not + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ if not case: all_techniques = self.get_techniques() all_techniques_list = list() @@ -525,6 +911,16 @@ def get_technique_by_name(self, name, case=True, stix_format=True): return all_techniques_list def get_techniques_by_content(self, name, case=True, stix_format=True): + """ Extracts technique STIX object by content across all ATT&CK matrices + + Args: + case (bool) : case sensitive or not + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ all_techniques = self.get_techniques() all_techniques_list = list() for tech in all_techniques: @@ -536,6 +932,16 @@ def get_techniques_by_content(self, name, case=True, stix_format=True): return all_techniques_list def get_techniques_by_platform(self, name, case=True, stix_format=True ): + """ Extracts techniques STIX object by platform across all ATT&CK matrices + + Args: + case (bool) : case sensitive or not + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ if not case: all_techniques = self.get_techniques() all_techniques_list = list() @@ -555,6 +961,16 @@ def get_techniques_by_platform(self, name, case=True, stix_format=True ): return all_techniques_list def get_techniques_by_tactic(self, name, case=True, stix_format=True ): + """ Extracts techniques STIX objects by tactic accross all ATT&CK matrices + + Args: + case (bool) : case sensitive or not + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ if not case: all_techniques = self.get_techniques() all_techniques_list = list() @@ -573,6 +989,17 @@ def get_techniques_by_tactic(self, name, case=True, stix_format=True ): return all_techniques_list def get_object_by_attack_id(self, object_type, attack_id, stix_format=True): + """ Extracts STIX object by attack id accross all ATT&CK matrices + + Args: + object_type (str) : Object type such as 'attack-pattern' or 'course-of-action' or 'intrusion-set' or 'malware' or 'tool + attack_id (str) : STIX object ID + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ valid_objects = {'attack-pattern','course-of-action','intrusion-set','malware','tool'} if object_type not in valid_objects: raise ValueError("ERROR: Valid object must be one of %r" % valid_objects) @@ -587,6 +1014,17 @@ def get_object_by_attack_id(self, object_type, attack_id, stix_format=True): return all_stix_objects def get_group_by_alias(self, group_alias, case=True, stix_format=True): + """ Extracts group STIX objects by alias name accross all ATT&CK matrices + + Args: + group_alias (str) : Alias of threat actor group + case (bool) : case sensitive or not + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ if not case: all_groups = self.get_groups() all_groups_list = list() @@ -606,6 +1044,16 @@ def get_group_by_alias(self, group_alias, case=True, stix_format=True): return all_groups_list def get_techniques_since_time(self, timestamp, stix_format=True): + """ Extracts techniques STIX objects since specific time accross all ATT&CK matrices + + Args: + timestamp (timestamp): Timestamp + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ filter_objects = [ Filter('type', '=', 'attack-pattern'), Filter('created', '>', timestamp) @@ -616,6 +1064,16 @@ def get_techniques_since_time(self, timestamp, stix_format=True): return all_techniques_list def get_relationships_by_object(self, stix_object, stix_format=True): + """ Extracts relationship STIX objects by STIX object accross all ATT&CK matrices + + Args: + stix_object (stix object) : STIX Object to exrtract relationships from + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ if stix_object['type'] == 'course-of-action': relationships = self.COMPOSITE_DS.relationships(stix_object, 'mitigates', source_only=True) else: @@ -625,6 +1083,16 @@ def get_relationships_by_object(self, stix_object, stix_format=True): return relationships def get_techniques_used_by_group(self, stix_object, stix_format=True): + """ Extracts technique STIX objects used by one group accross all ATT&CK matrices + + Args: + stix_object (stix object) : STIX Object group to extract techniques from + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ relationships = self.get_relationships_by_object(stix_object) filter_objects = [ Filter('type', '=', 'attack-pattern'), @@ -642,12 +1110,25 @@ def get_techniques_used_by_group(self, stix_object, stix_format=True): mobile_stix_objects = self.TC_MOBILE_SOURCE.query(filter_objects) except: mobile_stix_objects = [] - all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + try: + ics_stix_objects = self.TC_ICS_SOURCE.query(filter_objects) + except: + ics_stix_objects = [] + all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + ics_stix_objects if not stix_format: all_techniques_list = self.translate_stix_objects(all_techniques_list) return all_techniques_list def get_techniques_used_by_all_groups(self, stix_format=True): + """ Extracts technique STIX objects used by all groups accross all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ groups = self.get_groups() groups = self.remove_revoked(groups) techniques = self.get_techniques() @@ -702,6 +1183,16 @@ def get_techniques_used_by_all_groups(self, stix_format=True): return groups_use_techniques def get_software_used_by_group(self, stix_object, stix_format=True): + """ Extracts software STIX objects used by one group accross all ATT&CK matrices + + Args: + stix_object (stix object) : STIX Object group to extract software from + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ relationships = self.get_relationships_by_object(stix_object) software_relationships = list() for relation in relationships: @@ -723,12 +1214,26 @@ def get_software_used_by_group(self, stix_object, stix_format=True): mobile_stix_objects = self.TC_MOBILE_SOURCE.query(filter_objects) except: mobile_stix_objects = [] - all_software_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + try: + ics_stix_objects = self.TC_ICS_SOURCE.query(filter_objects) + except: + ics_stix_objects = [] + all_software_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + ics_stix_objects if not stix_format: all_software_list = self.translate_stix_objects(all_software_list) return all_software_list def get_techniques_used_by_software(self, stix_object, stix_format=True): + """ Extracts technique STIX objects used by software accross all ATT&CK matrices + + Args: + stix_object (stix object) : STIX Object software to extract techniques from + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ relationships = self.get_relationships_by_object(stix_object) software_relationships = list() for relation in relationships: @@ -750,12 +1255,26 @@ def get_techniques_used_by_software(self, stix_object, stix_format=True): mobile_stix_objects = self.TC_MOBILE_SOURCE.query(filter_objects) except: mobile_stix_objects = [] - all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + try: + ics_stix_objects = self.TC_ICS_SOURCE.query(filter_objects) + except: + ics_stix_objects = [] + all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + ics_stix_objects if not stix_format: all_techniques_list = self.translate_stix_objects(all_techniques_list) return all_techniques_list def get_techniques_used_by_group_software(self, stix_object, stix_format=True): + """ Extracts technique STIX objects used by group software accross all ATT&CK matrices + + Args: + stix_object (stix object) : STIX Object group software to extract techniques from + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ # Get all relationships available for group relationships = self.get_relationships_by_object(stix_object) software_relationships = list() @@ -781,7 +1300,11 @@ def get_techniques_used_by_group_software(self, stix_object, stix_format=True): mobile_stix_objects = self.TC_MOBILE_SOURCE.query(filter_objects) except: mobile_stix_objects = [] - software_uses = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + try: + ics_stix_objects = self.TC_ICS_SOURCE.query(filter_objects) + except: + ics_stix_objects = [] + software_uses = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + ics_stix_objects # Get all techniques used by the software that is used by group filter_techniques = [ Filter('type', '=', 'attack-pattern'), @@ -799,12 +1322,26 @@ def get_techniques_used_by_group_software(self, stix_object, stix_format=True): mobile_stix_objects = self.TC_MOBILE_SOURCE.query(filter_techniques) except: mobile_stix_objects = [] - all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + try: + ics_stix_objects = self.TC_ICS_SOURCE.query(filter_techniques) + except: + ics_stix_objects = [] + all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + ics_stix_objects if not stix_format: all_techniques_list = self.translate_stix_objects(all_techniques_list) return all_techniques_list def get_techniques_mitigated_by_mitigation(self, stix_object, stix_format=True): + """ Extracts technique STIX objects mitigated by one mitigation accross all ATT&CK matrices + + Args: + stix_object (stix object) : STIX Object mitigation to extract techniques mitigated from + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ relationships = self.get_relationships_by_object(stix_object) mitigation_relationships = list() for relation in relationships: @@ -826,12 +1363,25 @@ def get_techniques_mitigated_by_mitigation(self, stix_object, stix_format=True): mobile_stix_objects = self.TC_MOBILE_SOURCE.query(filter_objects) except: mobile_stix_objects = [] - all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + try: + ics_stix_objects = self.TC_ICS_SOURCE.query(filter_objects) + except: + ics_stix_objects = [] + all_techniques_list = enterprise_stix_objects + pre_stix_objects + mobile_stix_objects + ics_stix_objects if not stix_format: all_techniques_list = self.translate_stix_objects(all_techniques_list) return all_techniques_list def get_techniques_mitigated_by_all_mitigations(self, stix_format=True): + """ Extracts technique STIX objects mitigated by all mitigations accross all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ # Get all relationships available relationships = self.get_relationships() # Get all mitigation relationships @@ -852,6 +1402,7 @@ def get_techniques_mitigated_by_all_mitigations(self, stix_format=True): return all_techniques_list def get_data_sources(self): + """ Extracts data sources metadata from all technique STIX objects accross all ATT&CK matrices """ techniques = self.get_techniques() data_sources = [] for t in techniques: @@ -860,6 +1411,15 @@ def get_data_sources(self): return data_sources def get_techniques_by_datasources(self, *args, stix_format=True): + """ Extracts technique STIX objects by specific data sources accross all ATT&CK matrices + + Args: + stix_format (bool): Returns results in original STIX format or friendly syntax (i.e. 'attack-pattern' or 'technique') + + Returns: + List of STIX objects + + """ techniques_results = [] techniques = self.get_techniques() for d in args: @@ -872,6 +1432,7 @@ def get_techniques_by_datasources(self, *args, stix_format=True): return techniques_results def export_groups_navigator_layers(self): + """ Export group STIX objects metadata in MITRE Navigator Layers format """ techniques_used = self.get_techniques_used_by_all_groups() groups = self.get_groups() groups = self.remove_revoked(groups) diff --git a/docs/source/attackcti_functions.rst b/docs/source/attackcti_functions.rst index 059b54b..9418268 100644 --- a/docs/source/attackcti_functions.rst +++ b/docs/source/attackcti_functions.rst @@ -1,1576 +1,7 @@ Library Functions ================= -get_enterprise -############## - -get_enterprise(self, stix_format=True) -************************************** - -Extracts all the available STIX objects in the Enterprise ATT&CK matrix categorized in the following way: - -+--------------------+---------------------+ -| ATT&CK Format | STIX Format | -+====================+=====================+ -| technique | attack-pattern | -+--------------------+---------------------+ -| mitigation | course-of-action | -+--------------------+---------------------+ -| group | intrusion-set | -+--------------------+---------------------+ -| malware | malware | -+--------------------+---------------------+ -| tool | tool | -+--------------------+---------------------+ -| relationship | relationship | -+--------------------+---------------------+ -| tactic | x-mitre-tactic | -+--------------------+---------------------+ -| matrix | x-mitre-tactic | -+--------------------+---------------------+ -| identity | identity | -+--------------------+---------------------+ -| marking-definition | markinng-definition | -+--------------------+---------------------+ - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: Dictionary - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise = lift.get_enterprise() ->>> type(enterprise) - ->>> ->>> enterprise.keys() -dict_keys(['techniques', 'mitigations', 'groups', 'malware', 'tools', 'relationships', 'tactics', 'matrix', 'identity', 'marking-definition']) ->>> ->>> type(enterprise['techniques']) - ->>> type(enterprise['techniques'][0]) - ->>> ->>> print(enterprise['techniques'][0]) -{ - "type": "attack-pattern", - "id": "attack-pattern--cf7b3a06-8b42-4c33-bbe9-012120027925", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-25T20:53:07.719Z", - "modified": "2019-04-29T21:13:49.686Z", - "name": "Compile After Delivery", - "description": "Adversaries may attempt to make payloads difficult to discover and analyze by delivering files to victims as uncompiled code. Similar to [Obfuscated Files or Information](https://attack.mitre.org/techniques/T1027), text-based source code files may subvert analysis and scrutiny from protections targeting executables/binaries. These payloads will need to be compiled before execution; typically via native utilities such as csc.exe or GCC/MinGW.(Citation: ClearSky MuddyWater Nov 2018)\n\nSource code payloads may also be encrypted, encoded, and/or embedded within other files, such as those delivered as a [Spearphishing Attachment](https://attack.mitre.org/techniques/T1193). Payloads may also be delivered in formats unrecognizable and inherently benign to the native OS (ex: EXEs on macOS/Linux) before later being (re)compiled into a proper executable binary with a bundled compiler and execution framework.(Citation: TrendMicro WindowsAppMac)\n", - "kill_chain_phases": [ - { - "kill_chain_name": "mitre-attack", - "phase_name": "defense-evasion" - } - ], - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/techniques/T1500", - "external_id": "T1500" - }, - { - "source_name": "ClearSky MuddyWater Nov 2018", - "description": "ClearSky Cyber Security. (2018, November). MuddyWater Operations in Lebanon and Oman: Using an Israeli compromised domain for a two-stage campaign. Retrieved November 29, 2018.", - "url": "https://www.clearskysec.com/wp-content/uploads/2018/11/MuddyWater-Operations-in-Lebanon-and-Oman.pdf" - }, - { - "source_name": "TrendMicro WindowsAppMac", - "description": "Trend Micro. (2019, February 11). Windows App Runs on Mac, Downloads Info Stealer and Adware. Retrieved April 25, 2019.", - "url": "https://blog.trendmicro.com/trendlabs-security-intelligence/windows-app-runs-on-mac-downloads-info-stealer-and-adware/" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_contributors": [ - "Ye Yint Min Thu Htut, Offensive Security Team, DBS Bank", - "Praetorian" - ], - "x_mitre_data_sources": [ - "Process command-line parameters", - "Process monitoring", - "File monitoring" - ], - "x_mitre_defense_bypassed": [ - "Static File Analysis", - "Binary Analysis", - "Anti-virus", - "Host intrusion prevention systems", - "Signature-based detection" - ], - "x_mitre_detection": "Monitor the execution file paths and command-line arguments for common compilers, such as csc.exe and GCC/MinGW, and correlate with other suspicious behavior to reduce false positives from normal user and administrator behavior. The compilation of payloads may also generate file creation and/or file write events. Look for non-native binary formats and cross-platform compiler and execution frameworks like Mono and determine if they have a legitimate purpose on the system.(Citation: TrendMicro WindowsAppMac) Typically these should only be used in specific and limited cases, like for software development.", - "x_mitre_permissions_required": [ - "User" - ], - "x_mitre_platforms": [ - "Linux", - "macOS", - "Windows" - ], - "x_mitre_system_requirements": [ - "Compiler software (either native to the system or delivered by the adversary)" - ], - "x_mitre_version": "1.0" -} - -get_enterprise_techniques -######################### - -get_enterprise_techniques(self, stix_format=True) -************************************************* - -Extracts all the available techniques STIX objects in the Enterprise ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.AttackPattern objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise_techniques = lift.get_enterprise_techniques() ->>> type(enterprise_techniques) - ->>> ->>> type(enterprise_techniques[0]) - ->>> ->>> print(enterprise_techniques[0]) -{ - "type": "attack-pattern", - "id": "attack-pattern--cf7b3a06-8b42-4c33-bbe9-012120027925", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-25T20:53:07.719Z", - "modified": "2019-04-29T21:13:49.686Z", - "name": "Compile After Delivery", - "description": "Adversaries may attempt to make payloads difficult to discover and analyze by delivering files to victims as uncompiled code. Similar to [Obfuscated Files or Information](https://attack.mitre.org/techniques/T1027), text-based source code files may subvert analysis and scrutiny from protections targeting executables/binaries. These payloads will need to be compiled before execution; typically via native utilities such as csc.exe or GCC/MinGW.(Citation: ClearSky MuddyWater Nov 2018)\n\nSource code payloads may also be encrypted, encoded, and/or embedded within other files, such as those delivered as a [Spearphishing Attachment](https://attack.mitre.org/techniques/T1193). Payloads may also be delivered in formats unrecognizable and inherently benign to the native OS (ex: EXEs on macOS/Linux) before later being (re)compiled into a proper executable binary with a bundled compiler and execution framework.(Citation: TrendMicro WindowsAppMac)\n", - "kill_chain_phases": [ - { - "kill_chain_name": "mitre-attack", - "phase_name": "defense-evasion" - } - ], - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/techniques/T1500", - "external_id": "T1500" - }, - { - "source_name": "ClearSky MuddyWater Nov 2018", - "description": "ClearSky Cyber Security. (2018, November). MuddyWater Operations in Lebanon and Oman: Using an Israeli compromised domain for a two-stage campaign. Retrieved November 29, 2018.", - "url": "https://www.clearskysec.com/wp-content/uploads/2018/11/MuddyWater-Operations-in-Lebanon-and-Oman.pdf" - }, - { - "source_name": "TrendMicro WindowsAppMac", - "description": "Trend Micro. (2019, February 11). Windows App Runs on Mac, Downloads Info Stealer and Adware. Retrieved April 25, 2019.", - "url": "https://blog.trendmicro.com/trendlabs-security-intelligence/windows-app-runs-on-mac-downloads-info-stealer-and-adware/" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_contributors": [ - "Ye Yint Min Thu Htut, Offensive Security Team, DBS Bank", - "Praetorian" - ], - "x_mitre_data_sources": [ - "Process command-line parameters", - "Process monitoring", - "File monitoring" - ], - "x_mitre_defense_bypassed": [ - "Static File Analysis", - "Binary Analysis", - "Anti-virus", - "Host intrusion prevention systems", - "Signature-based detection" - ], - "x_mitre_detection": "Monitor the execution file paths and command-line arguments for common compilers, such as csc.exe and GCC/MinGW, and correlate with other suspicious behavior to reduce false positives from normal user and administrator behavior. The compilation of payloads may also generate file creation and/or file write events. Look for non-native binary formats and cross-platform compiler and execution frameworks like Mono and determine if they have a legitimate purpose on the system.(Citation: TrendMicro WindowsAppMac) Typically these should only be used in specific and limited cases, like for software development.", - "x_mitre_permissions_required": [ - "User" - ], - "x_mitre_platforms": [ - "Linux", - "macOS", - "Windows" - ], - "x_mitre_system_requirements": [ - "Compiler software (either native to the system or delivered by the adversary)" - ], - "x_mitre_version": "1.0" -} - -get_enterprise_mitigations -########################## - -get_enterprise_mitigations(self, stix_format=True) -************************************************** - -Extracts all the available mitigations STIX objects in the Enterprise ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.CourseOfAction objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise_mitigations = lift.get_enterprise_mitigations() ->>> type(enterprise_mitigations) - ->>> ->>> type(enterprise_mitigations[0]) - ->>> ->>> print(enterprise_mitigations[0]) -{ - "type": "course-of-action", - "id": "course-of-action--70886857-0f19-4caa-b081-548354a8a994", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-26T19:30:33.607Z", - "modified": "2019-04-26T19:41:45.126Z", - "name": "Firmware Corruption Mitigation", - "description": "Prevent adversary access to privileged accounts or access necessary to perform this technique. Check the integrity of the existing BIOS and device firmware to determine if it is vulnerable to modification. Patch the BIOS and other firmware as necessary to prevent successful use of known vulnerabilities. ", - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/techniques/T1495", - "external_id": "T1495" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_version": "1.0" -} - -get_enterprise_groups -##################### - -get_enterprise_groups(self, stix_format=True) -********************************************* - -Extracts all the available groups STIX objects in the Enterprise ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.IntrusionSet objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise_groups = lift.get_enterprise_groups() ->>> type(enterprise_groups) - ->>> ->>> type(enterprise_groups[0]) - ->>> ->>> print(enterprise_groups[0]) -{ - "type": "intrusion-set", - "id": "intrusion-set--9538b1a4-4120-4e2d-bf59-3b11fcab05a4", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-16T15:14:38.533Z", - "modified": "2019-04-29T18:59:16.079Z", - "name": "TEMP.Veles", - "description": "[TEMP.Veles](https://attack.mitre.org/groups/G0088) is a Russia-based threat group that has targeted critical infrastructure. The group has been observed utilizing TRITON, a malware framework designed to manipulate industrial safety systems.(Citation: FireEye TRITON 2019)(Citation: FireEye TEMP.Veles 2018)(Citation: FireEye TEMP.Veles JSON April 2019)", - "aliases": [ - "TEMP.Veles", - "XENOTIME" - ], - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/groups/G0088", - "external_id": "G0088" - }, - { - "source_name": "TEMP.Veles", - "description": "(Citation: FireEye TRITON 2019)" - }, - { - "source_name": "XENOTIME", - "description": "The activity group XENOTIME, as defined by Dragos, has overlaps with activity reported upon by FireEye about TEMP.Veles as well as the actors behind TRITON.(Citation: Dragos Xenotime 2018)(Citation: Pylos Xenotime 2019)(Citation: FireEye TRITON 2019)(Citation: FireEye TEMP.Veles 2018 )" - }, - { - "source_name": "FireEye TRITON 2019", - "description": "Miller, S, et al. (2019, April 10). TRITON Actor TTP Profile, Custom Attack Tools, Detections, and ATT&CK Mapping. Retrieved April 16, 2019.", - "url": "https://www.fireeye.com/blog/threat-research/2019/04/triton-actor-ttp-profile-custom-attack-tools-detections.html" - }, - { - "source_name": "FireEye TEMP.Veles 2018", - "description": "FireEye Intelligence . (2018, October 23). TRITON Attribution: Russian Government-Owned Lab Most Likely Built Custom Intrusion Tools for TRITON Attackers. Retrieved April 16, 2019.", - "url": "https://www.fireeye.com/blog/threat-research/2018/10/triton-attribution-russian-government-owned-lab-most-likely-built-tools.html " - }, - { - "source_name": "FireEye TEMP.Veles JSON April 2019", - "description": "Miller, S., et al. (2019, April 10). TRITON Appendix C. Retrieved April 29, 2019.", - "url": "https://www.fireeye.com/content/dam/fireeye-www/blog/files/TRITON_Appendix_C.html" - }, - { - "source_name": "Dragos Xenotime 2018", - "description": "Dragos, Inc.. (n.d.). Xenotime. Retrieved April 16, 2019.", - "url": "https://dragos.com/resource/xenotime/" - }, - { - "source_name": "Pylos Xenotime 2019", - "description": "Slowik, J.. (2019, April 12). A XENOTIME to Remember: Veles in the Wild. Retrieved April 16, 2019.", - "url": "https://pylos.co/2019/04/12/a-xenotime-to-remember-veles-in-the-wild/" - }, - { - "source_name": "FireEye TEMP.Veles 2018 ", - "description": "FireEye Intelligence . (2018, October 23). TRITON Attribution: Russian Government-Owned Lab Most Likely Built Custom Intrusion Tools for TRITON Attackers. Retrieved April 16, 2019.", - "url": "https://www.fireeye.com/blog/threat-research/2018/10/triton-attribution-russian-government-owned-lab-most-likely-built-tools.html " - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_version": "1.0" -} - -get_enterprise_malware -###################### - -get_enterprise_malware(self, stix_format=True) -********************************************** - -Extracts all the available malware STIX objects in the Enterprise ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.Malware objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise_malware = lift.get_enterprise_malware() ->>> type(enterprise_malware) - ->>> ->>> type(enterprise_malware[0]) - ->>> ->>> print(enterprise_malware[0]) -{ - "type": "malware", - "id": "malware--d1531eaa-9e17-473e-a680-3298469662c3", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-23T18:41:36.914Z", - "modified": "2019-04-29T21:19:34.739Z", - "name": "CoinTicker", - "description": "[CoinTicker](https://attack.mitre.org/software/S0369) is a malicious application that poses as a cryptocurrency price ticker and installs components of the open source backdoors EvilOSX and EggShell.(Citation: CoinTicker 2019)", - "labels": [ - "malware" - ], - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/software/S0369", - "external_id": "S0369" - }, - { - "source_name": "CoinTicker 2019", - "description": "Thomas Reed. (2018, October 29). Mac cryptocurrency ticker app installs backdoors. Retrieved April 23, 2019.", - "url": "https://blog.malwarebytes.com/threat-analysis/2018/10/mac-cryptocurrency-ticker-app-installs-backdoors/" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_aliases": [ - "CoinTicker" - ], - "x_mitre_contributors": [ - "Richie Cyrus, SpecterOps" - ], - "x_mitre_platforms": [ - "macOS" - ], - "x_mitre_version": "1.0" -} - -get_enterprise_tools -#################### - -get_enterprise_tools(self, stix_format=True) -******************************************** - -Extracts all the available tools STIX objects in the Enterprise ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.Tool objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise_tools = lift.get_enterprise_tools() ->>> type(enterprise_tools) - ->>> ->>> type(enterprise_tools[0]) - ->>> ->>> print(enterprise_tools[0]) -{ - "type": "tool", - "id": "tool--4b57c098-f043-4da2-83ef-7588a6d426bc", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-23T12:31:58.125Z", - "modified": "2019-04-23T18:29:12.005Z", - "name": "PoshC2", - "description": "[PoshC2](https://attack.mitre.org/software/S0378) is an open source remote administration and post-exploitation framework that is publicly available on GitHub. The server-side components of the tool are primarily written in Python, while the implants are written in [PowerShell](https://attack.mitre.org/techniques/T1086). Although [PoshC2](https://attack.mitre.org/software/S0378) is primarily focused on Windows implantation, it does contain a basic Python dropper for Linux/macOS.(Citation: GitHub PoshC2)", - "labels": [ - "tool" - ], - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/software/S0378", - "external_id": "S0378" - }, - { - "source_name": "GitHub PoshC2", - "description": "Nettitude. (2016, June 8). PoshC2: Powershell C2 Server and Implants. Retrieved April 23, 2019.", - "url": "https://github.com/nettitude/PoshC2" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_aliases": [ - "PoshC2" - ], - "x_mitre_platforms": [ - "Windows", - "Linux", - "macOS" - ], - "x_mitre_version": "1.0" -} - -get_enterprise_relationships -############################ - -get_enterprise_relationships(self, stix_format=True) -**************************************************** - -Extracts all the available relationships STIX objects in the Enterprise ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sro.Relationship objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise_relationships = lift.get_enterprise_relationships() ->>> type(enterprise_relationships) - ->>> ->>> type(enterprise_relationships[0]) - ->>> ->>> print(enterprise_relationships[0]) -{ - "type": "relationship", - "id": "relationship--2a37ddb3-56ef-4c2d-bec7-d6060eb0215a", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-29T15:54:23.241Z", - "modified": "2019-04-29T18:16:38.854Z", - "relationship_type": "uses", - "source_ref": "intrusion-set--44e43fad-ffcb-4210-abcf-eaaed9735f80", - "target_ref": "malware--ecc2f65a-b452-4eaf-9689-7e181f17f7a5", - "external_references": [ - { - "source_name": "Symantec Chafer Dec 2015", - "description": "Symantec Security Response. (2015, December 7). Iran-based attackers use back door threats to spy on Middle Eastern targets. Retrieved April 17, 2019.", - "url": "https://www.symantec.com/connect/blogs/iran-based-attackers-use-back-door-threats-spy-middle-eastern-targets" - }, - { - "source_name": "Securelist Remexi Jan 2019", - "description": "Legezo, D. (2019, January 30). Chafer used Remexi malware to spy on Iran-based foreign diplomatic entities. Retrieved April 17, 2019.", - "url": "https://securelist.com/chafer-used-remexi-malware/89538/" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ] -} - -get_enterprise_tactics -###################### - -get_enterprise_tactics(self, stix_format=True) -********************************************** - -Extracts all the available tactics STIX objects in the Enterprise ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of dictionaries - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> enterprise_tactics = lift.get_enterprise_tactics() ->>> type(enterprise_tactics) - ->>> ->>> type(enterprise_tactics[0]) - ->>> ->>> print(enterprise_tactics[0]) -{'external_references': [{'external_id': 'TA0040', 'source_name': 'mitre-attack', 'url': 'https://attack.mitre.org/tactics/TA0040'}], 'object_marking_refs': ['marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168'], 'id': 'x-mitre-tactic--5569339b-94c2-49ee-afb3-2222936582c8', 'name': 'Impact', 'created': '2019-03-14T18:44:44.639Z', 'modified': '2019-04-29T14:23:04.506Z', 'type': 'x-mitre-tactic', 'created_by_ref': 'identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5', 'description': "The Impact tactic represents techniques whose primary objective directly reduces the availability or integrity of a system, service, or network; including manipulation of data to impact a business or operational process. These techniques may represent an adversary's end goal, or provide cover for a breach of confidentiality.", 'x_mitre_shortname': 'impact'} - - -get_pre -####### - -get_pre(self, stix_format=True) -******************************* - -Extracts all the available STIX objects in the Pre ATT&CK matrix categorized in the following way: - -+--------------------+---------------------+ -| ATT&CK Format | STIX Format | -+====================+=====================+ -| technique | attack-pattern | -+--------------------+---------------------+ -| group | intrusion-set | -+--------------------+---------------------+ -| relationship | relationship | -+--------------------+---------------------+ -| tactic | x-mitre-tactic | -+--------------------+---------------------+ -| matrix | x-mitre-tactic | -+--------------------+---------------------+ -| identity | identity | -+--------------------+---------------------+ -| marking-definition | markinng-definition | -+--------------------+---------------------+ - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: Dictionary - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> pre = lift.get_pre() ->>> type(pre) - ->>> ->>> pre.keys() -dict_keys(['techniques', 'groups', 'relationships', 'tactics', 'matrix', 'identity', 'marking-definition']) ->>> ->>> type(pre['techniques']) - ->>> type(pre['techniques'][0]) - ->>> ->>> print(pre['techniques'][0]) -{ - "type": "attack-pattern", - "id": "attack-pattern--b182f29c-2505-4b32-a000-0440ef189f59", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2018-04-18T17:59:24.739Z", - "modified": "2018-10-17T00:14:20.652Z", - "name": "Spearphishing for Information", - "description": "Spearphishing for information is a specific variant of spearphishing. Spearphishing for information is different from other forms of spearphishing in that it it doesn't leverage malicious code. All forms of spearphishing are elctronically delivered social engineering targeted at a specific individual, company, or industry. Spearphishing for information is an attempt to trick targets into divulging information, frequently credentials, without involving malicious code. Spearphishing for information frequently involves masquerading as a source with a reason to collect information (such as a system administrator or a bank) and providing a user with a website link to visit. The given website often closely resembles a legitimate site in appearance and has a URL containing elements from the real site. From the fake website, information is gathered in web forms and sent to the attacker. Spearphishing for information may also try to obtain information directly through the exchange of emails, instant messengers or other electronic conversation means. (Citation: ATTACKREF GRIZZLY STEPPE JAR)", - "kill_chain_phases": [ - { - "kill_chain_name": "mitre-pre-attack", - "phase_name": "technical-information-gathering" - } - ], - "external_references": [ - { - "source_name": "mitre-pre-attack", - "url": "https://attack.mitre.org/techniques/T1397", - "external_id": "T1397" - }, - { - "source_name": "ATTACKREF GRIZZLY STEPPE JAR", - "description": "Department of Homeland Security and Federal Bureau of Investigation. (2016, December 29). GRIZZLY STEPPE \u2013 Russian Malicious Cyber Activity. Retrieved January 11, 2017." - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_detectable_by_common_defenses": "Partial", - "x_mitre_detectable_by_common_defenses_explanation": "Depending on the specific method of phishing, the detections can vary. For emails, filtering based on DKIP+SPF or header analysis can help detect when the email sender is spoofed. When it comes to following links, network intrusion detection systems (NIDS), firewalls, removing links, exploding shortened links, proxy monitoring, blocking uncategorized sites, and site reputation based filtering can all provide detection opportunities.", - "x_mitre_difficulty_for_adversary": "Yes", - "x_mitre_difficulty_for_adversary_explanation": "Sending emails is trivial, and, over time, an adversary can refine their technique to minimize detection by making their emails seem legitimate in structure and content.", - "x_mitre_old_attack_id": "PRE-T1174", - "x_mitre_version": "1.0" -} - -get_pre_techniques -################## - -get_pre_techniques(self, stix_format=True) -****************************************** - -Extracts all the available techniques STIX objects in the Pre ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.AttackPattern objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> pre_techniques = lift.get_pre_techniques() ->>> type(pre_techniques) - ->>> ->>> type(pre_techniques[0]) - ->>> ->>> print(pre_techniques[0]) -{ - "type": "attack-pattern", - "id": "attack-pattern--b182f29c-2505-4b32-a000-0440ef189f59", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2018-04-18T17:59:24.739Z", - "modified": "2018-10-17T00:14:20.652Z", - "name": "Spearphishing for Information", - "description": "Spearphishing for information is a specific variant of spearphishing. Spearphishing for information is different from other forms of spearphishing in that it it doesn't leverage malicious code. All forms of spearphishing are elctronically delivered social engineering targeted at a specific individual, company, or industry. Spearphishing for information is an attempt to trick targets into divulging information, frequently credentials, without involving malicious code. Spearphishing for information frequently involves masquerading as a source with a reason to collect information (such as a system administrator or a bank) and providing a user with a website link to visit. The given website often closely resembles a legitimate site in appearance and has a URL containing elements from the real site. From the fake website, information is gathered in web forms and sent to the attacker. Spearphishing for information may also try to obtain information directly through the exchange of emails, instant messengers or other electronic conversation means. (Citation: ATTACKREF GRIZZLY STEPPE JAR)", - "kill_chain_phases": [ - { - "kill_chain_name": "mitre-pre-attack", - "phase_name": "technical-information-gathering" - } - ], - "external_references": [ - { - "source_name": "mitre-pre-attack", - "url": "https://attack.mitre.org/techniques/T1397", - "external_id": "T1397" - }, - { - "source_name": "ATTACKREF GRIZZLY STEPPE JAR", - "description": "Department of Homeland Security and Federal Bureau of Investigation. (2016, December 29). GRIZZLY STEPPE \u2013 Russian Malicious Cyber Activity. Retrieved January 11, 2017." - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_detectable_by_common_defenses": "Partial", - "x_mitre_detectable_by_common_defenses_explanation": "Depending on the specific method of phishing, the detections can vary. For emails, filtering based on DKIP+SPF or header analysis can help detect when the email sender is spoofed. When it comes to following links, network intrusion detection systems (NIDS), firewalls, removing links, exploding shortened links, proxy monitoring, blocking uncategorized sites, and site reputation based filtering can all provide detection opportunities.", - "x_mitre_difficulty_for_adversary": "Yes", - "x_mitre_difficulty_for_adversary_explanation": "Sending emails is trivial, and, over time, an adversary can refine their technique to minimize detection by making their emails seem legitimate in structure and content.", - "x_mitre_old_attack_id": "PRE-T1174", - "x_mitre_version": "1.0" -} - -get_pre_groups -############## - -get_pre_groups(self, stix_format=True) -************************************** - -Extracts all the available groups STIX objects in the Pre ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.IntrusionSet objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> pre_groups = lift.get_pre_groups() ->>> type(pre_groups) - ->>> ->>> type(pre_groups[0]) - ->>> ->>> print(pre_groups[0]) -{ - "type": "intrusion-set", - "id": "intrusion-set--9538b1a4-4120-4e2d-bf59-3b11fcab05a4", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-16T15:14:38.533Z", - "modified": "2019-04-29T18:59:16.079Z", - "name": "TEMP.Veles", - "description": "[TEMP.Veles](https://attack.mitre.org/groups/G0088) is a Russia-based threat group that has targeted critical infrastructure. The group has been observed utilizing TRITON, a malware framework designed to manipulate industrial safety systems.(Citation: FireEye TRITON 2019)(Citation: FireEye TEMP.Veles 2018)(Citation: FireEye TEMP.Veles JSON April 2019)", - "aliases": [ - "TEMP.Veles", - "XENOTIME" - ], - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/groups/G0088", - "external_id": "G0088" - }, - { - "source_name": "TEMP.Veles", - "description": "(Citation: FireEye TRITON 2019)" - }, - { - "source_name": "XENOTIME", - "description": "The activity group XENOTIME, as defined by Dragos, has overlaps with activity reported upon by FireEye about TEMP.Veles as well as the actors behind TRITON.(Citation: Dragos Xenotime 2018)(Citation: Pylos Xenotime 2019)(Citation: FireEye TRITON 2019)(Citation: FireEye TEMP.Veles 2018 )" - }, - { - "source_name": "FireEye TRITON 2019", - "description": "Miller, S, et al. (2019, April 10). TRITON Actor TTP Profile, Custom Attack Tools, Detections, and ATT&CK Mapping. Retrieved April 16, 2019.", - "url": "https://www.fireeye.com/blog/threat-research/2019/04/triton-actor-ttp-profile-custom-attack-tools-detections.html" - }, - { - "source_name": "FireEye TEMP.Veles 2018", - "description": "FireEye Intelligence . (2018, October 23). TRITON Attribution: Russian Government-Owned Lab Most Likely Built Custom Intrusion Tools for TRITON Attackers. Retrieved April 16, 2019.", - "url": "https://www.fireeye.com/blog/threat-research/2018/10/triton-attribution-russian-government-owned-lab-most-likely-built-tools.html " - }, - { - "source_name": "FireEye TEMP.Veles JSON April 2019", - "description": "Miller, S., et al. (2019, April 10). TRITON Appendix C. Retrieved April 29, 2019.", - "url": "https://www.fireeye.com/content/dam/fireeye-www/blog/files/TRITON_Appendix_C.html" - }, - { - "source_name": "Dragos Xenotime 2018", - "description": "Dragos, Inc.. (n.d.). Xenotime. Retrieved April 16, 2019.", - "url": "https://dragos.com/resource/xenotime/" - }, - { - "source_name": "Pylos Xenotime 2019", - "description": "Slowik, J.. (2019, April 12). A XENOTIME to Remember: Veles in the Wild. Retrieved April 16, 2019.", - "url": "https://pylos.co/2019/04/12/a-xenotime-to-remember-veles-in-the-wild/" - }, - { - "source_name": "FireEye TEMP.Veles 2018 ", - "description": "FireEye Intelligence . (2018, October 23). TRITON Attribution: Russian Government-Owned Lab Most Likely Built Custom Intrusion Tools for TRITON Attackers. Retrieved April 16, 2019.", - "url": "https://www.fireeye.com/blog/threat-research/2018/10/triton-attribution-russian-government-owned-lab-most-likely-built-tools.html " - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_version": "1.0" -} - -get_pre_relationships -##################### - -get_pre_relationships(self, stix_format=True) -********************************************* - -Extracts all the available relationships STIX objects in the Pre ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sro.Relationship objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> pre_relationships = lift.get_pre_relationships() ->>> type(pre_relationships) - ->>> ->>> type(pre_relationships[0]) - ->>> ->>> print(pre_relationships[0]) -{ - "type": "relationship", - "id": "relationship--21842707-0f15-43bf-bc42-2bceadf2cfa2", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-24T19:45:44.212Z", - "modified": "2019-04-29T18:59:16.596Z", - "relationship_type": "uses", - "description": "[TEMP.Veles](https://attack.mitre.org/groups/G0088) has used dynamic DNS.", - "source_ref": "intrusion-set--9538b1a4-4120-4e2d-bf59-3b11fcab05a4", - "target_ref": "attack-pattern--20a66013-8dab-4ca3-a67d-766c842c561c", - "external_references": [ - { - "source_name": "FireEye TRITON 2019", - "description": "Miller, S, et al. (2019, April 10). TRITON Actor TTP Profile, Custom Attack Tools, Detections, and ATT&CK Mapping. Retrieved April 16, 2019.", - "url": "https://www.fireeye.com/blog/threat-research/2019/04/triton-actor-ttp-profile-custom-attack-tools-detections.html" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ] -} - -get_pre_tactics -############### - -get_pre_tactics(self, stix_format=True) -*************************************** - -Extracts all the available tactics STIX objects in the Pre ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of dictionaries - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> pre_tactics = lift.get_pre_tactics() ->>> type(pre_tactics) - ->>> ->>> type(pre_tactics[0]) - ->>> ->>> print(pre_tactics[0]) -{'external_references': [{'external_id': 'TA0017', 'source_name': 'mitre-attack', 'url': 'https://attack.mitre.org/tactics/TA0017'}], 'object_marking_refs': ['marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168'], 'id': 'x-mitre-tactic--b9f8a273-6167-47cb-89e6-02774d067e24', 'name': 'Organizational Information Gathering', 'created': '2018-10-17T00:14:20.652Z', 'modified': '2018-10-17T00:14:20.652Z', 'type': 'x-mitre-tactic', 'created_by_ref': 'identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5', 'description': 'Organizational information gathering consists of the process of identifying critical organizational elements of intelligence an adversary will need about a target in order to best attack.\xa0 Similar to competitive intelligence, organizational intelligence gathering focuses on understanding the operational tempo of an organization and gathering a deep understanding of the organization and how it operates, in order to best develop a strategy to target it.', 'x_mitre_shortname': 'organizational-information-gathering'} - -get_mobile -########## - -get_mobile(self, stix_format=True) -********************************** - -Extracts all the available STIX objects in the Mobile ATT&CK matrix categorized in the following way: - -+--------------------+---------------------+ -| ATT&CK Format | STIX Format | -+====================+=====================+ -| technique | attack-pattern | -+--------------------+---------------------+ -| mitigation | course-of-action | -+--------------------+---------------------+ -| group | intrusion-set | -+--------------------+---------------------+ -| malware | malware | -+--------------------+---------------------+ -| tool | tool | -+--------------------+---------------------+ -| relationship | relationship | -+--------------------+---------------------+ -| tactic | x-mitre-tactic | -+--------------------+---------------------+ -| matrix | x-mitre-tactic | -+--------------------+---------------------+ -| identity | identity | -+--------------------+---------------------+ -| marking-definition | markinng-definition | -+--------------------+---------------------+ - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: Dictionary - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile = lift.get_mobile() ->>> type(mobile) - ->>> ->>> mobile.keys() -dict_keys(['techniques', 'mitigations', 'groups', 'malware', 'tools', 'relationships', 'tactics', 'matrix', 'identity', 'marking-definition']) ->>> ->>> type(mobile['techniques']) - ->>> type(mobile['techniques'][0]) - ->>> ->>> print(mobile['techniques'][0]) -{ - "type": "attack-pattern", - "id": "attack-pattern--c6a146ae-9c63-4606-97ff-e261e76e8380", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-02-01T17:29:43.503Z", - "modified": "2019-02-01T17:29:43.503Z", - "name": "Web Service", - "description": "Adversaries may use an existing, legitimate external Web service as a means for relaying commands to a compromised system.\n\nThese commands may also include pointers to command and control (C2) infrastructure. Adversaries may post content, known as a dead drop resolver, on Web services with embedded (and often obfuscated/encoded) domains or IP addresses. Once infected, victims will reach out to and be redirected by these resolvers.\n\nPopular websites and social media acting as a mechanism for C2 may give a significant amount of cover due to the likelihood that hosts within a network are already communicating with them prior to a compromise. Using common services, such as those offered by Google or Twitter, makes it easier for adversaries to hide in expected noise. Web service providers commonly use SSL/TLS encryption, giving adversaries an added level of protection.\n\nUse of Web services may also protect back-end C2 infrastructure from discovery through malware binary analysis while also enabling operational resiliency (since this infrastructure may be dynamically changed).", - "kill_chain_phases": [ - { - "kill_chain_name": "mitre-mobile-attack", - "phase_name": "command-and-control" - } - ], - "external_references": [ - { - "source_name": "mitre-mobile-attack", - "url": "https://attack.mitre.org/techniques/T1481", - "external_id": "T1481" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_platforms": [ - "Android", - "iOS" - ], - "x_mitre_tactic_type": [ - "Post-Adversary Device Access" - ], - "x_mitre_version": "1.0" -} - -get_mobile_techniques -##################### - -get_mobile_techniques(self, stix_format=True) -********************************************* - -Extracts all the available techniques STIX objects in the Mobile ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.AttackPattern objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile_techniques = lift.get_mobile_techniques() ->>> type(mobile_techniques) - ->>> ->>> type(mobile_techniques[0]) - ->>> ->>> print(mobile_techniques[0]) -{ - "type": "attack-pattern", - "id": "attack-pattern--c6a146ae-9c63-4606-97ff-e261e76e8380", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-02-01T17:29:43.503Z", - "modified": "2019-02-01T17:29:43.503Z", - "name": "Web Service", - "description": "Adversaries may use an existing, legitimate external Web service as a means for relaying commands to a compromised system.\n\nThese commands may also include pointers to command and control (C2) infrastructure. Adversaries may post content, known as a dead drop resolver, on Web services with embedded (and often obfuscated/encoded) domains or IP addresses. Once infected, victims will reach out to and be redirected by these resolvers.\n\nPopular websites and social media acting as a mechanism for C2 may give a significant amount of cover due to the likelihood that hosts within a network are already communicating with them prior to a compromise. Using common services, such as those offered by Google or Twitter, makes it easier for adversaries to hide in expected noise. Web service providers commonly use SSL/TLS encryption, giving adversaries an added level of protection.\n\nUse of Web services may also protect back-end C2 infrastructure from discovery through malware binary analysis while also enabling operational resiliency (since this infrastructure may be dynamically changed).", - "kill_chain_phases": [ - { - "kill_chain_name": "mitre-mobile-attack", - "phase_name": "command-and-control" - } - ], - "external_references": [ - { - "source_name": "mitre-mobile-attack", - "url": "https://attack.mitre.org/techniques/T1481", - "external_id": "T1481" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_platforms": [ - "Android", - "iOS" - ], - "x_mitre_tactic_type": [ - "Post-Adversary Device Access" - ], - "x_mitre_version": "1.0" -} - -get_mobile_mitigations -###################### - -get_mobile_mitigations(self, stix_format=True) -********************************************** - -Extracts all the available mitigations STIX objects in the Mobile ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.CourseOfAction objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile_mitigations = lift.get_mobile_mitigations() ->>> type(mobile_mitigations) - ->>> ->>> type(mobile_mitigations[0]) - ->>> ->>> print(mobile_mitigations[0]) -{ - "type": "course-of-action", - "id": "course-of-action--25dc1ce8-eb55-4333-ae30-a7cb4f5894a1", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2017-10-25T14:48:53.732Z", - "modified": "2018-10-17T00:14:20.652Z", - "name": "Application Developer Guidance", - "description": "This mitigation describes any guidance or training given to developers of applications to avoid introducing security weaknesses that an adversary may be able to take advantage of.", - "external_references": [ - { - "source_name": "mitre-mobile-attack", - "url": "https://attack.mitre.org/mitigations/M1013", - "external_id": "M1013" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_old_attack_id": "MOB-M1013", - "x_mitre_version": "1.0" -} - -get_mobile_groups -################# - -get_mobile_groups(self, stix_format=True) -***************************************** - -Extracts all the available groups STIX objects in the Mobile ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.IntrusionSet objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile_groups = lift.get_mobile_groups() ->>> type(mobile_groups) - ->>> ->>> type(mobile_groups[0]) - ->>> ->>> print(mobile_groups[0]) -{ - "type": "intrusion-set", - "id": "intrusion-set--bef4c620-0787-42a8-a96d-b7eb6e85917c", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2017-05-31T21:31:48.664Z", - "modified": "2019-04-29T18:16:13.040Z", - "name": "APT28", - "description": "[APT28](https://attack.mitre.org/groups/G0007) is a threat group that has been attributed to Russia's Main Intelligence Directorate of the Russian General Staff by a July 2018 U.S. Department of Justice indictment. This group reportedly compromised the Hillary Clinton campaign, the Democratic National Committee, and the Democratic Congressional Campaign Committee in 2016 in an attempt to interfere with the U.S. presidential election. [APT28](https://attack.mitre.org/groups/G0007) has been active since at least January 2007.(Citation: DOJ GRU Indictment Jul 2018) (Citation: Ars Technica GRU indictment Jul 2018) (Citation: Crowdstrike DNC June 2016) (Citation: FireEye APT28) (Citation: SecureWorks TG-4127) (Citation: FireEye APT28 January 2017) (Citation: GRIZZLY STEPPE JAR) (Citation: Sofacy DealersChoice) (Citation: Palo Alto Sofacy 06-2018) (Citation: Symantec APT28 Oct 2018)", - "aliases": [ - "APT28", - "SNAKEMACKEREL", - "Swallowtail", - "Group 74", - "Sednit", - "Sofacy", - "Pawn Storm", - "Fancy Bear", - "STRONTIUM", - "Tsar Team", - "Threat Group-4127", - "TG-4127" - ], - "external_references": [ - { - "source_name": "mitre-attack", - "url": "https://attack.mitre.org/groups/G0007", - "external_id": "G0007" - }, - { - "source_name": "APT28", - "description": "(Citation: FireEye APT28) (Citation: SecureWorks TG-4127) (Citation: Crowdstrike DNC June 2016) (Citation: Kaspersky Sofacy) (Citation: ESET Sednit Part 3) (Citation: Ars Technica GRU indictment Jul 2018)(Citation: Talos Seduploader Oct 2017)(Citation: Symantec APT28 Oct 2018)(Citation: Securelist Sofacy Feb 2018)" - }, - { - "source_name": "SNAKEMACKEREL", - "description": "(Citation: Accenture SNAKEMACKEREL Nov 2019)" - }, - { - "source_name": "Swallowtail", - "description": "(Citation: Symantec APT28 Oct 2018)" - }, - { - "source_name": "Group 74", - "description": "(Citation: Talos Seduploader Oct 2017)" - }, - { - "source_name": "Sednit", - "description": "This designation has been used in reporting both to refer to the threat group and its associated malware JHUHUGIT. (Citation: FireEye APT28 January 2017) (Citation: SecureWorks TG-4127) (Citation: Kaspersky Sofacy) (Citation: Ars Technica GRU indictment Jul 2018)" - }, - { - "source_name": "Sofacy", - "description": "This designation has been used in reporting both to refer to the threat group and its associated malware. (Citation: FireEye APT28) (Citation: SecureWorks TG-4127) (Citation: Crowdstrike DNC June 2016) (Citation: ESET Sednit Part 3) (Citation: Ars Technica GRU indictment Jul 2018)(Citation: Talos Seduploader Oct 2017)" - }, - { - "source_name": "Pawn Storm", - "description": "(Citation: SecureWorks TG-4127) (Citation: ESET Sednit Part 3)" - }, - { - "source_name": "Fancy Bear", - "description": "(Citation: Crowdstrike DNC June 2016) (Citation: Kaspersky Sofacy) (Citation: ESET Sednit Part 3) (Citation: Ars Technica GRU indictment Jul 2018)(Citation: Talos Seduploader Oct 2017)(Citation: Symantec APT28 Oct 2018)(Citation: Securelist Sofacy Feb 2018)" - }, - { - "source_name": "STRONTIUM", - "description": "(Citation: Kaspersky Sofacy) (Citation: ESET Sednit Part 3)" - }, - { - "source_name": "Tsar Team", - "description": "(Citation: ESET Sednit Part 3)(Citation: Talos Seduploader Oct 2017)(Citation: Talos Seduploader Oct 2017)" - }, - { - "source_name": "Threat Group-4127", - "description": "(Citation: SecureWorks TG-4127)" - }, - { - "source_name": "TG-4127", - "description": "(Citation: SecureWorks TG-4127)" - }, - { - "source_name": "DOJ GRU Indictment Jul 2018", - "description": "Mueller, R. (2018, July 13). Indictment - United States of America vs. VIKTOR BORISOVICH NETYKSHO, et al. Retrieved September 13, 2018.", - "url": "https://www.justice.gov/file/1080281/download" - }, - { - "source_name": "Ars Technica GRU indictment Jul 2018", - "description": "Gallagher, S. (2018, July 27). How they did it (and will likely try again): GRU hackers vs. US elections. Retrieved September 13, 2018.", - "url": "https://arstechnica.com/information-technology/2018/07/from-bitly-to-x-agent-how-gru-hackers-targeted-the-2016-presidential-election/" - }, - { - "source_name": "Crowdstrike DNC June 2016", - "description": "Alperovitch, D.. (2016, June 15). Bears in the Midst: Intrusion into the Democratic National Committee. Retrieved August 3, 2016.", - "url": "https://www.crowdstrike.com/blog/bears-midst-intrusion-democratic-national-committee/" - }, - { - "source_name": "FireEye APT28", - "description": "FireEye. (2015). APT28: A WINDOW INTO RUSSIA\u2019S CYBER ESPIONAGE OPERATIONS?. Retrieved August 19, 2015.", - "url": "https://www.fireeye.com/content/dam/fireeye-www/global/en/current-threats/pdfs/rpt-apt28.pdf" - }, - { - "source_name": "SecureWorks TG-4127", - "description": "SecureWorks Counter Threat Unit Threat Intelligence. (2016, June 16). Threat Group-4127 Targets Hillary Clinton Presidential Campaign. Retrieved August 3, 2016.", - "url": "https://www.secureworks.com/research/threat-group-4127-targets-hillary-clinton-presidential-campaign" - }, - { - "source_name": "FireEye APT28 January 2017", - "description": "FireEye iSIGHT Intelligence. (2017, January 11). APT28: At the Center of the Storm. Retrieved January 11, 2017.", - "url": "https://www2.fireeye.com/rs/848-DID-242/images/APT28-Center-of-Storm-2017.pdf" - }, - { - "source_name": "GRIZZLY STEPPE JAR", - "description": "Department of Homeland Security and Federal Bureau of Investigation. (2016, December 29). GRIZZLY STEPPE \u2013 Russian Malicious Cyber Activity. Retrieved January 11, 2017.", - "url": "https://www.us-cert.gov/sites/default/files/publications/JAR_16-20296A_GRIZZLY%20STEPPE-2016-1229.pdf" - }, - { - "source_name": "Sofacy DealersChoice", - "description": "Falcone, R. (2018, March 15). Sofacy Uses DealersChoice to Target European Government Agency. Retrieved June 4, 2018.", - "url": "https://researchcenter.paloaltonetworks.com/2018/03/unit42-sofacy-uses-dealerschoice-target-european-government-agency/" - }, - { - "source_name": "Palo Alto Sofacy 06-2018", - "description": "Lee, B., Falcone, R. (2018, June 06). Sofacy Group\u2019s Parallel Attacks. Retrieved June 18, 2018.", - "url": "https://researchcenter.paloaltonetworks.com/2018/06/unit42-sofacy-groups-parallel-attacks/" - }, - { - "source_name": "Symantec APT28 Oct 2018", - "description": "Symantec Security Response. (2018, October 04). APT28: New Espionage Operations Target Military and Government Organizations. Retrieved November 14, 2018.", - "url": "https://www.symantec.com/blogs/election-security/apt28-espionage-military-government" - }, - { - "source_name": "Kaspersky Sofacy", - "description": "Kaspersky Lab's Global Research and Analysis Team. (2015, December 4). Sofacy APT hits high profile targets with updated toolset. Retrieved December 10, 2015.", - "url": "https://securelist.com/sofacy-apt-hits-high-profile-targets-with-updated-toolset/72924/" - }, - { - "source_name": "ESET Sednit Part 3", - "description": "ESET. (2016, October). En Route with Sednit - Part 3: A Mysterious Downloader. Retrieved November 21, 2016.", - "url": "http://www.welivesecurity.com/wp-content/uploads/2016/10/eset-sednit-part3.pdf" - }, - { - "source_name": "Talos Seduploader Oct 2017", - "description": "Mercer, W., et al. (2017, October 22). \"Cyber Conflict\" Decoy Document Used in Real Cyber Conflict. Retrieved November 2, 2018.", - "url": "https://blog.talosintelligence.com/2017/10/cyber-conflict-decoy-document.html" - }, - { - "source_name": "Securelist Sofacy Feb 2018", - "description": "Kaspersky Lab's Global Research & Analysis Team. (2018, February 20). A Slice of 2017 Sofacy Activity. Retrieved November 27, 2018.", - "url": "https://securelist.com/a-slice-of-2017-sofacy-activity/83930/" - }, - { - "source_name": "Accenture SNAKEMACKEREL Nov 2019", - "description": "Accenture Security. (2019, November 29). SNAKEMACKEREL. Retrieved April 15, 2019.", - "url": "https://www.accenture.com/t20181129T203820Z__w__/us-en/_acnmedia/PDF-90/Accenture-snakemackerel-delivers-zekapab-malware.pdf#zoom=50" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_contributors": [ - "Emily Ratliff, IBM", - "Richard Gold, Digital Shadows" - ], - "x_mitre_version": "2.0" -} - -get_mobile_malware -################## - -get_mobile_malware(self, stix_format=True) -****************************************** - -Extracts all the available malware STIX objects in the Mobile ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.Malware objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile_malware = lift.get_mobile_malware() ->>> type(mobile_malware) - ->>> ->>> type(mobile_malware[0]) - ->>> ->>> print(mobile_malware[0]) -{ - "type": "malware", - "id": "malware--08784a9d-09e9-4dce-a839-9612398214e8", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2018-10-17T00:14:20.652Z", - "modified": "2018-12-11T20:40:31.461Z", - "name": "Allwinner", - "description": "[Allwinner](https://attack.mitre.org/software/S0319) is a company that supplies processors used in Android tablets and other devices. A Linux kernel distributed by [Allwinner](https://attack.mitre.org/software/S0319) for use on these devices reportedly contained a backdoor. (Citation: HackerNews-Allwinner)", - "labels": [ - "malware" - ], - "external_references": [ - { - "source_name": "mitre-mobile-attack", - "url": "https://attack.mitre.org/software/S0319", - "external_id": "S0319" - }, - { - "source_name": "Allwinner", - "description": "(Citation: HackerNews-Allwinner)" - }, - { - "source_name": "HackerNews-Allwinner", - "description": "Mohit Kumar. (2016, May 11). Kernel Backdoor found in Gadgets Powered by Popular Chinese ARM Maker. Retrieved September 18, 2018.", - "url": "https://thehackernews.com/2016/05/android-kernal-exploit.html" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_aliases": [ - "Allwinner" - ], - "x_mitre_old_attack_id": "MOB-S0035", - "x_mitre_platforms": [ - "Android" - ], - "x_mitre_version": "1.1" -} - -get_mobile_tools -################ - -get_mobile_tools(self, stix_format=True) -**************************************** - -Extracts all the available tools STIX objects in the Mobile ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sdo.Tool objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile_tools = lift.get_mobile_tools() ->>> type(mobile_tools) - ->>> ->>> type(mobile_tools[0]) - ->>> ->>> print(mobile_tools[0]) -{ - "type": "tool", - "id": "tool--da21929e-40c0-443d-bdf4-6b60d15448b4", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2017-10-25T14:48:48.609Z", - "modified": "2018-12-11T20:40:31.461Z", - "name": "Xbot", - "description": "[Xbot](https://attack.mitre.org/software/S0298) is an Android malware family that was observed in 2016 primarily targeting Android users in Russia and Australia. (Citation: PaloAlto-Xbot)", - "labels": [ - "tool" - ], - "external_references": [ - { - "source_name": "mitre-mobile-attack", - "url": "https://attack.mitre.org/software/S0298", - "external_id": "S0298" - }, - { - "source_name": "Xbot", - "description": "(Citation: PaloAlto-Xbot)" - }, - { - "source_name": "PaloAlto-Xbot", - "description": "Cong Zheng, Claud Xiao and Zhi Xu. (2016, February 18). New Android Trojan \u201cXbot\u201d Phishes Credit Cards and Bank Accounts, Encrypts Devices for Ransom. Retrieved December 21, 2016.", - "url": "http://researchcenter.paloaltonetworks.com/2016/02/new-android-trojan-xbot-phishes-credit-cards-and-bank-accounts-encrypts-devices-for-ransom/" - } - ], - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ], - "x_mitre_aliases": [ - "Xbot" - ], - "x_mitre_old_attack_id": "MOB-S0014", - "x_mitre_platforms": [ - "Android" - ], - "x_mitre_version": "1.1" -} - -get_mobile_relationships -######################## - -get_mobile_relationships(self, stix_format=True) -************************************************ - -Extracts all the available relationships STIX objects in the Mobile ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of stix2.v20.sro.Relationship objects - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile_relationships = lift.get_mobile_relationships() ->>> type(mobile_relationships) - ->>> ->>> type(mobile_relationships[0]) - ->>> ->>> print(mobile_relationships[0]) -{ - "type": "relationship", - "id": "relationship--6186ed87-69a1-43e7-bb60-76527d287e31", - "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", - "created": "2019-04-29T19:35:31.074Z", - "modified": "2019-04-29T19:35:31.074Z", - "relationship_type": "revoked-by", - "source_ref": "attack-pattern--0bcc4ec1-a897-49a9-a9ff-c00df1d1209d", - "target_ref": "attack-pattern--2d646840-f6f5-4619-a5a8-29c8316bbac5", - "object_marking_refs": [ - "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" - ] -} - -get_mobile_tactics -################## - -get_mobile_tactics(self, stix_format=True) -****************************************** - -Extracts all the available tactics STIX objects in the Mobile ATT&CK matrix - -Parameters: - - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List of dictionaries - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> mobile_tactics = lift.get_mobile_tactics() ->>> type(mobile_tactics) - ->>> ->>> type(mobile_tactics[0]) - ->>> ->>> print(mobile_tactics[0]) -{'external_references': [{'external_id': 'TA0030', 'source_name': 'mitre-attack', 'url': 'https://attack.mitre.org/tactics/TA0030'}], 'object_marking_refs': ['marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168'], 'id': 'x-mitre-tactic--987cda6d-eb77-406b-bf68-bcb5f3d2e1df', 'name': 'Defense Evasion', 'created': '2018-10-17T00:14:20.652Z', 'modified': '2018-10-17T00:14:20.652Z', 'type': 'x-mitre-tactic', 'created_by_ref': 'identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5', 'description': 'Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. Sometimes these actions are the same as or variations of techniques in other categories that have the added benefit of subverting a particular defense or mitigation. Defense evasion may be considered a set of attributes the adversary applies to all other phases of the operation.', 'x_mitre_shortname': 'defense-evasion'} - -get_data_sources -################ - -get_data_sources(self) -********************** - -Extracts all data sources mapped to techniques across all matrices. - -Returns: List - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() ->>> ->>> lift.get_data_sources() -['Process command-line parameters', 'Process monitoring', 'File monitoring', 'SSL/TLS inspection', -'Web logs', 'Web application firewall logs', 'Network intrusion detection system', 'Network protocol analysis', -'Network device logs', 'Netflow/Enclave netflow', 'Sensor health and status', 'Process use of network', -'BIOS', 'Component firmware', 'Packet capture', 'Application logs', 'Windows Registry', 'Services', -'Windows event logs', 'API monitoring', 'Kernel drivers', 'MBR', 'DNS records', 'PowerShell logs', -'Anti-virus', 'Email gateway', 'DLL monitoring', 'Authentication logs', 'Web proxy', 'Windows Error Reporting', -'System calls', 'Data loss prevention', 'Third-party application logs', 'Binary file metadata', -'Asset management', 'Detonation chamber', 'Mail server', 'Loaded DLLs', 'Browser extensions', -'Access tokens', 'Environment variable', 'User interface', 'Malware reverse engineering', -'Digital certificate logs', 'Disk forensics', 'Host network interface', 'WMI Objects', 'VBR', 'Named Pipes', 'EFI'] - -get_techniques_by_datasources -############################# - -get_techniques_by_datasources(self, *args, stix_format=True) -************************************************************ - -Extracts all techniques mapped to one or multiple data sources. - -Parameters: - - * ``*args``: one or more data sources ("datasource1", "datsasource2") - * ``stix_format``: returns results in original STIX format or friendly syntax ('attack-pattern' or 'technique') - -Returns: List - -Examples -******** - ->>> from attackcti import attack_client ->>> lift = attack_client() - ->>> techniques = lift.get_techniques_by_datasources("windows event logs") ->>> len(techniques) -22 ->>> for t in techniques: -... print(t['name'],t['x_mitre_data_sources']) -... -Inhibit System Recovery ['Windows Registry', 'Services', 'Windows event logs', 'Process command-line parameters', 'Process monitoring'] -Group Policy Modification ['Windows event logs'] -File Permissions Modification ['File monitoring', 'Process monitoring', 'Process command-line parameters', 'Windows event logs'] -BITS Jobs ['API monitoring', 'Packet capture', 'Windows event logs'] -CMSTP ['Process monitoring', 'Process command-line parameters', 'Process use of network', 'Windows event logs'] -Control Panel Items ['API monitoring', 'Binary file metadata', 'DLL monitoring', 'Windows Registry', 'Windows event logs', 'Process command-line parameters', 'Process monitoring'] -Indirect Command Execution ['File monitoring', 'Process monitoring', 'Process command-line parameters', 'Windows event logs'] -Kerberoasting ['Windows event logs'] -SIP and Trust Provider Hijacking ['API monitoring', 'Application logs', 'DLL monitoring', 'Loaded DLLs', 'Process monitoring', 'Windows Registry', 'Windows event logs'] -Distributed Component Object Model ['API monitoring', 'Authentication logs', 'DLL monitoring', 'Packet capture', 'Process monitoring', 'Windows Registry', 'Windows event logs'] -Dynamic Data Exchange ['API monitoring', 'DLL monitoring', 'Process monitoring', 'Windows Registry', 'Windows event logs'] -Hooking ['API monitoring', 'Binary file metadata', 'DLL monitoring', 'Loaded DLLs', 'Process monitoring', 'Windows event logs'] -Image File Execution Options Injection ['Process monitoring', 'Windows Registry', 'Windows event logs'] -LLMNR/NBT-NS Poisoning and Relay ['Windows event logs', 'Windows Registry', 'Packet capture', 'Netflow/Enclave netflow'] -SID-History Injection ['API monitoring', 'Authentication logs', 'Windows event logs'] -Create Account ['Process monitoring', 'Process command-line parameters', 'Authentication logs', 'Windows event logs'] -Modify Registry ['Windows Registry', 'File monitoring', 'Process monitoring', 'Process command-line parameters', 'Windows event logs'] -Account Manipulation ['Authentication logs', 'API monitoring', 'Windows event logs', 'Packet capture'] -Indicator Removal on Host ['File monitoring', 'Process monitoring', 'Process command-line parameters', 'API monitoring', 'Windows event logs'] -Scheduled Task ['File monitoring', 'Process monitoring', 'Process command-line parameters', 'Windows event logs'] -New Service ['Windows Registry', 'Process monitoring', 'Process command-line parameters', 'Windows event logs'] -Obfuscated Files or Information ['Network protocol analysis', 'Process use of network', 'File monitoring', -'Malware reverse engineering', 'Binary file metadata', 'Process command-line parameters', 'Environment variable', -'Process monitoring', 'Windows event logs', 'Network intrusion detection system', 'Email gateway', 'SSL/TLS inspection'] \ No newline at end of file +.. automodule:: attack_api + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/attackcti_overview.rst b/docs/source/attackcti_overview.rst index 80c505e..d496c6a 100644 --- a/docs/source/attackcti_overview.rst +++ b/docs/source/attackcti_overview.rst @@ -160,4 +160,4 @@ Notebooks I put together a few Jupyte notebooks for you to learn a little bit more about a few of the functions available in the ``attackcti`` library: -* `Notebooks `_ \ No newline at end of file +* `Notebooks `_ \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 8c2a62e..0993250 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,9 +12,9 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) +import os +import sys +sys.path.insert(0, os.path.abspath('../../attackcti')) # -- Project information ----------------------------------------------------- @@ -38,8 +38,21 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [ +extensions = ['sphinx.ext.napoleon' ] +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_init_with_doc = False +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True +napoleon_type_aliases = None # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -85,7 +98,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/docs/source/index.rst b/docs/source/index.rst index 7ef0be0..ad3ad0c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,8 +3,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to ATTACK-Python-Client's documentation! -================================================ +ATTACK-Python-Client's documentation! +===================================== A Python module to access up to date ATT&CK content available in STIX format via its public TAXII server. This project leverages the python classes and functions of the `cti-python-stix2 `_ and `cti-taxii-client `_ libraries developed by MITRE. @@ -18,13 +18,11 @@ Goals * Help security analysts during the transition from the ATT&CK MediaWiki API to the STIX/TAXII 2.0 API * Learn STIX2 and TAXII Client Python libraries -.. toctree:: - :maxdepth: 2 - :caption: OASIS CTI TC +Updates +******* + +* 11/23/2020 - Added ICS ATT&CK functionality (PRE-ATTACK is deprecated but still available through the library to not break current deployments that leverage it) - OASIS Overview - CTI TAXII Client - CTI STIX .. toctree:: :maxdepth: 2 @@ -32,9 +30,17 @@ Goals Overview Functions + +.. toctree:: + :maxdepth: 2 + :caption: OASIS CTI TC + + OASIS Overview + CTI TAXII Client + CTI STIX .. toctree:: :maxdepth: 2 :caption: Licenses: - GNU General Public License V3 \ No newline at end of file + BSD 3-Clause License \ No newline at end of file diff --git a/docs/source/license.rst b/docs/source/license.rst index f61788b..812bc1e 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -1,676 +1,32 @@ Licenses ======== - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. +BSD 3-Clause License - Preamble +Copyright (c) 2020, Roberto Rodriguez +All rights reserved. - The GNU General Public License is a free, copyleft license for -software and other kinds of works. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/docs/source/stix.rst b/docs/source/stix.rst index 9101a51..a3ccce5 100644 --- a/docs/source/stix.rst +++ b/docs/source/stix.rst @@ -78,7 +78,7 @@ ATT&CK users can use the taxii client and stix libraries together to reference s .. code-block:: python >>> from stix2 import TAXIICollectionSource, Filter - >>> from taxii2client import Collection + >>> from taxii2client.v20 import Collection >>> ATTCK_STIX_COLLECTIONS = "https://cti-taxii.mitre.org/stix/collections/" >>> ENTERPRISE_ATTCK = "95ecc380-afe9-11e4-9b6c-751b66dd541e" diff --git a/docs/source/taxii_client.rst b/docs/source/taxii_client.rst index b0c64f9..0e63646 100644 --- a/docs/source/taxii_client.rst +++ b/docs/source/taxii_client.rst @@ -32,7 +32,7 @@ ATT&CK users can use the initial ``Server`` class to instantiate a server object .. code-block:: python - >>> from taxii2client import Server + >>> from taxii2client.v20 import Server >>> server = Server("https://cti-taxii.mitre.org/taxii/") The server variable can then be used to access initial metadata about the ATT&CK TAXII server: @@ -125,7 +125,7 @@ We can then use the ``Collection`` class to instantiate TAXII2 Collection object .. code-block:: python - >>> from taxii2client import Collection + >>> from taxii2client.v20 import Collection >>> ENTERPRISE_COLLECTION = Collection(api_root.collections[0].url) >>> PRE_COLLECTION = Collection(api_root.collections[1].url) diff --git a/requirements.txt b/requirements.txt index d9e30e4..e9d784e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -stix2 -taxii2-client +stix2>=2.1.0 +taxii2-client>=2.2.2 six>=1.15.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 52458a0..8b8a301 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -# ATTCK TAXII Client PIP Setup script -# Author: Roberto Rodriguez (@Cyb3rWard0g) +# ATTACK TAXII Client PIP Setup script +# Author: Roberto Rodriguez (@Cyb3rWard0g) Open Threat Research (OTR) # License: BSD 3-Clause # Reference: # https://packaging.python.org/tutorials/packaging-projects/ @@ -13,13 +13,13 @@ setuptools.setup( name="attackcti", - version="0.3.3", + version="0.3.4", author="Roberto Rodriguez", description="ATTACK CTI Libary", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/hunters-forge/ATTACK-Python-Client", - keywords="threat hunting dfir cti cyber threat intelligence", + url="https://github.com/OTRF/ATTACK-Python-Client", + keywords="threat hunting dfir cti cyber threat intelligence mitre att&ck", packages=setuptools.find_packages(), install_requires=[ 'stix2', @@ -27,7 +27,7 @@ ], license='BSD', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Operating System :: OS Independent', 'Topic :: Security', 'License :: OSI Approved :: BSD License', @@ -37,5 +37,6 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', ], ) \ No newline at end of file From 812bcdd2d6627477c93e638c4b546201e3811da9 Mon Sep 17 00:00:00 2001 From: Roberto Rodriguez Date: Mon, 23 Nov 2020 23:37:29 -0500 Subject: [PATCH 3/3] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b20b9e0..2b0974d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN adduser --disabled-password \ --gecos "Default user" \ --uid ${NB_UID} \ ${NB_USER} \ - && python3 -m pip install --upgrade attackcti==0.3.1 pandas==0.25.2 altair vega + && python3 -m pip install --upgrade attackcti==0.3.4 pandas==1.1.4 altair vega COPY notebooks/ ${HOME}