How to use the pyattck.actor.AttckActor function in pyattck

To help you get started, we’ve selected a few pyattck examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swimlane / pyattck / pyattck / tools.py View on Github external
def actors(self):
        '''Returns all actor objects as a list that are documented to use this tool'''
        from .actor import AttckActor
        actor_list = []
        for item in self.attck_obj['objects']:
            if 'relationship_type' in item:
                if 'uses' in item['relationship_type']:
                    if self.stix in item['target_ref']:
                        if 'intrusion-set' in item['source_ref']:
                            for o in self.attck_obj['objects']:
                                if item['source_ref'] in o['id']:
                                    actor_list.append(AttckActor(**o))
        return actor_list
github swimlane / pyattck / pyattck / pyattck.py View on Github external
def actors(self):
        """Creates AttckActor objects
        
        Returns:
            (AttckActor) -- (Returns a list of AttckActor objects)
        """
        group_list = []
        for group in self.attck['objects']:
            if group['type'] == 'intrusion-set':
                group_list.append(AttckActor(attck_obj=self.attck, **group))
        return group_list
github swimlane / pyattck / pyattck / technique.py View on Github external
def actors(self):
        '''Returns all actor objects that have been identified as using this technique'''
        from .actor import AttckActor
        actor_list = []
        for item in self.attck_obj['objects']:
            if 'relationship_type' in item:
                if 'uses' in item['relationship_type']:
                    if self.stix in item['target_ref']:
                        if 'intrusion-set' in item['source_ref']:
                            for o in self.attck_obj['objects']:
                                if item['source_ref'] in o['id']:
                                    actor_list.append(AttckActor(**o))
        return actor_list
github swimlane / pyattck / pyattck / actor.py View on Github external
def __init__(self, attck_obj = None, **kwargs):

        self.attck_obj = attck_obj

        self.id = super(AttckActor, self)._set_id(kwargs)
        self.created_by_ref = super(AttckActor, self)._set_attribute(kwargs, 'created_by_ref')
        self.revoked = super(AttckActor, self)._set_attribute(kwargs, 'revoked')
        self.name = super(AttckActor, self)._set_attribute(kwargs, 'name')
        self.aliases = super(AttckActor, self)._set_list_items(kwargs, 'aliases')
        self.description = super(AttckActor, self)._set_attribute(kwargs, 'description')
        self.external_reference = super(AttckActor, self)._set_reference(kwargs)
        self.created = super(AttckActor, self)._set_attribute(kwargs, 'created')
        self.modified = super(AttckActor, self)._set_attribute(kwargs, 'modified')
        self.stix = super(AttckActor, self)._set_attribute(kwargs, 'id')
        self.type = super(AttckActor, self)._set_attribute(kwargs, 'type')
        self.wiki = super(AttckActor, self)._set_wiki(kwargs)
        self.contributor = super(AttckActor, self)._set_list_items(kwargs, 'x_mitre_contributors')
github swimlane / pyattck / pyattck / malware.py View on Github external
def actors(self):
        '''Returns all actor objects as a list that are documented as using this malware'''
        from .actor import AttckActor
        actor_list = []
        for item in self.attck_obj['objects']:
            if 'source_ref' in item:
                if self.stix in item['target_ref']:
                    for o in self.attck_obj['objects']:
                        if item['source_ref'] in o['id']:
                            actor_list.append(AttckActor(**o))
        return actor_list

pyattck

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

MIT
Latest version published 1 year ago

Package Health Score

47 / 100
Full package analysis