A professional-grade, interactive command-line interface (CLI) for constructing complex Nmap commands. Built with Clean Architecture, SOLID principles, and Type Safety in mind.
- Interactive Builder: Step-by-step wizard to build complex Nmap scans.
- Clean Architecture: Strictly separated layers (Domain, Application, Infrastructure).
- Type Safety: Fully typed Python code with Enums for Nmap flags.
- Validation: Robust input validation for IPs, CIDRs, and ports.
- Conflict Resolution: Automatically resolves conflicting flags (e.g., removing ping scans when appropriate).
- Rich UI: Beautiful terminal output using the
richlibrary.
The project follows a strict Clean Architecture pattern to ensure maintainability and testability.
-
Domain (
nmap_tool/domain):- Contains enterprise business rules and entities.
- Enums:
NmapFlagdefines all supported flags strongly typed. - Services:
ConflictResolverServiceensures valid command combinations. - Dependency: Zero external dependencies.
-
Application (
nmap_tool/application):- Orchestrates the flow of data.
- Builder:
CommandBuilderconstructs the scan configuration. - Workflow:
ScanWorkflowmanages the user journey. - Interfaces:
UserInterfaceprotocol defines abstract UI interactions.
-
Infrastructure (
nmap_tool/infrastructure):- Implements interfaces and handles external concerns.
- UI:
ConsoleUIimplementsUserInterfaceusingrich. - Executor:
SystemExecutorwrapssubprocesscalls to the OS.
- Python 3.8+
- Nmap: Must be installed on your system.
- macOS:
brew install nmap - Linux:
sudo apt install nmap
- macOS:
-
Clone the repository:
git clone https://github.com/yourusername/nmaptool.git cd nmaptool -
Install dependencies:
pip install -r requirements.txt
Run the tool from the project root:
python3 main.pyFollow the on-screen prompts to configure your scan. The tool will suggest flags for:
- Host Discovery
- Scan Techniques
- Port Specification
- Service & Version Detection
- Vulnerability Scripting
- Firewall Evasion
- Output Formats
Contributions are welcome! Please ensure any pull requests adhere to the Clean Architecture principles established in the project.
This project is for educational and research purposes only. Ensure you have permission to scan any target.