To create a custom Transform for Maltego in Kali Linux, follow these steps:
1. Install Required Dependencies
Ensure you have Python and the Maltego client libraries installed:
sudo apt update
sudo apt install python3 python3-pip
pip3 install maltego-trx
2. Create a New Transform Project
Use the maltego-trx framework to scaffold a new project:
maltego-trx start "MyCustomTransforms"
cd MyCustomTransforms
3. Define a Custom Transform
Edit the transforms.py file inside your project directory:
from maltego_trx.entities import Phrase
from maltego_trx.transform import DiscoverableTransform
class HelloWorldTransform(DiscoverableTransform):
@classmethod
def create_entities(cls, request, response):
input_value = request.Value
entity = response.addEntity(Phrase, f"Hello, {input_value}!")
entity.addProperty("text", "Text", "loose", input_value)
4. Register the Transform
Edit project.py to register your transform:
from maltego_trx.registry import register_transform_classes
from maltego_trx.server import app
from transforms import HelloWorldTransform
register_transform_classes([HelloWorldTransform])
5. Run the Transform Server
Start the local transform server:
python3 project.py runserver
This will run the server on http://localhost:8080.
6. Import the Transform in Maltego
- Open Maltego.
- Go to "Transforms" → "Transform Hub".
- Click "Local Transforms" → "New".
- Enter:
- Name:
HelloWorld
- URL:
http://localhost:8080/run/HelloWorldTransform/
- Input Entity:
Phrase (or any entity you want)
- Click "Add" and test the transform.
7. (Optional) Deploy as a TDS (Transform Distribution Server)
If you want to share the transform, package it as a .mtz file:
maltego-trx package MyCustomTransforms
Then import the .mtz file into Maltego.
Troubleshooting
- If Maltego doesn't detect the transform, ensure the server is running (
python3 project.py runserver).
- Check firewall settings if running on a remote machine.
- Verify the transform URL in Maltego matches the server endpoint.
Now you have a custom Maltego transform running in Kali Linux! 🚀