> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/n/nmap-xml.md).

# NMAP XML

The NMAP XML adapter reads an nmap XML output file that you place on the connector. OctoXLabs adds each host with an IPv4 address to the device inventory, with its open ports, OS guess and CVEs.

## Use cases

* **Find hosts seen only by nmap.** List devices from the scan that no other adapter reports.

```
Adapters = nmap-xml AND NOT Adapters = active-directory
```

* **Review CVEs found by the vulners script.** Scan with `--script vulners` and then review the vulnerabilities on the imported devices.

```
Adapters = nmap-xml
```

## Before you begin

### Network

| Source         | Destination    | Port           | Protocol       |
| -------------- | -------------- | -------------- | -------------- |
| Not applicable | Not applicable | Not applicable | Not applicable |

The adapter reads a local file and makes no network connection. The nmap scan itself runs on your side.

### Required permissions

| Scope or role          | Permission              | Needed for                                                   |
| ---------------------- | ----------------------- | ------------------------------------------------------------ |
| Connector service user | Read access to the file | Reading the XML file in `/opt/octoxlabs/connector/media/xml` |

## Create credentials in NMAP XML

No credentials are needed. Create the scan file instead.

{% stepper %}
{% step %}

### Run the scan

Run nmap with the `-oX` flag, for example `nmap -sV -oX scan.xml 10.0.0.0/24`. To collect CVE data, add the vulners script with `--script vulners`.
{% endstep %}

{% step %}

### Copy the file

Copy the file to `/opt/octoxlabs/connector/media/xml` on the connector. Check the file permissions.
{% endstep %}

{% step %}

### Run a connection test

Enter the file name and run the connection test.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter | Required | Type                       | Default | Description                                                                                                                         |
| --------- | -------- | -------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Filename  | Yes      | String (file name pattern) | None    | Name of the nmap XML file in the `xml` folder. It can be a pattern. If several files match, the most recently modified one is used. |

## Troubleshooting

| Error message                     | Cause                                                                                          | Fix                                                                       |
| --------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| File not found with this pattern. | No file in the `xml` folder matches the Filename pattern, or the match is outside that folder. | Copy the file to `/opt/octoxlabs/connector/media/xml` and check the name. |

## Change history

{% hint style="info" %}
Available starting from version 6.4.1.
{% endhint %}
