Configuration Files Reference

This document provides a complete reference for ProRT-IP's TOML-based configuration system, including all available sections, options, default values, and validation rules.

Configuration File Locations

ProRT-IP searches for configuration files in the following order (later files override earlier):

PriorityLocationDescription
1/etc/prtip/config.tomlSystem-wide configuration
2~/.config/prtip/config.tomlUser configuration
3~/.prtip/config.tomlAlternative user location
4./prtip.tomlProject-specific configuration
5CLI flagsHighest priority (always wins)

Complete Configuration Example

# ProRT-IP Configuration File
# All values shown are defaults unless noted otherwise

[scan]
scan_type = "Connect"           # Connect, Syn, Fin, Null, Xmas, Ack, Udp, Idle
timing_template = "Normal"      # Paranoid, Sneaky, Polite, Normal, Aggressive, Insane
timeout_ms = 1000               # Probe timeout (1-3600000 ms)
retries = 0                     # Retry count (0-10)
scan_delay_ms = 0               # Delay between probes
host_delay_ms = 0               # Delay between hosts
progress = false                # Show progress bar

[scan.service_detection]
enabled = false                 # Enable service detection
intensity = 7                   # Detection intensity (0-9)
banner_grab = false             # Grab service banners
probe_db_path = ""              # Custom probe database path
enable_tls = true               # TLS/SSL detection
capture_raw = false             # Capture raw responses

[network]
interface = ""                  # Network interface (empty = auto-detect)
source_port = 0                 # Source port (0 = random)
skip_cdn = false                # Skip CDN IP addresses
cdn_whitelist = []              # Only skip these CDN providers
cdn_blacklist = []              # Never skip these CDN providers

[output]
format = "Text"                 # Text, Json, Xml, Greppable
file = ""                       # Output file (empty = stdout)
verbose = 0                     # Verbosity level (0-3)

[performance]
max_rate = 0                    # Max packets/sec (0 = unlimited)
parallelism = 0                 # Concurrent connections (0 = auto/CPU cores)
batch_size = 0                  # Connection pool batch (0 = auto)
requested_ulimit = 0            # Requested file descriptor limit
numa_enabled = false            # NUMA optimization (Linux only)
adaptive_batch_enabled = false  # Adaptive batch sizing
min_batch_size = 16             # Minimum batch size (1-1024)
max_batch_size = 256            # Maximum batch size (1-1024)

[evasion]
fragment_packets = false        # Enable packet fragmentation
mtu = 0                         # Custom MTU (0 = default, ≥68, multiple of 8)
ttl = 0                         # Custom TTL (0 = OS default ~64)
bad_checksums = false           # Use invalid checksums

[evasion.decoys]
# Random decoys: generates N random IPs
type = "random"
count = 5                       # Number of decoy IPs
me_position = 0                 # Real IP position (0 = append at end)

# OR Manual decoys: specific IP addresses
# type = "manual"
# ips = ["10.0.0.1", "10.0.0.2", "10.0.0.3"]
# me_position = 2               # Real IP at position 2

Configuration Sections

[scan] - Scan Configuration

Controls the scanning behavior and probe settings.

FieldTypeDefaultRangeDescription
scan_typeString"Connect"See enumType of port scan
timing_templateString"Normal"See enumTiming profile (T0-T5)
timeout_msInteger10001-3,600,000Probe timeout in milliseconds
retriesInteger00-10Number of retries per probe
scan_delay_msInteger0≥0Delay between probes (ms)
host_delay_msInteger0≥0Delay between hosts (ms)
progressBooleanfalse-Display progress bar

scan_type Values

ValueCLI FlagDescriptionPrivileges
"Connect"-sTFull TCP 3-way handshakeNone
"Syn"-sSHalf-open SYN scanRoot/Admin
"Fin"-sFTCP FIN scan (stealth)Root/Admin
"Null"-sNTCP NULL scan (no flags)Root/Admin
"Xmas"-sXTCP Xmas (FIN+PSH+URG)Root/Admin
"Ack"-sATCP ACK (firewall detection)Root/Admin
"Udp"-sUUDP scanRoot/Admin
"Idle"-sIIdle/zombie scanRoot/Admin

timing_template Values

ValueCLITimeoutDelayParallelismUse Case
"Paranoid"-T0300,000ms300,000ms1IDS evasion
"Sneaky"-T115,000ms15,000ms10Low-profile
"Polite"-T210,000ms400ms100Bandwidth-limited
"Normal"-T33,000ms0ms1,000Default
"Aggressive"-T41,000ms0ms5,000Fast networks
"Insane"-T5250ms0ms10,000Maximum speed

[scan.service_detection] - Service Detection

Controls service/version detection behavior.

FieldTypeDefaultRangeDescription
enabledBooleanfalse-Enable service detection
intensityInteger70-9Detection thoroughness
banner_grabBooleanfalse-Grab service banners
probe_db_pathString""-Custom probe database
enable_tlsBooleantrue-TLS/SSL detection
capture_rawBooleanfalse-Capture raw responses

Intensity Levels:

LevelDescriptionProbesSpeed
0Minimal~10Fastest
1-3Light~30Fast
4-6Standard~60Normal
7Default~100Balanced
8-9Comprehensive~187Thorough

[network] - Network Configuration

Controls network interface and CDN handling.

FieldTypeDefaultDescription
interfaceString""Network interface (empty = auto-detect)
source_portInteger0Source port (0 = random)
skip_cdnBooleanfalseSkip scanning CDN IPs
cdn_whitelistArray[]Only skip these providers
cdn_blacklistArray[]Never skip these providers

CDN Provider Names:

# Available CDN providers for whitelist/blacklist
cdn_whitelist = ["cloudflare", "akamai", "fastly", "cloudfront", "azure", "gcp"]
cdn_blacklist = ["akamai"]  # Never skip Akamai even with skip_cdn = true

CDN Configuration Examples:

# Skip all known CDN IPs (80-100% scan reduction)
[network]
skip_cdn = true

# Skip only Cloudflare and Fastly
[network]
skip_cdn = true
cdn_whitelist = ["cloudflare", "fastly"]

# Skip all CDNs except Azure
[network]
skip_cdn = true
cdn_blacklist = ["azure"]

[output] - Output Configuration

Controls output format and destination.

FieldTypeDefaultRangeDescription
formatString"Text"See enumOutput format
fileString""-Output file path
verboseInteger00-3Verbosity level

format Values

ValueCLI FlagDescription
"Text"-oNHuman-readable colorized text
"Json"-oJJSON format
"Xml"-oXNmap-compatible XML
"Greppable"-oGGreppable single-line format

verbose Levels

LevelCLIDescription
0(default)Normal output
1-vShow filtered/closed ports
2-vvDebug information
3-vvvTrace-level details

[performance] - Performance Configuration

Controls scan speed and resource usage.

FieldTypeDefaultRangeDescription
max_rateInteger00-100,000,000Max packets/sec (0 = unlimited)
parallelismIntegerAuto0-100,000Concurrent connections
batch_sizeInteger0≥0Connection pool batch size
requested_ulimitInteger0≥0Requested file descriptor limit
numa_enabledBooleanfalse-NUMA optimization (Linux)
adaptive_batch_enabledBooleanfalse-Adaptive batch sizing
min_batch_sizeInteger161-1024Minimum batch size
max_batch_sizeInteger2561-1024Maximum batch size

Parallelism:

  • 0 = Auto-detect based on CPU cores
  • Values > 0 = Explicit concurrent connection limit

Batch Configuration:

[performance]
# Optimal batch settings (from Sprint 6.3 benchmarks)
adaptive_batch_enabled = true
min_batch_size = 16    # 94% syscall reduction
max_batch_size = 256   # 99.6% syscall reduction, L3 cache friendly

NUMA Optimization (Linux Multi-Socket Systems):

[performance]
numa_enabled = true    # Enable NUMA-aware memory allocation

[evasion] - Evasion Configuration

Controls stealth and evasion techniques.

FieldTypeDefaultRangeDescription
fragment_packetsBooleanfalse-Enable IP fragmentation
mtuInteger00 or ≥68, mod 8Custom MTU (0 = default)
ttlInteger00-255Custom TTL (0 = OS default)
bad_checksumsBooleanfalse-Send invalid checksums

