> For the complete documentation index, see [llms.txt](https://docs.netcap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netcap.io/integrations-and-operations/maltego-integration.md).

# Maltego

Explore PCAP files as link graphs in Maltego

**Maltego** is an open source intelligence (OSINT) and link analysis tool. You run transforms on entities and see the results as a graph.

{% embed url="<https://www.maltego.com>" %}

A transform is a small program that fetches data and returns it as new entities in the desktop client. Netcap provides entities and transforms that let you analyze a PCAP in Maltego, focused on the behavior of the hosts and devices in the capture.

## Installation

Install `net` and check which executable the transforms will call:

```
$ which net
/usr/local/bin/net
$ net --version
```

The transforms expect `net` at `/usr/local/bin/net`. If yours is elsewhere, update the executable path in the transform configuration. Keep the native libraries that came with your release next to the binary.

To generate the Maltego configuration, run `zeus gen-maltego-config` in a source checkout. Import the result in Maltego with Import / Export Config → Import Config.

{% hint style="info" %}
Maltego transforms need a working directory. Netcap uses `/usr/local`, so the current user must be able to enter it. Nothing is written there. The logs of transforms that run the netcap core go into a separate directory for each processed PCAP.
{% endhint %}

## Load a PCAP

You have two options:

1. Drag the file into a Maltego graph. It arrives as a **maltego.File** entity with the file path in its notes. Change the entity type to **netcap.PCAP**, open its detail view, and copy the path from the **Notes** tab into the **path** property.
2. Create a new **netcap.PCAP** entity and set its **path** property to the path of your PCAP.

## Run transforms

Right-click an entity and type **Get** in the search bar to see the transforms for that entity type. You can also open the **Run View** in the **Windows** tab and start transforms with one click.

The **netcap.DeviceProfiles** entity represents the device profiles derived from a PCAP. It offers two transforms:

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-7577df992f08edb110631103aa56786dbc7c5092%2Fscreenshot-2020-04-22-at-11.50.20.png?alt=media\&token=18ae9f4b-878a-4a45-8b81-2a344bf27415)

**GetDeviceProfilesWithDPI** turns on deep packet inspection. It needs extra dependencies and can slow processing down a lot. Without DPI, the transforms that depend on DPI data return nothing.

Run **GetDevices** to add the devices to the graph.

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-9fbc6b915cb2c958592e23a4c9b913a6dab54086%2Fscreenshot-2020-04-22-at-11.50.26.png?alt=media\&token=82ea769b-41e5-4f55-ac36-813ae8c0ef03)

This adds entities of type **netcap.Device**. A device lists the contacts and addresses it used to reach network services. These are the transforms for a device:

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-021de5ecabaa5b1df72ea5693883e136c7b496f8%2Fscreenshot-2020-04-22-at-11.50.07.png?alt=media\&token=604b6fd8-92eb-4da6-a5b2-f1bc8d29d755)

They create **netcap.IPAddr** entities with information about the host and more transforms to drill down. These are the transforms for a **netcap.IPAddr**:

![netcap.IPAddr transformations](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-f70bc3b7c53519331dc1eff9074aa73555654b4e%2Fscreenshot-2020-04-22-at-11.49.53.png?alt=media\&token=3b463de2-ee0b-4a1d-b583-2c9299f77168)

## Configuration

The **OpenFile** transform opens extracted files, except executables, in the default application for their type. On macOS it uses `open`, on Linux `gio open`. Set `NC_MALTEGO_OPEN_FILE` to use a different application.

## Examples

Find DHCP information for the selected hosts:

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-f8f4a7b098a0b0c0433b8d20a11e64c5975b5c8c%2Fdhcp.mov.gif?alt=media\&token=00f3133b-b651-435e-ad9f-53bc448e066b)

Add the server names sent as SNI in TLS handshakes:

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-1740ef84b26561a3c2e10d95650e6c9b3e110b84%2Fsnis.mov.gif?alt=media\&token=7fa83640-abea-454e-8a3c-6708884ce7c7)

List the application categories found by deep packet inspection:

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-8fea62e90888622ee6cdf33221e19abba88cf692%2Fdpicategories2.mov.gif?alt=media\&token=67b7e889-511d-44d5-9825-d589f80e616b)

Extract a POP3 authentication token:

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-17138c51e4fc2ef6a40d2a4f35c6553e5a3e0a79%2Fmailtoken.mov.gif?alt=media\&token=0d0053a9-9bf7-4603-bfa0-a7251498692a)

## Gallery

With many nodes, the organic layout keeps the graph readable:

![Graph during an investigation (organic topology)](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-4b22592a510ab980954590bb953d6615266d0795%2Fscreenshot-2020-03-25-at-01.22.54.png?alt=media\&token=3dc75bfa-63b4-4fb3-a08c-363f04555814)

Interaction with a PHP webshell:

![PHP webshell interaction](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-749db3dddf55a9b44a2955e86a9c9fe28a0d1ebb%2Fscreenshot-2020-03-25-at-15.00.45.png?alt=media\&token=037df535-8096-4b78-895f-969ec11ed838)

An exploit that injects commands through an HTTP parameter:

![HTTP parameter command injection](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-b389ee07e30c0d338e9f3b2714b7d973241164cd%2Fscreenshot-2020-03-25-at-15.00.55.png?alt=media\&token=9cd37772-da47-4214-a0d9-3880b97e1264)

An investigation after the attacker was identified, with further information gathered:

![Dataset investigation](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-f3632bcbfdba33a2ca8892f70adabefb5e7ef19f%2Fscreenshot-2020-03-25-at-00.20.06.png?alt=media\&token=b693658e-f0c0-497b-967f-54b66f2061b9)

![Dataset investigation](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-22bfad8715962d498d2b648fd3b60b8b64fae85c%2Ffiles.png?alt=media\&token=edfbc535-5e99-4373-bc28-6b49970c52d6)

![Flow Graph](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-0e5783ce8848966bcdb6528d568c5d21b5bbb18e%2Fscreenshot-2020-03-25-at-20.19.15.png?alt=media\&token=1bf82b17-7207-4010-a23d-147d38c1da9d)

## Detail Views

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-37ab047c66f814485befeb404814c0fefda34928%2Fscreenshot-2020-04-22-at-11.54.48.png?alt=media\&token=054cc443-1706-4bee-98e0-603e43886879)

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-fc3495f79948313316c8b850aaa26e0675270bac%2Fscreenshot-2020-04-22-at-12.01.05.png?alt=media\&token=c0a00427-7960-437f-a703-61669e5ac369)

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-0e9aa42bc91fa538b48a90479fa30900ee04af5a%2Fscreenshot-2020-04-22-at-12.04.55.png?alt=media\&token=7364d56f-2835-46dd-a4c7-b6ba8e9a4155)

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-3a483706ddc3c60034df5d89b7759e16a50228fd%2Fscreenshot-2020-04-22-at-12.02.08.png?alt=media\&token=877ca9c3-0f6d-4e96-a22f-7ef2607d23e6)

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-86b79d6665dc6ffd9616dd16feb88f745cdb3a08%2Fscreenshot-2020-04-22-at-12.02.03.png?alt=media\&token=2bf86d47-39ad-4f47-87ef-c13452950eb4)

![](https://1185258105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-La-SRWxzIGdy_3ynMZH-887967055%2Fuploads%2Fgit-blob-22b59fd68b0857731cf78cf548199e209df0141e%2Fscreenshot-2020-04-22-at-12.03.33.png?alt=media\&token=5abdc7ce-a3d0-4ce1-8f27-e3d8f614fed3)
