Esempio n. 1
0
def get_variations(data):
    variations = []
    if data:
        for v in data:
            if isinstance(v, Variation):
                description = v.description
                command = v.command
            else:
                description = v['description']
                command = v['command']
            variations.append(Variation.load(dict(description=description, command=command)))
    return variations
Esempio n. 2
0
 def __init__(self,
              ability_id,
              tactic=None,
              technique_id=None,
              technique=None,
              name=None,
              test=None,
              description=None,
              cleanup=None,
              executor=None,
              platform=None,
              payload=None,
              parsers=None,
              requirements=None,
              privilege=None,
              timeout=60,
              repeatable=False,
              access=None,
              variations=None):
     super().__init__()
     self._test = test
     self.ability_id = ability_id
     self.tactic = tactic
     self.technique_name = technique
     self.technique_id = technique_id
     self.name = name
     self.description = description
     self.cleanup = cleanup
     self.executor = executor
     self.platform = platform
     self.payload = payload
     self.parsers = parsers
     self.requirements = requirements
     self.privilege = privilege
     self.timeout = timeout
     self.repeatable = repeatable
     self.variations = [
         Variation(description=v['description'], command=v['command'])
         for v in variations
     ]
     if access:
         self.access = self.Access(access)