Use the OpenCTI platform in your Maltego application thanks to a set of transforms allowing you to explore the OpenCTI v6 data.
$ git clone https://github.com/MaltegoTech/opencti-maltego.git
$ cd opencti-maltego
Please install the following requirements before generating the Maltego transforms:
- Python >= 3.6
- Libraries in requirements.txt
- Maltego STIX2 entities and python package maltego_stix2
Warning: you have to import Maltego STIX2 entities before installing these transforms.
$ pip3 install -r requirements.txt
This repository provides integration between OpenCTI and Maltego using the Maltego TRX library.
Even if some compatibility exists, each OpenCTI version should be queried with the corresponding pycti version. The Python requirements need to be adapted accordingly.
This repository tries to remain compatible with the latest version of OpenCTI. You can use the tags to run an older version of this integration against an older version of OpenCTI. Some features and bugs are solved in both projects regularly, so these older versions may not work entirely.
Please try pinning the pycti version to the respective OpenCTI version.
Please open an issue for any compatibility problem you may have.
The local OpenCTI transforms leverage the Maltego TRX library. The first step is to create the configuration file:
$ cp config.py.sample config.py
Update the file according to your setup and then execute:
To ensure a smooth setup and to overcome environment issues, you can use the provided build_transforms.sh
script. This script will create and activate a virtual environment, set the PYTHONPATH
, install dependencies, and run the CLI.
-
Make the script executable:
$ chmod +x build_transforms.sh
-
Run the script from the root directory of the repository:
$ ./build_transforms.sh
The build_transforms.sh
script includes the following steps:
#!/bin/bash
# build_transforms.sh
# Create and activate the virtual environment
python3 -m venv venv
source venv/bin/activate
# Set PYTHONPATH
export PYTHONPATH=$(pwd):$PYTHONPATH
# Install dependencies
python3 -m pip install -r trx/gunicorn/requirements.txt
# Run the CLI
python3 cli.py
# Deactivate the virtual environment
deactivate
If you use an iTDS, make sure to configure its URL in ./config.py, generate specific configuration files by running:
Import the following files in your iTDS management platform:
output/config.mtz
for the main configuration.output/settings.csv
for settings.output/transforms_1-6.csv
tooutput/transforms_6-6.csv
for transforms, in batches for easier import.
After running the script, the following files will be generated in the output
directory:
local.mtz
: Configuration file to import locally into Maltego.config.mtz
: Configuration file for iTDS.settings.csv
: Settings for iTDS.transforms_1-6.csv
totransforms_6-6.csv
: Transform CSV files for importing to iTDS in batches.
To import the local transforms into Maltego, follow these steps:
Import the file output/local.mtz
in Maltego using the "Import config" menu.
To import the transforms into iTDS, follow these steps:
- Import the file
output/config.mtz
in iTDS using the "Import config" menu. - Import the file
output/settings.csv
in iTDS using the "Import settings" menu. - Import the files
output/transforms_1-6.csv
tooutput/transforms_6-6.csv
in iTDS using the "Import transforms" menu.
Make sure to configure the iTDS URL in the config.py
file as shown below:
HOST_URL = os.environ.get("HOST_URL", "https://localhost:8088")
opencti_url_setting = TransformSetting('opencti_url', 'OpenCTI URL', setting_type='string', default_value="", popup=True)
opencti_token_setting = TransformSetting('opencti_token', 'OpenCTI Token', setting_type='string', default_value="", popup=True)
ssl_verify_setting = TransformSetting('opencti_ssl_verify', 'SSL Verify', setting_type='boolean', default_value="false", popup=False)
http_proxies_setting = TransformSetting('opencti_http_proxies', 'HTTP Proxies', setting_type='string', optional=True, popup=False)
global_settings = [
opencti_url_setting,
opencti_token_setting,
ssl_verify_setting,
http_proxies_setting
]
global_registry = TransformRegistry(
owner='Maltego Technologies GmbH - OpenCTI On-Premise',
author='Maltego Technologies GmbH - OpenCTI On-Premise',
host_url=HOST_URL,
seed_ids=['opencti'],
global_settings=global_settings
)
The transform server can be run with or without SSL support. By default, it runs without SSL.
python project.py runserver --port 8080
To run the server with SSL, make sure you have your cert.pem
and key.pem
files in the trx/gunicorn
directory, the folder contains a sample certificate and key file. Then run the following command:
python project.py runserver --port 8080 --ssl
We follow a standard Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
This module is not a huge project with an intense roadmap. Feel free to contribute through issues linked to pull requests for new features and bug solving.
- Handle errors and display messages in Maltego
- Add a Maltego machine to generate a knowledge graph from one report