Metadata-Version: 2.4
Name: nmaptool
Version: 4.0.1
Summary: Advanced Nmap suite wrapper for AI-driven network scanning, reconnaissance, and vulnerability analysis on Linux.
Author: anish
License-Expression: MIT
Project-URL: Homepage, https://github.com/anish/LinuxAgent-NmapTool
Project-URL: Repository, https://github.com/anish/LinuxAgent-NmapTool
Project-URL: Issues, https://github.com/anish/LinuxAgent-NmapTool/issues
Keywords: nmap,network,scanner,security,pentesting,linux,ai,reconnaissance,vulnerability,ncat,nping,ndiff,zenmap,cybersecurity
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Systems Administration
Classifier: Typing :: Typed
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# LinuxAgent: NmapTool

[![Python 3.7–3.13](https://img.shields.io/badge/python-3.7%E2%80%933.13-blue.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Platform: Linux](https://img.shields.io/badge/platform-Linux-orange.svg)]()

**Advanced Nmap suite wrapper for AI-driven network scanning, reconnaissance, and vulnerability analysis on Linux.**

`linuxagent-nmaptool` packages the full Nmap AI Suite — all 5 tools (nmap, ncat, nping, ndiff, zenmap) — into a proper Python library with both an OOP and functional API, plus a built-in automated installer.

---

## Installation

```bash
pip install nmaptool
```

> **Prerequisite:** The Nmap suite must be installed on your Linux system.  
> Run `nmaptool-install` after pip install to auto-install all Nmap binaries.

---

## Quick Start

### OOP API

```python
from linuxagent.nmaptool import HackerAI_Nmap, NmapScanType

ai = HackerAI_Nmap()
result = ai.scan.scan("192.168.1.0/24", scan_type="quick")
print(result.summary())

result = ai.scan.analyze_vulnerabilities("10.0.0.1", ports="80,443")
report = ai.scan.generate_report(result, format="markdown")
```

### Functional API

```python
from linuxagent.nmaptool import nmap_tool, nping_tool, ncat_tool, ndiff_tool
from linuxagent.nmaptool import scan_with_profile, run_scan_pipeline

# Port scan with OS detection
r = nmap_tool(target="192.168.1.0/24", scan_type="syn", os_detect=True)

# Natural language goal-driven scan
r = nmap_tool(goal="scan all web services on 10.0.0.1 for vulns")

# Pre-built scan profiles
r = scan_with_profile("10.0.0.1", "pentest_initial")

# Multi-stage automated pipeline
r = run_scan_pipeline("10.0.0.1", stages=["discovery", "port_scan", "vuln_check"])

# Packet probing
r = nping_tool(target="10.0.0.1", mode="tcp", ports="80,443", count=3)

# Network connection
r = ncat_tool(host="10.0.0.1", port=80, send_data="HEAD / HTTP/1.0\r\n\r\n")

# Compare scans
r = ndiff_tool(scan_a="/tmp/scan1.xml", scan_b="/tmp/scan2.xml")
```

### Installer API

```python
from linuxagent.nmaptool import install, check_all_tools

# Check what's installed
statuses = check_all_tools()
for tool, info in statuses.items():
    print(f"{tool}: {'✔' if info['available'] else '✘'}")

# Auto-install everything
exit_code = install(skip_zenmap=True)
```

---

## CLI Commands

After installation, two CLI commands are available:

### `nmaptool` — The Scanner

```bash
nmaptool scan 192.168.1.1 --type aggressive
nmaptool vuln 10.0.0.1 --ports 80,443
nmaptool recon 10.0.0.1
nmaptool brute 10.0.0.1
nmaptool goal "stealth scan all web ports on 10.0.0.1"
nmaptool knowledge scan-types
nmaptool history
```

### `nmaptool-install` — The Installer

```bash
nmaptool-install                # full install of nmap suite
nmaptool-install --check        # verify only, no install
nmaptool-install --no-zenmap    # skip GUI tool
nmaptool-install --dry-run      # preview commands
nmaptool-install --force        # reinstall all
```

---

## Features

| Feature | Description |
|---|---|
| **13+ Scan Profiles** | Pre-built profiles: quick, stealth, aggressive, pentest, Kubernetes, Docker, cloud metadata |
| **AI Goal Router** | Natural-language scan goals auto-dispatched to the right tool and flags |
| **Scan Pipelines** | Multi-stage automated scan chains (discovery → port scan → vuln check) |
| **Parallel Scanning** | Concurrent multi-target scanning via ThreadPoolExecutor |
| **Watch Mode** | Continuous monitoring with change detection callbacks |
| **110+ NSE Scripts** | Curated NSE script references with severity scoring |
| **Report Generation** | Markdown, HTML, and CSV export |
| **Session Management** | Persistent scan history with save/load JSON state |
| **Auto-Installer** | Supports Debian/Ubuntu/Kali, RHEL/Fedora/CentOS, Arch, openSUSE |

---

## Supported Platforms

- **Linux only** — Debian, Ubuntu, Kali, Parrot, Mint, Fedora, CentOS, RHEL, Arch, openSUSE
- Python 3.7 – 3.13
- No third-party Python dependencies (stdlib only)

---

## License

[MIT](LICENSE)
