Overview
This node performs network scanning using the nmap
command-line tool. It supports multiple scan types such as quick ping scans, discovery scans with port checks, fast port scans, and full port scans on specified network ranges or hosts. This node is useful for network administrators and security professionals who want to automate network reconnaissance, identify active devices, and check open ports on hosts within a network.
Practical examples include:
- Quickly identifying which devices are online in a subnet.
- Discovering detailed information about devices and their open ports.
- Performing fast scans of common ports on a host.
- Conducting comprehensive scans of all ports on a host for 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 (options ) |
Collection of optional parameters: |
- Aggressive Mode (aggressive_mode ) |
Numeric value controlling scan speed; higher values mean faster execution (e.g., 5). |
- Check Top Ports (top_ports ) |
Number of top commonly used ports to scan (e.g., 1000). |
- Host Discovery (host_discovery ) |
Boolean flag to enable host discovery (-sS) or disable it for faster scans (-Pn). |
- Put Result in Field (ports_field ) |
Name of the output JSON field where port scan results will be stored (default: "ports"). |
Output
The node outputs an array of items, each containing a json
object with scan results. The structure depends on the selected operation:
- Quick Scan Network: Outputs an array of discovered hosts with basic info parsed from the quick ping scan.
- Discovery Network: Outputs detailed device and port information per host, with port data placed under the user-defined field name (default
"ports"
). - Ports Fast Scan and All Ports Scan: Outputs port scan results for a single host inside the specified field (default
"ports"
).
No binary data output is produced by this node.
Dependencies
- Requires the
nmap
command-line tool installed and accessible on the system where n8n runs. - Requires a local sudo password credential to execute
nmap
commands with elevated privileges. - Uses internal utility modules for shell command execution and parsing
nmap
output. - No external API keys or internet connectivity required.
Troubleshooting
- Common issues:
- Missing or incorrect sudo password will cause command execution failure.
nmap
not installed or not in PATH will result in command not found errors.- Invalid network range or host input may cause
nmap
to fail or return no results.
- Error messages:
- Errors thrown during command execution are wrapped and reported as node operation errors.
- If parsing fails due to unexpected
nmap
output format, the node may throw parsing errors.
- Resolutions:
- Ensure
nmap
is installed and accessible. - Verify the provided sudo password is correct.
- Validate the target network or host string.
- Adjust options like disabling host discovery for faster scans if timeouts occur.
- Ensure