Fragmentation:

[evasion]
fragment_packets = true  # Fragment TCP/UDP packets
mtu = 576               # Custom MTU (must be ≥68 and multiple of 8)

TTL Control:

[evasion]
ttl = 32   # Short TTL to evade distant firewalls

[evasion.decoys] - Decoy Configuration

Configure decoy scanning (Nmap -D equivalent).

Random Decoys:

[evasion.decoys]
type = "random"
count = 5           # Generate 5 random decoy IPs
me_position = 3     # Real IP at position 3 (0 = append at end)

Manual Decoys:

[evasion.decoys]
type = "manual"
ips = ["192.168.1.10", "192.168.1.20", "192.168.1.30"]
me_position = 2     # Real IP at position 2

Validation Rules

ProRT-IP validates configuration files when loaded. Invalid configurations produce clear error messages:

FieldValidation RuleError Message
timeout_ms1-3,600,000"timeout_ms must be greater than 0" / "cannot exceed 1 hour"
retries0-10"retries cannot exceed 10"
parallelism0-100,000"parallelism cannot exceed 100,000"
max_rate0 or 1-100,000,000"max_rate must be greater than 0" / "cannot exceed 100M pps"
mtu0 or ≥68, mod 8"MTU must be at least 68 and a multiple of 8"
intensity0-9"intensity must be 0-9"

Example Validation Error

$ prtip --config invalid.toml 192.168.1.1
Error: Configuration validation failed
  Caused by: timeout_ms cannot exceed 1 hour (3600000 ms)

Loading Configuration Programmatically

#![allow(unused)]
fn main() {
use prtip_core::config::Config;
use std::path::Path;

// Load from file
let config = Config::load_from_file(Path::new("prtip.toml"))?;

// Load from string
let toml_str = r#"
    [scan]
    scan_type = "Syn"
    timing_template = "Aggressive"

    [performance]
    max_rate = 10000
"#;
let config = Config::load_from_str(toml_str)?;

// Save to file
config.save_to_file(Path::new("output.toml"))?;
}

Profile Configurations

Fast Scan Profile

# fast-scan.toml - Quick network reconnaissance
[scan]
scan_type = "Syn"
timing_template = "Aggressive"
timeout_ms = 500
retries = 0

[performance]
max_rate = 50000
parallelism = 5000

[output]
format = "Greppable"

Stealth Scan Profile

# stealth-scan.toml - IDS/IPS evasion
[scan]
scan_type = "Fin"
timing_template = "Sneaky"
timeout_ms = 10000
scan_delay_ms = 500

[performance]
max_rate = 100

[evasion]
fragment_packets = true
mtu = 576
ttl = 64

[evasion.decoys]
type = "random"
count = 5

Service Detection Profile

# service-detection.toml - Full service enumeration
[scan]
scan_type = "Syn"
timing_template = "Normal"
timeout_ms = 5000

[scan.service_detection]
enabled = true
intensity = 8
banner_grab = true
enable_tls = true

[output]
format = "Json"
verbose = 1

Enterprise Network Profile

# enterprise.toml - Large network scanning
[scan]
scan_type = "Syn"
timing_template = "Polite"
timeout_ms = 3000
retries = 1
host_delay_ms = 100

[network]
skip_cdn = true

[performance]
max_rate = 10000
parallelism = 1000
numa_enabled = true
adaptive_batch_enabled = true

[output]
format = "Xml"
verbose = 0

Environment Variable Mapping

Configuration options can also be set via environment variables:

Config PathEnvironment Variable
scan.scan_typePRTIP_SCAN_TYPE
scan.timing_templatePRTIP_TIMING
performance.max_ratePRTIP_MAX_RATE
output.formatPRTIP_OUTPUT_FORMAT
output.verbosePRTIP_VERBOSE
# Environment variable example
export PRTIP_SCAN_TYPE=Syn
export PRTIP_MAX_RATE=10000
prtip 192.168.1.0/24

See Also


Last Updated: 2025-11-21 ProRT-IP Version: v0.5.4