Ejemplo n.º 1
0
class Limits(MaltegoElement):
    """
    Limits specifies the soft and hard limits of the MaltegoTransformResponseMessage. The soft and hard limits specify
    the maximum number of entities for response messages.
    """
    soft = fields_.Integer(attrname='SoftLimit', default=500)
    hard = fields_.Integer(attrname='HardLimit', default=10000)
Ejemplo n.º 2
0
class InputConstraint(MaltegoElement):
    class meta:
        tagname = 'Entity'

    type = fields_.String()
    min = fields_.Integer(default=1)
    max = fields_.Integer(default=1)
Ejemplo n.º 3
0
class MaltegoException(MaltegoElement, Exception):
    """MaltegoException is the default container for exception messages."""
    class meta:
        tagname = 'Exception'

    value = fields_.String(tagname='.')
    code = fields_.Integer(attrname='code', required=False)

    def __init__(self, value):
        super(MaltegoElement, self).__init__(value=value)

    def __str__(self):
        return self.value
Ejemplo n.º 4
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)
    icon_url = fields_.String(tagname='IconURL', required=False)

    def __iadd__(self, other):
        if isinstance(other, Field):
            self.fields[other.name] = other
        elif isinstance(other, Label):
            self.labels[other.name] = other
        return self
Ejemplo n.º 5
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.º 6
0
class MaltegoTransform(MaltegoElement):
    """This is the complete MaltegoTransform element definition that is present in Maltego profiles. It defines every
    aspect of a transform including it's input entity type, transform set, template, etc."""

    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 __iadd__(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)
        return self