Skip to content

Transform Code Structure

maxlandon edited this page Mar 9, 2019 · 1 revision

Transforms are stored in Python files, and these Python files themselves are organized in a directory tree that follows this structure:

  • Each Tool has its own transform directory (eg. metasploit/ for Metasploit)
  • Each Tool component has its own directory (eg. db/ for Database, rpc/ for rpc related transforms...)
  • Each big Entity Type (Host, IPv4Address, Service, Credential, etc) has its own directory.
  • In each big Entity directory, there are Subtypes (Base Hosts/Services/Credentials, Web/SSH services, Windows hosts, and many others). This structure mimics the Entity inheritance in the Maltego Client.
  • In each Tool component directory, each functional domain has its own Python module. (eg. enumerate.py for all enumeration transforms, update.py for all update transforms, etc...) (This rule might not always be perfectly enforced)

An example of this directory structure is the following, presented as a Python import (sometimes used like this):

   from EffectiveCouscous.transforms.metasploit.db.host.base.enumerate import EnumerateHostIPs

Here:

  • EffectiveCouscous.transforms is the directory containing all project transforms.
  • metasploit contains all transforms related to Metasploit.
  • db is the component directory.
  • host is the main Entity directory.
  • base is the Entity subtype directory.
  • enumerate is the Python module regrouping all enumeration transforms using Host as input.

You might have noticed that this directory structure is also supposed to mimic the Transform Categorization rules presented in the Transforms List.