Nmap-Helper
A Rust-based command-line utility for processing and working with Nmap output files. This tool helps you convert Nmap output formats and generate targeted Nmap commands from previous scan results.
Features
- Convert Nmap output files between formats:
- XML (-oX) to JSON
- Greppable (-oG) to JSON
- Generate targeted Nmap commands from previous scan results
- Support for both single-target and multi-target command generation
- Automatic format detection
- Pretty or compressed JSON output
- Support for reading from files or stdin
Installation
From Source
- Ensure you have Rust and Cargo installed (https://rustup.rs/)
- Clone the repository
- Build and install:
From Source Using Cargo
- Ensure you have Rust and Cargo installed (https://rustup.rs/)
- Clone the repository
- Build and install:
Usage
Converting Nmap Output
Convert Nmap XML or greppable output to JSON:
# Convert from file
# Convert with pretty-printing
# Convert to output file
# Read from stdin
|
# Force input format
Generating Nmap Commands
Generate targeted Nmap commands from previous scan results:
# Basic usage
# Sort output by IP
# Add additional Nmap arguments
# Generate a single command for all targets
# Insert targets into a custom flag
Command Generation Examples
-
Basic per-host commands:
-
Single command for all hosts:
-
With additional Nmap arguments:
-
With inserted targets:
Command Reference
Convert Subcommand
nmap-helper convert [OPTIONS] [INPUT]
Arguments:
[INPUT] Input Nmap file (XML or greppable format), omit to read from stdin
Options:
-o, --output <FILE> Output JSON file (defaults to stdout if not specified)
-p, --pretty Pretty-print the JSON output
-f, --format <FORMAT> Force input format (xml or gnmap), otherwise auto-detected
-h, --help Print help
Nmap Subcommand
nmap-helper nmap [OPTIONS] [INPUT]
Arguments:
[INPUT] Input Nmap file (XML or greppable format), omit to read from stdin
Options:
--sort Sort output by IP address
--nmap-args <ARGS> Additional nmap arguments to append to the command
--single Output a single nmap command for all IPs
--insert-target <FLAG> Add a flag with the target(s) inserted at {} placeholder
-h, --help Print help
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.