Skip to content

swasctl/nmapx

Repository files navigation

NmapX - Automated Nmap Recon & Vulnerability Assessment

NmapX is an intelligent, mission-driven automation framework for Nmap that transforms raw reconnaissance data into actionable security insights. It's designed for penetration testers, security researchers, and system administrators who need powerful, flexible network scanning with minimal manual effort.

▸ Features

  • Mission-Based Scanning: Define security goals in plain English; NmapX maps them to optimized Nmap workflows
  • Guided Recon Actions: Walk through structured reconnaissance workflows step-by-step
  • Scan Profiles: Pre-configured profiles for common scenarios (fast, default, safe, full)
  • NSE Script Integration: Leverage Nmap's scripting engine with curated script catalogs
  • Smart Intent Matching: AI-powered ranking of reconnaissance intents based on your objectives
  • Result Diffing: Compare scan results and identify changes between runs
  • Interactive Console: Numbers-only menu-driven interface for hands-free operation
  • JSON/XML Output: Structured result storage for integration with other tools
  • Workflow Persistence: Save and replay scan workflows for reproducibility

▸ Quick Start

Installation

Install NmapX directly from the repository using pip:

pip install -e .

Or install from PyPI (when published):

pip install nmapx

Prerequisites

Verify Nmap installation:

nmap --version

Basic Usage

Start the interactive console:

python -m nmapx.main

Or use direct commands:

nmapx scan --target 127.0.0.1 --profile default
nmapx ask --target localhost --intent host-presence
nmapx guide --target 192.168.1.0/24

▸ Core Concepts

Intents

Intents represent high-level security goals (e.g., "Check if host is reachable", "Find all exposed services"). NmapX matches intents to optimized Nmap workflows.

Profiles

Pre-configured scan templates:

  • fast: Quick top-port discovery
  • default: Balanced service detection
  • safe: Safe enumeration with default scripts
  • full: Comprehensive TCP exposure mapping

Missions

Interactive state machine where you set a target, define a goal, and let NmapX recommend or execute matching workflows.

▸ Project Structure

nmapx/
├── cli.py                 # CLI entry point
├── main.py                # Interactive console launcher
├── core/
│   ├── application.py     # Core business logic
│   ├── planner.py         # Workflow planning
│   ├── parser.py          # Nmap XML parsing
│   ├── scan_service.py    # Nmap execution
│   ├── presenter.py       # Output rendering
│   └── ...
├── models/
│   └── scan.py            # Data models
├── utils/
│   └── logger.py          # Logging utilities
└── nse/
    └── scripts/           # NSE script profiles

▸ Development

Setup Development Environment

# Create virtual environment
python -m venv venv

# Activate it
# On Windows:
venv\Scripts\activate
# On Linux/Mac:
source venv/bin/activate

# Install with dev dependencies
pip install -e ".[dev]"

Running Tests

pytest

Code Quality

black nmapx/
pylint nmapx/
mypy nmapx/

▸ Examples

Example 1: Quick Host Check

nmapx scan --target example.com --profile fast

Example 2: Guided Workflow

nmapx guide --target 10.0.0.5
# Follow the interactive prompts

Example 3: Mission-Based Scanning

Start the console and use the mission flow:

selection > 1  # Select target
selection > 2  # Guided recon actions
selection > [follow prompts]

Example 4: Compare Results

nmapx diff
# Shows differences between the two most recent scans

▸ Configuration

The application stores results and logs in:

  • nmapx/data/results/ - Scan result files (JSON/XML)
  • nmapx/data/logs/ - Execution logs

▸ Dependencies

See pyproject.toml for a complete list. Main dependencies:

  • rich: Terminal rendering and rich output formatting
  • typer: CLI framework
  • pydantic: Data validation
  • lxml: XML parsing for Nmap output

▸ Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit changes (git commit -am 'Add my feature')
  4. Push to branch (git push origin feature/my-feature)
  5. Open a Pull Request

▸ Disclaimer

NmapX is a security testing tool. Only use it on networks and systems you own or have explicit permission to test. Unauthorized network scanning may be illegal.

▸ License

MIT License - See LICENSE file for details

▸ Support

  • Issues: Report bugs and feature requests on GitHub
  • Discussions: Join community discussions for questions and ideas

▸ Resources


Built for security professionals

About

NmapX - Automated Nmap Recon and Vulnerability Assessment Framework

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors