Overview
Port options control which TCP ports are scanned on target hosts. You can specify individual ports, ranges, top ports, or use custom port lists.Port Specification
Ports to scan. Supports individual ports, ranges, and comma-separated combinations.Syntax:
- Individual ports:
80,443,8080 - Port ranges:
100-200 - Mixed:
80,443,8000-9000
When no port specification is provided, scan4all uses the top ports based on the
-tp setting.Number of top ports to scan based on frequency of use.Uses a built-in database of the most commonly used ports, ordered by likelihood of being open.Common values:
100- Top 100 most common ports (fast scan)1000- Top 1000 ports (default, balanced)full- All 65535 ports (comprehensive)
File containing list of ports to scan (one per line or comma-separated).File format:Example:
Port Exclusions
Ports to exclude from the scan (comma-separated).Useful when scanning large port ranges but wanting to skip specific ports.Examples:
Skip full port scans for known CDN IP ranges. Only checks ports 80 and 443.This optimization significantly speeds up scans when targeting domains behind CDNs like Cloudflare, Akamai, or Fastly, since these IPs typically only expose HTTP/HTTPS.Example:
Port Selection Strategies
Quick Reconnaissance
Standard Scan
Web Application Focus
Comprehensive Scan
Custom Service Scan
Performance Considerations
- Top 100 ports: ~1-5 seconds per host
- Top 1000 ports: ~10-30 seconds per host
- All ports (1-65535): ~5-15 minutes per host
Common Port Ranges
| Range | Description |
|---|---|
| 1-1023 | Well-known ports (system ports) |
| 1024-49151 | Registered ports (user ports) |
| 49152-65535 | Dynamic/private ports |
| 80, 443 | HTTP/HTTPS |
| 20-23 | FTP/SSH/Telnet |
| 25, 587, 465 | Email (SMTP) |
| 3306, 5432 | MySQL/PostgreSQL |
| 6379, 27017 | Redis/MongoDB |
Best Practices
- Start with top ports - Use
-tp 100for initial reconnaissance - Expand as needed - Increase to
-tp 1000or specific ports based on findings - Use exclusions wisely - Skip known ports to focus on interesting services
- Enable CDN exclusion - Save time with
-ecfor web application scans - Verify critical ports - Use
-verifyflag for important findings - Custom port lists - Maintain service-specific port files for repeated scans
Related Options
- Rate Limit Options - Control scan speed
- Optimization Options - Improve port scan accuracy with
-verify