Overview
This node performs network scanning using the nmap command-line tool. It supports various scan operations such as quick network scans, discovery scans that identify devices and open ports, and port scans on hosts. The node is useful for network administrators and security professionals who want to automate network reconnaissance and port scanning tasks within n8n workflows.
Typical use cases include:
- Quickly identifying live hosts in a network.
- Discovering devices and their open ports on a subnet.
- Performing fast or comprehensive port scans on specific hosts.
For example, you can scan a local subnet to find all active devices and their open ports, helping with network inventory or vulnerability assessment.
Properties
| Name | Meaning |
|---|---|
Target Network Range / Host / IP (network_range) |
The target IP address, host, or network range (CIDR) to scan, e.g., 192.168.0.0/24. |
| Options: | |
- Aggressive Mode (aggressive_mode) |
Numeric value controlling scan speed/aggressiveness; default is 5 (fastest). |
- Check Top Ports (top_ports) |
Number of top ports to check during scan; default is 1000. |
- Host Discovery (host_discovery) |
Boolean to enable host discovery ping; if false, disables ping for faster scanning (-Pn). |
- Put Result in Field (ports_field) |
Name of the output JSON field where port scan results will be stored; default is "ports". |
Output
The node outputs an array of items, each containing a json object with scan results. The structure depends on the selected operation:
- Discovery Network: Outputs device and port information parsed from the scan, placed under the specified field name (default
"ports"). - Quick Scan Network: Outputs a list of discovered hosts.
- Ports Fast Scan and All Ports Scan: Outputs port scan details inside the specified field in the original input item's JSON.
No binary data output is produced by this node.
Dependencies
- Requires the
nmapcommand-line tool installed and accessible in the system environment where n8n runs. - Optionally uses sudo privileges if a local sudo password credential is provided, allowing execution of privileged commands.
- No external API keys or online services are required.
Troubleshooting
Common issues:
nmapnot found or not installed: Ensurenmapis installed and available in the PATH.- Permission denied errors: Provide a valid sudo password credential if elevated permissions are needed.
- Invalid target network range: Verify the IP or CIDR notation is correct.
Error messages:
- Errors thrown during command execution are wrapped and reported as node operation errors.
- If the sudo password is incorrect or missing when required, the command may fail.
To resolve errors, verify nmap installation, credentials, and input parameters.