Skip to content

Instantly share code, notes, and snippets.

View sroberts's full-sized avatar
:shipit:

Scott J. Roberts sroberts

:shipit:
View GitHub Profile
# This returns the transform as an XML representation that Maltego
# uses to update the graph.
trx.returnOutput()
# Import MaltegoTransform-Python library
# from MaltegoTransform import MaltegoEntity
from MaltegoTransform import MaltegoTransform
# Create a Maltego Transform Exception
trx.addException("We're out of gummy bears!!! Abort.")
# ThrowExceptions returns the errored transform.
trx.throwExceptions()
# For a 1-1 transform, so we create one location entity based
# on the geolocation data.
trx.addEntity("maltego.Location", "New York, NY")
# This can also be placed in a loop and will result in multiple entities.
locations = ["New York", "Washington DC", "San Francisco"]
for location in locations:
trx.addEntity("maltego.Location", location)