Overview
This node integrates with Masscan, a fast port scanner, to scan specified IP addresses for open ports. It is useful in network security assessments, vulnerability scanning, and inventorying network services by quickly identifying which ports are open on target hosts.
Typical use cases include:
- Quickly scanning large IP ranges or multiple hosts to detect open ports.
- Performing banner grabbing optionally to identify service information running on open ports.
- Controlling scan speed and timeout parameters to balance thoroughness and performance.
- Collecting scan results for further processing or alerting within an automated workflow.
For example, a security analyst could use this node to scan a subnet for open HTTP (port 80) and HTTPS (port 443) services, optionally grabbing banners to identify server software versions.
Properties
| Name | Meaning |
|---|---|
| Only Success | Boolean flag to filter output to only successful scan results. |
| Ports | String specifying ports or port ranges to scan, e.g., "0-65535" for all ports. |
| Rate Limit | Number controlling the maximum packets per second sent during scanning (scan speed). |
| Banner Grabbing | Boolean flag to enable or disable banner grabbing to collect service info from open ports. |
| Connection Timeout | Number specifying connection timeout in seconds for each port scan attempt. |
| Advanced Config | Collection of advanced options including environment variables, files to send, and file collection settings. |
| Debug Mode | Boolean flag to enable detailed debug information in node input and output for troubleshooting. |
Output
The node outputs JSON data representing the scan results. The structure includes:
- An array of objects, each corresponding to an IP address scanned.
- Each object contains the IP address and a list of open ports detected on that IP.
- If banner grabbing is enabled, additional information about the service banners may be included for each port.
Binary data is not produced by this node.
Example output snippet (simplified):
[
{
"ip": "192.168.1.1",
"ports": [
{ "port": 80, "status": "open", "banner": "Apache httpd 2.4.41" },
{ "port": 443, "status": "open" }
]
},
{
"ip": "192.168.1.2",
"ports": [
{ "port": 22, "status": "open", "banner": "OpenSSH 7.9p1" }
]
}
]
Dependencies
- Requires Masscan executable available in the environment where n8n runs.
- No direct API keys or external web services are needed.
- The node internally runs Masscan commands with parameters derived from input properties.
- Temporary files are used to store JSON output from Masscan during execution.
Troubleshooting
Common issues:
- Masscan executable not found or not installed: Ensure Masscan is installed and accessible in the system PATH.
- Insufficient permissions to run Masscan or write temporary files: Run n8n with appropriate permissions.
- Network firewall or host firewall blocking scan packets: Verify network policies allow scanning traffic.
- Invalid port range syntax: Use correct format like "80,443,1000-2000".
Error messages:
- JSON parse errors on output file: May indicate incomplete or corrupted scan output; check disk space and permissions.
- Timeout errors: Increase the "Connection Timeout" property if scans fail due to slow responses.
- Rate limit too high causing packet loss: Reduce "Rate Limit" to avoid overwhelming the network or target hosts.
Links and References
- Masscan GitHub Repository - Official source and documentation for Masscan.
- Masscan Usage Guide - Details on command line options and configuration.