INNER CODE UNIT · Python

getUrlFromStix

mitre-attack/attack-scripts · scripts/diff_stix.py:141

    def getUrlFromStix(self, datum, is_subtechnique=False):
        """
        Parse the website url from a stix object.
        """
        url = datum['external_references'][0]['url']
        split_url = url.split('/')
        splitfrom = -3 if is_subtechnique else -2
        link = '/'.join(split_url[splitfrom:])
        return link


    def deep_copy_stix(self, objects):
        """
        Transform stix to dict and deep copy the dict.
        """
        result = []
        for obj in objects:
            obj = dict(obj)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…