September 06, 2010, 10:53:56 pm
Home
Help
Search
Login
Register
Maltego Forum
»
Development
»
Sample Transforms
*Simple* To Thumbshots transform
Username
1 Hour
1 Day
1 Week
1 Month
Forever
Password
Pages: [
1
]
« previous
next »
Print
Author
Topic: *Simple* To Thumbshots transform (Read 13887 times)
AndrewMacPherson
Administrator
Full Member
Posts: 107
*Simple* To Thumbshots transform
«
on:
February 11, 2009, 11:31:04 am »
Hey guys,
I see we have been fielding a few questions on irc about local transforms and i think that it stems from me jumping right in with the libraries and perhaps a very basic example would be a better start for first time transform writers.
Subsequently herewith is the Thumbshots transform in a very basic python script:
Code:
#!/usr/bin/python
import sys
# Get the website entity name, this will be parsed as the first parameter as according to the spec ( http://ctas.paterva.com/view/Specification )
websiteValue = sys.argv[1];
print "<MaltegoMessage>"
print "<MaltegoTransformResponseMessage>"
print "<Entities>"
print "<Entity Type=\"Website\">" # please note entites are CaSe SeNsiTiVe
print "<Value>" + websiteValue + "</Value>"
print "<Weight>100</Weight>"
print "<IconURL>http://open.thumbshots.org/image.pxf?url=" + websiteValue + "</IconURL>"
print "</Entity>"
print "</Entities>"
print "<UIMessages>"
print "</UIMessages>"
print "</MaltegoTransformResponseMessage>"
print "</MaltegoMessage>"
All the script does is get the value of the entity (that which you see under each icon) - in this case the website , something like "
www.paterva.com
". As per the spec this will then be the first command line parameter. We then simply return *exactly* the same entity (a Website) and change the iconURL (this is the icon for the entity) to the image returned from thumbshots.org
I hope this clears up any confusion and if there are any queries around localTransforms simply post it to the forum or try ask on the irc channel ( #Maltego on irc.freenode.org )
Adding the transform to Maltego
Click tools->Manage Transforms
Select "New Local Transform"
Fill in the Display name, Description and Author.
Set the Input Entity type (or entity type that you will run this transform on) - in this case Website
Click Next
Enter the command for the language used, in this case python, so it would be your python executable, for example c:python26python.exe or /usr/bin/python
Under the parameter enter the script that you have created with the code above
For Working directory specify the directory that you saved the script
Click finish
You can now run this transform on any website entity and have the icon be that of the thumbshots.org
p.s. I have also included the code for this transform.
thumbshots_simple.py
(0.66 KB - downloaded 652 times.)
«
Last Edit: April 14, 2009, 04:10:39 am by AndrewMohawk
»
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Discussions
-----------------------------
TDS ( Transform distribution Server )
-----------------------------
=> General
=> Code Samples
=> Support
-----------------------------
Maltego Graphs
-----------------------------
=> Interesting Graphs
-----------------------------
Announcements
-----------------------------
=> Announcements
-----------------------------
Development
-----------------------------
=> User Transforms
=> General
=> Sample Transforms
=> Local Transform Libs
=> Maltego Mesh
-----------------------------
Support
-----------------------------
=> Links
=> Help!
=> Feature Requests
Loading...