# vulnerscom/nmap-vulners architecture

> Architecture diagram of the GitHub repository vulnerscom/nmap-vulners, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vulnerscom/nmap-vulners
- Repository: https://github.com/vulnerscom/nmap-vulners

## Overview

nmap-vulners is an Nmap NSE vulnerability-enrichment plugin. Its main workflow takes Nmap’s service identities, supplements web-port detection with a polite fingerprint sweep, queries Vulners, then ranks and renders findings in the scan report. The repository also maintains the fingerprint catalog used by that sweep. The README documents the runtime capabilities; source excerpts show parts of catalog generation, so the graph omits unverified runtime-to-catalog wiring.

Main entry points: [`tools/fingerprints/build.py`](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/build.py) (Catalog builder), [`tools/fingerprints/normalize.py`](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/normalize.py) (CPE normalization), [`vulners.nse`](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse) (NSE plugin), [`tools/fingerprints/probes.py`](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/probes.py) (Probe assembly)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Nmap scan workflow"]
  node_nse["NSE plugin<br/>[vulners.nse]"]
  node_service["Service identity<br/>[vulners.nse]"]
  node_sweep["Web sweep<br/>[vulners.nse]"]
  node_fingerprint_match["Fingerprint matching<br/>[vulners.nse]"]
  node_targeted_probe["Targeted version probes<br/>[vulners.nse]"]
  node_cpe["CPE normalization<br/>[normalize.py]"]
end

subgraph group_fingerprints["Fingerprint catalog"]
  node_catalog_data[("Fingerprint data")]
  node_catalog_build["Catalog builder<br/>[build.py]"]
  node_catalog_index["Catalog index<br/>[catalog.py]"]
  node_source_readers["Source readers"]
  node_path_catalog["Sweep path catalog<br/>[paths.py]"]
  node_pattern_translation["Pattern translation<br/>[pcre2lua.py]"]
  node_probe_catalog["Probe assembly<br/>[probes.py]"]
end

subgraph group_query["Vulnerability lookup"]
  node_vulners_api[("Vulners database")]
  node_lookup["CVE lookup<br/>[vulners.nse]"]
  node_ranking["Finding ranking<br/>[vulners.nse]"]
  node_render["Scan report output<br/>[vulners.nse]"]
end

node_nmap(("Nmap scanner"))

node_nmap -->|"runs script"| node_nse
node_nse -->|"uses scan identity"| node_service
node_nse -->|"sweeps web ports"| node_sweep
node_sweep -->|"matches responses"| node_fingerprint_match
node_fingerprint_match -->|"triggers probes"| node_targeted_probe
node_service -.->|"normalizes identity"| node_cpe
node_fingerprint_match -.->|"identifies software"| node_cpe
node_targeted_probe -.->|"extracts version"| node_cpe
node_cpe -->|"provides CPE"| node_lookup
node_lookup -->|"requests findings"| node_vulners_api
node_lookup -->|"returns findings"| node_ranking
node_ranking -->|"orders results"| node_render
node_render -->|"adds report output"| node_nmap
node_source_readers -->|"loads sources"| node_catalog_build
node_catalog_build -->|"translates patterns"| node_pattern_translation
node_catalog_build -->|"uses path data"| node_path_catalog
node_catalog_build -->|"assembles probes"| node_probe_catalog
node_probe_catalog -->|"translates extractors"| node_pattern_translation
node_catalog_index -.->|"indexes catalog"| node_catalog_data

click node_nse "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"
click node_service "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"
click node_sweep "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"
click node_fingerprint_match "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"
click node_targeted_probe "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"
click node_cpe "https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/normalize.py"
click node_catalog_data "https://github.com/vulnerscom/nmap-vulners/tree/master/catalog"
click node_catalog_build "https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/build.py"
click node_catalog_index "https://github.com/vulnerscom/nmap-vulners/blob/master/tools/catalog.py"
click node_source_readers "https://github.com/vulnerscom/nmap-vulners/tree/master/tools/fingerprints/sources"
click node_path_catalog "https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/paths.py"
click node_pattern_translation "https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/pcre2lua.py"
click node_probe_catalog "https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/probes.py"
click node_lookup "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"
click node_ranking "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"
click node_render "https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nse,node_service,node_sweep,node_fingerprint_match,node_targeted_probe,node_cpe toneBlue
class node_catalog_data,node_catalog_build,node_catalog_index,node_source_readers,node_path_catalog,node_pattern_translation,node_probe_catalog toneAmber
class node_vulners_api,node_lookup,node_ranking,node_render toneMint
class node_nmap toneIndigo
```

## Components

### Nmap scan workflow

- [NSE plugin](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`
- [Service identity](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`
- [Web sweep](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`
- [Fingerprint matching](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`
- [Targeted version probes](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`
- [CPE normalization](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/normalize.py): `tools/fingerprints/normalize.py`

### Fingerprint catalog

- [Fingerprint data](https://github.com/vulnerscom/nmap-vulners/tree/master/catalog): `catalog`
- [Catalog builder](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/build.py): `tools/fingerprints/build.py`
- [Catalog index](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/catalog.py): `tools/catalog.py`
- [Source readers](https://github.com/vulnerscom/nmap-vulners/tree/master/tools/fingerprints/sources): `tools/fingerprints/sources`
- [Sweep path catalog](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/paths.py): `tools/fingerprints/paths.py`
- [Pattern translation](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/pcre2lua.py): `tools/fingerprints/pcre2lua.py`
- [Probe assembly](https://github.com/vulnerscom/nmap-vulners/blob/master/tools/fingerprints/probes.py): `tools/fingerprints/probes.py`

### Vulnerability lookup

- **Vulners database**
- [CVE lookup](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`
- [Finding ranking](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`
- [Scan report output](https://github.com/vulnerscom/nmap-vulners/blob/master/vulners.nse): `vulners.nse`

### Other components

- **Nmap scanner**

## Connections

- Nmap scanner → NSE plugin: runs script (evidence: `README.md`)
- NSE plugin → Service identity: uses scan identity (evidence: `README.md`)
- NSE plugin → Web sweep: sweeps web ports (evidence: `README.md`)
- Web sweep → Fingerprint matching: matches responses (evidence: `README.md`)
- Fingerprint matching → Targeted version probes: triggers probes (evidence: `README.md`)
- Service identity → CPE normalization: normalizes identity
- Fingerprint matching → CPE normalization: identifies software
- Targeted version probes → CPE normalization: extracts version
- CPE normalization → CVE lookup: provides CPE (evidence: `README.md`)
- CVE lookup → Vulners database: requests findings (evidence: `README.md`)
- CVE lookup → Finding ranking: returns findings (evidence: `README.md`)
- Finding ranking → Scan report output: orders results (evidence: `README.md`)
- Scan report output → Nmap scanner: adds report output (evidence: `README.md`)
- Source readers → Catalog builder: loads sources (evidence: `tools/fingerprints/build.py`)
- Catalog builder → Pattern translation: translates patterns (evidence: `tools/fingerprints/build.py`)
- Catalog builder → Sweep path catalog: uses path data (evidence: `tools/fingerprints/build.py`)
- Catalog builder → Probe assembly: assembles probes (evidence: `tools/fingerprints/build.py`)
- Probe assembly → Pattern translation: translates extractors (evidence: `tools/fingerprints/probes.py`)
- Catalog index → Fingerprint data: indexes catalog
