Ejemplo n.º 1
0
class InputConstraint(MaltegoElement):
    class meta:
        tagname = 'Entity'

    type = fields_.String()
    min = fields_.Integer(default=1)
    max = fields_.Integer(default=1)
Ejemplo n.º 2
0
class _Entity(MaltegoElement):
    class meta:
        tagname = 'Entity'

    type = fields_.String(attrname='Type')
    fields = fields_.Dict(Field,
                          key='name',
                          tagname='AdditionalFields',
                          required=False)
    labels = fields_.Dict(Label,
                          key='name',
                          tagname='DisplayInformation',
                          required=False)
    value = fields_.String(tagname='Value')
    weight = fields_.Integer(tagname='Weight', default=1)
    iconurl = fields_.String(tagname='IconURL', required=False)

    def appendelement(self, other):
        if isinstance(other, Field):
            self.fields.append(other)
        elif isinstance(other, Label):
            self.labels.append(other)

    def removeelement(self, other):
        if isinstance(other, Field):
            self.fields.remove(other)
        elif isinstance(other, Label):
            self.labels.remove(other)
Ejemplo n.º 3
0
class MaltegoTransform(MaltegoElement):

    name = fields_.String()
    displayname = fields_.String(attrname='displayName', default='')
    abstract = fields_.String(default=False)
    template = fields_.Boolean(default=False)
    visibility = fields_.String(default=VisibilityType.Public)
    description = fields_.String(default='')
    helpurl = fields_.String(attrname='helpURL', default='')
    author = fields_.String(default='')
    owner = fields_.String(default='')
    locrel = fields_.String(attrname='locationRelevance', default='global')
    version = fields_.String(default='1.0')
    requireinfo = fields_.Boolean(default=False, attrname='requireDisplayInfo')
    adapter = fields_.String(tagname='TransformAdapter',
                             default=TransformAdapter.Local)
    properties = fields_.Model(Properties)
    input = fields_.List(InputConstraint,
                         tagname='InputConstraints',
                         required=False)
    output = fields_.List(OutputEntity,
                          tagname='OutputEntities',
                          required=False)
    help = fields_.CDATA(tagname='Help', default='')
    disclaimer = fields_.CDATA(tagname='Disclaimer', default='')
    sets = fields_.List(Set, tagname='defaultSets')
    stealthlevel = fields_.Integer(tagname='StealthLevel', default=0)
    authenticator = fields_.String(tagname='Authenticator', required=False)

    def appendelement(self, other):
        if isinstance(other, Set):
            self.sets.append(other)
        elif isinstance(other, TransformProperty):
            self.properties.fields_.append(other)
        elif isinstance(other, InputConstraint) or isinstance(
                other, InputEntity):
            self.input.append(other)
        elif isinstance(other, OutputEntity):
            self.output.append(other)

    def removeelement(self, other):
        if isinstance(other, Set):
            self.sets.remove(other)
        if isinstance(other, TransformProperty):
            self.properties.fields_.remove(other)
        elif isinstance(other, InputConstraint) or isinstance(
                other, InputEntity):
            self.input.remove(other)
        elif isinstance(other, OutputEntity):
            self.output.remove(other)
Ejemplo n.º 4
0
class MaltegoEntity(MaltegoElement):

    id = fields_.String()
    displayname = fields_.String(attrname='displayName', required=False)
    plural = fields_.String(attrname='displayNamePlural', required=False)
    description = fields_.String(default='', required=False)
    category = fields_.String(required=False)
    smallicon = fields_.String(attrname='smallIconResource', required=False)
    largeicon = fields_.String(attrname='largeIconResource', required=False)
    allowedRoot = fields_.Boolean(default=True, required=False)
    conversion_order = fields_.Integer(attrname='conversionOrder',
                                       default=2147483647,
                                       required=False)
    visible = fields_.Boolean(default=True, required=False)
    largeicontag = fields_.String(tagname='Icon', required=False)
    smallicontag = fields_.String(tagname='SmallIcon', required=False)
    converter = fields_.Model(Converter, required=False)
    properties = fields_.Model(EntityProperties, required=False)
Ejemplo n.º 5
0
class Limits(MaltegoElement):
    soft = fields_.Integer(attrname='SoftLimit', default=500)
    hard = fields_.Integer(attrname='HardLimit', default=10000)