-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from tendai-zw/master
maltego-trx 1.3.8: Added overlay and genealogy functionality, automatic translation of legacy property names
- Loading branch information
Showing
18 changed files
with
384 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from maltego_trx.entities import Phrase | ||
from maltego_trx.overlays import OverlayPosition, OverlayType | ||
|
||
from maltego_trx.transform import DiscoverableTransform | ||
|
||
|
||
class OverlayExample(DiscoverableTransform): | ||
""" | ||
Returns a phrase with overlays on the graph. | ||
""" | ||
|
||
@classmethod | ||
def create_entities(cls, request, response): | ||
person_name = request.Value | ||
entity = response.addEntity(Phrase, "Hi %s, nice to meet you!" % person_name) | ||
|
||
# Normally, when we create an overlay, we would reference a property name so that Maltego can then use the | ||
# value of that property to create the overlay. Sometimes that means creating a dynamic property, but usually | ||
# it's better to either use an existing property, or, if you created the Entity yourself, and only need the | ||
# property for the overlay, to use a hidden property. Here's an example of using a dynamic property: | ||
entity.addProperty('dynamic_overlay_icon_name', displayName="Name for overlay image", value="Champion") | ||
entity.addOverlay('dynamic_overlay_icon_name', OverlayPosition.WEST, OverlayType.IMAGE) | ||
|
||
# DISCOURAGED: | ||
# You *can* also directly supply the string value of the property, however this is not recommended. Why? If | ||
# the entity already has a property of the same ID (in this case, "DE"), then you would in fact be assigning the | ||
# value of that property, not the string "DE", which is not the intention. Nevertheless, here's an example: | ||
entity.addOverlay('DE', OverlayPosition.SOUTH_WEST, OverlayType.IMAGE) | ||
|
||
# Overlays can also be used to display extra text on an entity: | ||
entity.addProperty("exampleDynamicPropertyName", "Example Dynamic Property", "loose", "Maltego Overlay Testing") | ||
entity.addOverlay('exampleDynamicPropertyName', OverlayPosition.NORTH, OverlayType.TEXT) | ||
|
||
# Or a small color indicator: | ||
entity.addOverlay('#45e06f', OverlayPosition.NORTH_WEST, OverlayType.COLOUR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: '3' | ||
services: | ||
python: | ||
build: . | ||
command: "gunicorn --certfile=server.crt --keyfile=server.key --bind=0.0.0.0:8443 --threads=25 --workers=2 project:app" | ||
ports: | ||
- "8443:8443" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: '3' | ||
services: | ||
python: | ||
build: .. | ||
build: . | ||
command: "gunicorn --bind=0.0.0.0:8080 --threads=25 --workers=2 project:app" | ||
ports: | ||
- "8080:8080" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
maltego-trx | ||
maltego-trx>=1.3.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from maltego_trx.entities import Phrase | ||
from maltego_trx.overlays import OverlayPosition, OverlayType | ||
|
||
from maltego_trx.transform import DiscoverableTransform | ||
|
||
|
||
class OverlayExample(DiscoverableTransform): | ||
""" | ||
Returns a phrase with overlays on the graph. | ||
""" | ||
|
||
@classmethod | ||
def create_entities(cls, request, response): | ||
person_name = request.Value | ||
entity = response.addEntity(Phrase, "Hi %s, nice to meet you!" % person_name) | ||
|
||
# Normally, when we create an overlay, we would reference a property name so that Maltego can then use the | ||
# value of that property to create the overlay. Sometimes that means creating a dynamic property, but usually | ||
# it's better to either use an existing property, or, if you created the Entity yourself, and only need the | ||
# property for the overlay, to use a hidden property. Here's an example of using a dynamic property: | ||
entity.addProperty('dynamic_overlay_icon_name', displayName="Name for overlay image", value="Champion") | ||
entity.addOverlay('dynamic_overlay_icon_name', OverlayPosition.WEST, OverlayType.IMAGE) | ||
|
||
# DISCOURAGED: | ||
# You *can* also directly supply the string value of the property, however this is not recommended. Why? If | ||
# the entity already has a property of the same ID (in this case, "DE"), then you would in fact be assigning the | ||
# value of that property, not the string "DE", which is not the intention. Nevertheless, here's an example: | ||
entity.addOverlay('DE', OverlayPosition.SOUTH_WEST, OverlayType.IMAGE) | ||
|
||
# Overlays can also be used to display extra text on an entity: | ||
entity.addProperty("exampleDynamicPropertyName", "Example Dynamic Property", "loose", "Maltego Overlay Testing") | ||
entity.addOverlay('exampleDynamicPropertyName', OverlayPosition.NORTH, OverlayType.TEXT) | ||
|
||
# Or a small color indicator: | ||
entity.addOverlay('#45e06f', OverlayPosition.NORTH_WEST, OverlayType.COLOUR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = "1.3.7" | ||
VERSION = "1.3.8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.