# adilaxmdv/n2m architecture

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

- Interactive diagram: https://gitdiagram.com/adilaxmdv/n2m
- Repository: https://github.com/adilaxmdv/n2m

## Overview

n2m is a small CLI utility that turns an Nmap XML scan into a prioritized, safety-filtered Metasploit plan, then emits a resource script or JSON for review. The documented workflow includes optional interactive approval and a local suggestion stub; it does not execute Metasploit. The runtime is concentrated in main.py, so its distinct responsibilities are shown as separate components. The README documents several CLI connections; the excerpt confirms plan-building, interactive filtering, JSON export, and the local-only suggestion behavior, but does not expose every call site.

Main entry points: [`main.py`](https://github.com/adilaxmdv/n2m/blob/main/main.py) (CLI workflow), [`mapping.yaml`](https://github.com/adilaxmdv/n2m/blob/main/mapping.yaml) (Service mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs"]
  node_scan["Nmap XML"]
  node_mapping["Service mapping<br/>[mapping.yaml]"]
end

subgraph group_planning["Plan generation"]
  node_cli["CLI workflow<br/>[main.py]"]
  node_parser["XML parser<br/>[main.py]"]
  node_mapper["Mapping loader<br/>[main.py]"]
  node_suggestions["Local suggestions<br/>[main.py]"]
  node_planner["Plan builder<br/>[main.py]"]
end

subgraph group_outputs["Review and export"]
  node_vetting["Interactive vetting<br/>[main.py]"]
  node_rc["Resource script<br/>[main.py]"]
  node_json["Plan JSON<br/>[main.py]"]
end

node_operator(("CLI operator"))

node_operator -->|"runs"| node_cli
node_scan -->|"provides XML"| node_parser
node_mapping -->|"configures"| node_mapper
node_cli -->|"parses scan"| node_parser
node_cli -->|"loads mapping"| node_mapper
node_cli -->|"optionally augments"| node_suggestions
node_cli -->|"builds plan"| node_planner
node_cli -->|"optionally filters"| node_vetting
node_cli -->|"writes script"| node_rc
node_cli -->|"exports plan"| node_json

click node_mapping "https://github.com/adilaxmdv/n2m/blob/main/mapping.yaml"
click node_cli "https://github.com/adilaxmdv/n2m/blob/main/main.py"
click node_parser "https://github.com/adilaxmdv/n2m/blob/main/main.py"
click node_mapper "https://github.com/adilaxmdv/n2m/blob/main/main.py"
click node_suggestions "https://github.com/adilaxmdv/n2m/blob/main/main.py"
click node_planner "https://github.com/adilaxmdv/n2m/blob/main/main.py"
click node_vetting "https://github.com/adilaxmdv/n2m/blob/main/main.py"
click node_rc "https://github.com/adilaxmdv/n2m/blob/main/main.py"
click node_json "https://github.com/adilaxmdv/n2m/blob/main/main.py"

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_scan,node_mapping toneBlue
class node_cli,node_parser,node_mapper,node_suggestions,node_planner toneAmber
class node_vetting,node_rc,node_json toneMint
class node_operator toneIndigo
```

## Components

### Inputs

- **Nmap XML**
- [Service mapping](https://github.com/adilaxmdv/n2m/blob/main/mapping.yaml): `mapping.yaml`

### Plan generation

- [CLI workflow](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`
- [XML parser](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`
- [Mapping loader](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`
- [Local suggestions](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`
- [Plan builder](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`

### Review and export

- [Interactive vetting](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`
- [Resource script](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`
- [Plan JSON](https://github.com/adilaxmdv/n2m/blob/main/main.py): `main.py`

### Other components

- **CLI operator**

## Connections

- CLI operator → CLI workflow: runs (evidence: `README.md`)
- Nmap XML → XML parser: provides XML (evidence: `README.md`)
- Service mapping → Mapping loader: configures (evidence: `README.md`)
- CLI workflow → XML parser: parses scan (evidence: `README.md`)
- CLI workflow → Mapping loader: loads mapping (evidence: `README.md`)
- CLI workflow → Local suggestions: optionally augments (evidence: `README.md`)
- CLI workflow → Plan builder: builds plan (evidence: `main.py`)
- CLI workflow → Interactive vetting: optionally filters (evidence: `main.py`)
- CLI workflow → Resource script: writes script (evidence: `README.md`)
- CLI workflow → Plan JSON: exports plan (evidence: `main.py`)
