Skip to content

Latest commit

 

History

History
2787 lines (2077 loc) · 66.1 KB

File metadata and controls

2787 lines (2077 loc) · 66.1 KB

ProRT-IP User Guide

Version: 2.0.0 (Enhanced) Last Updated: 2025-11-07 Target Audience: All users (beginner → advanced)


Table of Contents

  1. Quick Start (5 Minutes)
  2. Installation
  3. Basic Usage
  4. Common Use Cases
  5. Configuration
  6. Troubleshooting
  7. FAQ
  8. CLI User Experience Features
  9. Next Steps

1. Quick Start (5 Minutes)

Prerequisites

  • Operating System: Linux, macOS, Windows, or BSD
  • Privileges: Root/administrator access (for raw packet scanning)
  • Network Access: Internet connection for installation
  • Disk Space: ~100 MB for binary and dependencies

Installation One-Liner

# Linux (from source, recommended)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP
cargo build --release
sudo cp target/release/prtip /usr/local/bin/

# Verify installation
prtip --version

Your First Scan

Scenario: Scan localhost for common web ports

sudo prtip -sT -p 80,443,8080 127.0.0.1

Expected Output:

ProRT-IP v0.5.0 - Network Scanner
Starting scan at 2025-11-07 10:30:15

Scanning 127.0.0.1...
PORT     STATE  SERVICE
80/tcp   open   http
443/tcp  open   https
8080/tcp closed http-proxy

Scan complete: 3 ports scanned in 0.15 seconds
1 hosts up, 2 ports open

Explanation:

  • -sT: TCP connect scan (safe, no raw packets)
  • -p 80,443,8080: Scan specific ports
  • 127.0.0.1: Target (localhost)
  • sudo: Required for raw packet scans (not needed for -sT)

Next Steps

Core Features:

Advanced Features:


2. Installation

2.1: Linux Installation

Option 1: Package Manager (Debian/Ubuntu)

# Add ProRT-IP repository (future)
# sudo add-apt-repository ppa:prorti-ip/stable
# sudo apt update
# sudo apt install prtip

# Currently: Install from source

Option 2: From Source (Recommended)

Prerequisites:

  • Rust 1.85+ (install via rustup)
  • gcc, libpcap-dev (Debian/Ubuntu: sudo apt install build-essential libpcap-dev)

Steps:

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Clone repository
git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP

# Build release binary
cargo build --release

# Install to /usr/local/bin
sudo cp target/release/prtip /usr/local/bin/
sudo chmod +x /usr/local/bin/prtip

# Verify
prtip --version

Option 3: Distribution-Specific

Arch Linux:

# AUR package (future)
# yay -S prtip-bin
# Currently: Use source installation

Fedora/RHEL/CentOS:

# Install dependencies
sudo dnf install gcc libpcap-devel

# Follow "From Source" steps above

Alpine Linux:

# Install dependencies
sudo apk add gcc musl-dev libpcap-dev

# Follow "From Source" steps above

2.2: macOS Installation

Option 1: Homebrew (Future)

# Homebrew tap (future)
# brew tap doublegate/prtip
# brew install prtip

# Currently: Install from source

Option 2: From Source

Prerequisites:

  • Xcode Command Line Tools: xcode-select --install
  • Homebrew: Install libpcap: brew install libpcap
  • Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Steps:

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Clone and build
git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP
cargo build --release

# Install
sudo cp target/release/prtip /usr/local/bin/
sudo chmod +x /usr/local/bin/prtip

# Fix macOS permissions (required for raw packet capture)
sudo chown root:wheel /usr/local/bin/prtip
sudo chmod +s /usr/local/bin/prtip

# Verify
prtip --version

macOS-Specific Notes:

  • BPF Devices: macOS requires /dev/bpf* access. Run with sudo for raw packet scans.
  • ChmodBPF: Install ChmodBPF for non-root access (advanced).

2.3: Windows Installation

Option 1: Installer (Future)

# MSI installer (future)
# Download from https://github.com/doublegate/ProRT-IP/releases
# Run installer, follow wizard

Option 2: From Source

Prerequisites:

  • Rust: Install from rustup.rs (Windows installer)
  • Npcap: Download and install Npcap (WinPcap replacement)
  • Visual Studio Build Tools: Required for Rust compilation

Steps:

# Install Rust (run installer from rustup.rs)

# Install Npcap
# Download from https://npcap.com/ and run installer
# ✅ Check "Install Npcap in WinPcap API-compatible Mode"

# Clone repository (in PowerShell or Git Bash)
git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP

# Build release binary
cargo build --release

# Binary location: target\release\prtip.exe
# Copy to C:\Program Files\ProRT-IP\ (optional)

# Verify
.\target\release\prtip.exe --version

Windows-Specific Notes:

  • Npcap Required: Windows needs Npcap for raw packet capture
  • Administrator Privileges: Run Command Prompt/PowerShell as Administrator for scans
  • Firewall: Windows Firewall may prompt for network access permissions

2.4: BSD Installation

FreeBSD

# Install dependencies
sudo pkg install rust libpcap

# Clone and build
git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP
cargo build --release

# Install
sudo cp target/release/prtip /usr/local/bin/
sudo chmod +x /usr/local/bin/prtip

# Verify
prtip --version

OpenBSD

# Install dependencies
doas pkg_add rust libpcap

# Clone and build
git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP
cargo build --release

# Install
doas cp target/release/prtip /usr/local/bin/
doas chmod +x /usr/local/bin/prtip

# Verify
prtip --version

2.5: Container Installation

Docker

# Pull image (future, once published to Docker Hub)
# docker pull doublegate/prtip:latest

# Build from source
git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP

# Create Dockerfile (example)
cat > Dockerfile <<EOF
FROM rust:1.85 AS builder
WORKDIR /app
COPY . .
RUN cargo build --release

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y libpcap0.8 && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/prtip /usr/local/bin/
ENTRYPOINT ["prtip"]
EOF

# Build image
docker build -t prtip:local .

# Run
docker run --rm --network=host prtip:local -sT -p 80,443 scanme.nmap.org

Podman

# Same as Docker, replace 'docker' with 'podman'
podman build -t prtip:local .
podman run --rm --network=host prtip:local -sT -p 80,443 scanme.nmap.org

2.6: Verification Steps

After installation, verify ProRT-IP is working correctly:

# 1. Check version
prtip --version
# Expected: ProRT-IP v0.5.0

# 2. Check help
prtip --help
# Expected: Full help output with all flags

# 3. Simple test scan (localhost, safe)
prtip -sT -p 80 127.0.0.1
# Expected: Scan completes without errors

# 4. Check privileges (for raw packet scans)
sudo prtip -sS -p 80 127.0.0.1
# Expected: SYN scan completes (requires root/admin)

If all commands succeed, installation is complete!


3. Basic Usage

3.1: Command Syntax

General Format:

prtip [OPTIONS] <TARGET>

Examples:

prtip 192.168.1.1                    # Basic scan (default ports)
prtip -p 80,443 example.com          # Specific ports
prtip -sS -p 1-1000 10.0.0.0/24      # SYN scan, port range, CIDR

3.2: Scan Types

Flag Scan Type Description Privilege Speed
-sT TCP Connect Full TCP handshake User Medium
-sS TCP SYN Half-open scan (stealth) Root Fast
-sU UDP UDP port scan Root Slow
-sF FIN Stealth FIN scan Root Fast
-sN NULL Stealth NULL scan Root Fast
-sX Xmas Stealth Xmas scan Root Fast
-sA ACK Firewall detection Root Fast
-sI Idle/Zombie Anonymous scan via zombie Root Very Slow

Examples:

# TCP Connect (no root required)
prtip -sT -p 80,443 192.168.1.1

# TCP SYN (stealth, requires root)
sudo prtip -sS -p 1-1000 192.168.1.1

# UDP scan (slow, requires root)
sudo prtip -sU -p 53,161,123 192.168.1.1

# Combined TCP SYN + UDP
sudo prtip -sS -sU -p 1-100 192.168.1.1

3.3: Target Specification

Single IP:

prtip 192.168.1.1
prtip example.com

CIDR Notation:

prtip 192.168.1.0/24        # Scan 192.168.1.1-254
prtip 10.0.0.0/16           # Scan 10.0.0.1-10.0.255.254

IP Range:

prtip 192.168.1.1-50        # Scan 192.168.1.1 to 192.168.1.50
prtip 192.168.1-10.1        # Scan 192.168.1.1 to 192.168.10.1

Multiple Targets:

prtip 192.168.1.1 192.168.1.2 192.168.1.3
prtip 192.168.1.1/24 10.0.0.1/24

From File:

prtip -iL targets.txt

# targets.txt content:
# 192.168.1.1
# 10.0.0.0/24
# example.com

IPv6:

prtip -6 2001:db8::1
prtip -6 2001:db8::/64

3.4: Port Specification

Specific Ports:

prtip -p 80,443,8080 TARGET

Port Range:

prtip -p 1-100 TARGET          # Ports 1-100
prtip -p- TARGET               # All ports (1-65535)

Common Ports (Fast):

prtip -F TARGET                # Top 100 ports

Exclude Ports:

prtip -p 1-1000 --exclude-ports 135,139,445 TARGET

Service Names:

prtip -p http,https,ssh TARGET   # Resolves to 80,443,22

3.5: Output Formats

Text (Default):

prtip -p 80,443 192.168.1.1
# Human-readable table output

Normal Output to File:

prtip -p 80,443 192.168.1.1 -oN scan_results.txt

JSON Output:

prtip -p 80,443 192.168.1.1 -oJ scan_results.json

XML Output (Nmap-compatible):

prtip -p 80,443 192.168.1.1 -oX scan_results.xml

Greppable Output:

prtip -p 80,443 192.168.1.1 -oG scan_results.gnmap

All Formats:

prtip -p 80,443 192.168.1.1 -oA scan_results
# Creates: scan_results.txt, .json, .xml, .gnmap

3.6: Timing Templates

Control scan speed and stealth:

Template Description Speed Stealth Use Case
-T0 Paranoid Slowest Highest IDS evasion
-T1 Sneaky Very Slow High Stealth scans
-T2 Polite Slow Medium Production networks
-T3 Normal (default) Medium Low Balanced
-T4 Aggressive Fast None Trusted networks
-T5 Insane Fastest None Local testing

Examples:

sudo prtip -sS -T0 -p 80,443 192.168.1.1   # Paranoid (IDS evasion)
sudo prtip -sS -T3 -p 1-1000 192.168.1.1   # Normal (default)
sudo prtip -sS -T4 -p- 192.168.1.1         # Aggressive (fast)

3.7: Service Detection

Basic Service Detection:

sudo prtip -sS -sV -p 1-1000 192.168.1.1

Intensity Levels (0-9):

sudo prtip -sS -sV --version-intensity 5 -p 80,443 192.168.1.1
# Higher intensity = more probes, more accurate, slower

OS Detection:

sudo prtip -sS -O -p 1-1000 192.168.1.1

Aggressive Detection (OS + Service + Scripts):

sudo prtip -A -p 1-1000 192.168.1.1
# Equivalent to: -sV -O -sC --traceroute

See Also:


4. Common Use Cases

Use Case 1: Network Discovery

Goal: Find all active hosts on local network

Command:

sudo prtip -sn 192.168.1.0/24

Explanation:

  • -sn: Ping scan only (no port scan)
  • 192.168.1.0/24: Scan entire /24 subnet (192.168.1.1-254)

Expected Output:

Host 192.168.1.1 is up (latency: 2.3ms)
Host 192.168.1.5 is up (latency: 1.8ms)
Host 192.168.1.10 is up (latency: 3.1ms)
...
Scan complete: 3 hosts up (254 scanned)

Follow-Up: Once you know active hosts, scan specific ones:

sudo prtip -sS -p 1-1000 192.168.1.5

Use Case 2: Port Scanning

2a: Common Ports (Fast)

Goal: Quickly identify common services

Command:

sudo prtip -sS -F 192.168.1.10

Explanation:

  • -F: Fast scan (top 100 ports)
  • Completes in seconds

Expected Output:

PORT    STATE  SERVICE
22/tcp  open   ssh
80/tcp  open   http
443/tcp open   https
3306/tcp open  mysql

2b: Full Port Scan

Goal: Comprehensive scan of all 65,535 ports

Command:

sudo prtip -sS -p- -T4 192.168.1.10 -oN fullscan.txt

Explanation:

  • -p-: All ports (1-65535)
  • -T4: Aggressive timing (faster)
  • -oN fullscan.txt: Save results

Note: Full scan can take 5-30 minutes depending on network and timing template.

2c: Custom Port List

Goal: Scan specific ports of interest

Command:

sudo prtip -sS -p 80,443,8080,8443,3000,3306 192.168.1.10

Explanation:

  • Web ports: 80, 443, 8080, 8443, 3000
  • Database port: 3306 (MySQL)

Use Case 3: Service Detection

Goal: Identify services and versions running on open ports

Command:

sudo prtip -sS -sV -p 1-1000 192.168.1.10

Expected Output:

PORT    STATE  SERVICE  VERSION
22/tcp  open   ssh      OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
80/tcp  open   http     Apache httpd 2.4.52 ((Ubuntu))
443/tcp open   https    Apache httpd 2.4.52 ((Ubuntu))
3306/tcp open  mysql    MySQL 8.0.33-0ubuntu0.22.04.2

Interpretation:

  • OpenSSH 8.9p1: SSH server version
  • Apache 2.4.52: Web server version
  • MySQL 8.0.33: Database version
  • Ubuntu Linux: Operating system hint

Use Case:

  • Vulnerability assessment (check for outdated versions)
  • Inventory management (document server configurations)

Use Case 4: OS Fingerprinting

Goal: Determine operating system of target

Command:

sudo prtip -sS -O -p 1-1000 192.168.1.10

Expected Output:

OS Detection Results:
OS: Linux 5.15 - 6.1 (Ubuntu 22.04)
Confidence: 95%
CPE: cpe:/o:canonical:ubuntu_linux:22.04

Interpretation:

  • OS: Linux kernel 5.15-6.1
  • Distribution: Ubuntu 22.04
  • Confidence: 95% (high confidence)

Use Case:

  • Network inventory
  • Vulnerability scanning (OS-specific exploits)
  • Compliance checks

Use Case 5: Stealth Scanning

Goal: Evade intrusion detection systems (IDS)

5a: Slow Timing (T0)

Command:

sudo prtip -sS -T0 -p 80,443,22 192.168.1.10

Explanation:

  • -T0: Paranoid timing (5-minute delays between packets)
  • Very slow but stealthy

5b: Fragmentation

Command:

sudo prtip -sS -f -p 80,443 192.168.1.10

Explanation:

  • -f: Fragment packets to evade simple packet filters

5c: Decoy Scanning

Command:

sudo prtip -sS -D RND:10 -p 80,443 192.168.1.10

Explanation:

  • -D RND:10: Use 10 random decoy IPs
  • Target sees scan from multiple sources

Expected Output:

Using decoys: 203.0.113.15, 198.51.100.42, ..., YOUR_IP, ...
Scanning 192.168.1.10...

5d: Idle/Zombie Scan

Command:

sudo prtip -sI 192.168.1.5 -p 80,443 192.168.1.10

Explanation:

  • -sI 192.168.1.5: Use 192.168.1.5 as zombie host
  • Target never sees your IP address

Note: Requires suitable zombie host (see 25-IDLE-SCAN-GUIDE.md)


Use Case 6: Performance Tuning

6a: Large-Scale Scanning

Goal: Scan thousands of hosts efficiently

Command:

sudo prtip -sS -F -T4 --max-rate 1000 10.0.0.0/16 -oG results.gnmap

Explanation:

  • 10.0.0.0/16: 65,536 hosts
  • -T4: Aggressive timing
  • --max-rate 1000: Limit to 1000 packets/second (network courtesy)
  • -oG: Greppable output for parsing

Performance:

  • Estimated time: 10-30 minutes (depending on network)
  • Tip: Use stateless scanning mode for even faster results (future feature)

6b: NUMA Optimization (Linux)

Goal: Maximize performance on multi-core systems

Command:

sudo prtip -sS -p 1-1000 --numa 192.168.1.0/24

Explanation:

  • --numa: Enable NUMA-aware thread pinning
  • Benefit: 10-30% performance improvement on NUMA systems

6c: Rate Limiting

Goal: Control scan speed to avoid network congestion, IDS detection, or server overload

6c.1: AdaptiveRateLimiterV3 (Default, Industry-Leading)

ProRT-IP uses AdaptiveRateLimiterV3, achieving -1.8% average overhead (faster than no rate limiting!).

Why V3 is Faster:

  • Two-Tier Convergence: Hostgroup + per-target scheduling
  • Relaxed Memory Ordering: Eliminates memory barriers (10-30ns savings)
  • Self-Correction: Convergence compensates for stale atomic reads
  • CPU Optimization: Better cache locality with rate limiting enabled

Performance Characteristics:

Rate (pps) Overhead Use Case
10K -8.2% Best case (CPU optimization dominant)
50K -1.8% Typical scan rate
75K-200K -3% to -4% Sweet spot
500K-1M +0% to +3.1% Near-zero at extreme rates

Basic Usage:

# Rate-limited scan (V3 automatic, 100K pps)
prtip -sS -p 80-443 --max-rate 100000 192.168.1.0/24

# High-speed scan (sweet spot: 75K-200K pps, -3% to -4% overhead)
prtip -sS -p 1-10000 --max-rate 150000 192.168.0.0/16

# Extreme rate (near-zero overhead at 500K-1M pps)
prtip -sS -p- --max-rate 500000 10.0.0.0/8

No Special Flags Needed:

  • V3 is automatic with --max-rate
  • Old --adaptive-v3 flag removed (V3 is default)
6c.2: Hostgroup Control

Limits concurrent targets being scanned simultaneously (Nmap-compatible).

Flags:

  • --max-hostgroup <N>: Maximum concurrent targets (default: 64)
  • --min-hostgroup <N>: Minimum concurrent targets (default: 1)
  • --max-parallelism <N>: Alias for --max-hostgroup

Usage:

# Network-friendly (16 hosts max)
prtip -sS -p- --max-hostgroup 16 10.0.0.0/24

# Aggressive (128 hosts)
prtip -sS -p 80,443 --max-hostgroup 128 targets.txt

# With minimum parallelism enforcement
prtip -sS -p 1-1000 --min-hostgroup 8 --max-hostgroup 64 10.0.0.0/16

Tuning Guidelines:

Value Range Network Impact Scan Speed IDS Detection Use Case
1-16 Minimal Slower Low risk Sensitive environments
32-128 Balanced Medium Some alerts General-purpose
256-1024 High Fast Likely detection Internal networks, pen tests
6c.3: Combined Rate Limiting

Stack V3 + Hostgroup for maximum control:

# Full rate limiting stack: V3 (50K pps) + Hostgroup (32 hosts max)
prtip -sS -p- \
  --max-rate 50000 \
  --max-hostgroup 32 \
  --min-hostgroup 8 \
  10.0.0.0/16
6c.4: ICMP Monitoring (Optional)

Purpose: Automatic backoff on ICMP Type 3 Code 13 errors (administratively prohibited)

Usage:

# Enable ICMP monitoring for adaptive backoff
prtip -sS -p 1-1000 --adaptive-rate 192.168.1.0/24

How It Works:

  1. Background task listens for ICMP packets
  2. Detects Type 3 Code 13 errors (rate limiting)
  3. Per-target exponential backoff (2s → 4s → 8s → 16s max)
  4. Scanner waits for backoff expiration before resuming

Platform Support:

  • Linux/macOS: Full support
  • Windows: Graceful degradation (ICMP monitor inactive)
6c.5: Timing Templates

Timing templates (T0-T5) automatically set rate limits:

Template Speed Max Rate (pps) Hostgroup Use Case
T0 (Paranoid) Very Slow 100 1 IDS evasion
T1 (Sneaky) Slow 1,000 1 Slow networks
T2 (Polite) Moderate 10,000 4 Default
T3 (Normal) Fast 50,000 16 Typical
T4 (Aggressive) Faster 100,000 64 Fast scans
T5 (Insane) Fastest 1,000,000 256 Maximum speed

Usage:

# Paranoid (very slow, IDS evasion)
prtip -T0 -p- target.com

# Aggressive (fast)
prtip -T4 -p 1-10000 192.168.0.0/16

# Insane (maximum speed, may trigger detection)
prtip -T5 -p- 10.0.0.0/8

Combining Templates with Manual Limits:

# T4 template + custom rate
prtip -T4 --max-rate 75000 -p- 192.168.0.0/16

# T3 template + custom hostgroup
prtip -T3 --max-hostgroup 32 -p 1-1000 10.0.0.0/24
6c.6: Performance Comparison

AdaptiveRateLimiterV3 vs No Limiting:

Scenario No Limit With V3 Overhead Result
SYN Scan (1K ports, 10K pps) 98.2ms 90.1ms -8.2% V3 FASTER
SYN Scan (1K ports, 50K pps) 7.3ms 7.2ms -1.8% V3 FASTER
SYN Scan (1K ports, 500K pps) 7.2ms 7.2ms +0.0% EQUAL

Key Insight: With V3's -1.8% average overhead, always use rate limiting for optimal performance!

Troubleshooting:

Issue: Slow convergence to target rate

# Increase --max-rate value
prtip -sS -p- --max-rate 100000 target.com

# Check network bottlenecks
ping target.com

Issue: "No targets scanned (all backed off)"

# All targets blocked with ICMP errors
# Solution: Disable --adaptive-rate or reduce --max-rate
prtip -sS -p- --max-rate 10000 target.com

Issue: "Active targets below min_hostgroup" warnings

# Not enough targets or slow progress
# Solution: Increase targets or reduce --min-hostgroup
prtip -sS -p- --min-hostgroup 4 small_target_list.txt

See Also:


Use Case 7: Firewall Testing

Goal: Determine firewall rules

Command:

sudo prtip -sA -p 80,443,22,25 192.168.1.10

Explanation:

  • -sA: ACK scan (firewall detection)
  • Differentiates filtered vs unfiltered ports

Expected Output:

PORT   STATE
80/tcp unfiltered   # Firewall allows traffic
443/tcp unfiltered  # Firewall allows traffic
22/tcp filtered     # Firewall blocks SSH
25/tcp filtered     # Firewall blocks SMTP

Interpretation:

  • Unfiltered: Port is accessible (firewall allows)
  • Filtered: Port is blocked by firewall

Use Case 8: SSL/TLS Analysis

Goal: Inspect SSL/TLS certificates

Command:

sudo prtip -sS -sV -p 443 --script ssl-cert 192.168.1.10

Expected Output:

PORT    STATE  SERVICE  VERSION
443/tcp open   https    Apache httpd 2.4.52

SSL Certificate:
Subject: CN=example.com
Issuer: CN=Let's Encrypt Authority X3
Valid From: 2025-01-01
Valid Until: 2025-04-01
Self-Signed: No

Use Case:

  • Certificate expiration monitoring
  • Security audit (identify self-signed certs)
  • Compliance checks

See Also:


Use Case 9: IPv6 Scanning

Goal: Scan IPv6 networks

9a: Single IPv6 Host

Command:

sudo prtip -6 -sS -p 80,443 2001:db8::1

Explanation:

  • -6: Force IPv6
  • 2001:db8::1: IPv6 address

9b: IPv6 Subnet

Command:

sudo prtip -6 -sS -p 80,443 2001:db8::/64

Warning: IPv6 /64 subnets are huge (2^64 addresses). Use targeted scanning or discovery first.

9c: Dual-Stack Scanning

Command:

sudo prtip -sS -p 80,443 example.com

Explanation:

  • Automatically scans both IPv4 and IPv6 if available
  • Use --prefer-ipv6 or --prefer-ipv4 to control preference

See Also:


Use Case 10: Plugin System

Goal: Extend ProRT-IP with custom Lua plugins for detection, output, and scanning

10.1: Plugin Types

ProRT-IP supports three plugin types:

Type Purpose Use Cases Example
ScanPlugin Scan lifecycle hooks Pre/post-scan processing, custom data collection Event logger
OutputPlugin Custom output formats CSV, JSON, XML, database export Database exporter
DetectionPlugin Enhanced service detection Banner analysis, active probing banner-analyzer

10.2: Using Plugins

Basic Usage:

# Load single plugin
sudo prtip -sS -sV -p 80,443 --plugin banner-analyzer 192.168.1.10

# Load multiple plugins
sudo prtip -sS -sV -p 80,443 \
    --plugin banner-analyzer \
    --plugin ssl-checker \
    192.168.1.10

List Available Plugins:

prtip --list-plugins

Output:

Available Plugins (2 found):

banner-analyzer (v1.0.0) [DetectionPlugin]
  Author: ProRT-IP Team
  Description: Enhanced banner analysis for HTTP, SSH, FTP, SMTP, MySQL, PostgreSQL
  Capabilities: None (passive analysis)
  Location: ~/.prtip/plugins/banner-analyzer/

ssl-checker (v1.0.0) [DetectionPlugin]
  Author: ProRT-IP Team
  Description: SSL/TLS service detection and analysis
  Capabilities: network
  Location: ~/.prtip/plugins/ssl-checker/

10.3: Plugin Directory Structure

Installation Location:

  • User plugins: ~/.prtip/plugins/
  • System plugins: /opt/prtip/plugins/ (requires root)

Plugin Structure:

~/.prtip/plugins/my-plugin/
├── plugin.toml    # Metadata (required)
├── main.lua       # Implementation (required)
└── README.md      # Documentation (recommended)

plugin.toml Example:

[plugin]
name = "my-plugin"
version = "1.0.0"
author = "Your Name <your.email@example.com>"
description = "One-line plugin description"
plugin_type = "detection"  # scan, output, or detection
capabilities = []  # Required permissions: network, filesystem, system, database

main.lua Example:

function on_load(config)
    prtip.log("info", "My plugin loaded")
    return true
end

function on_unload()
    prtip.log("info", "My plugin unloaded")
end

function analyze_banner(banner)
    if string.match(banner, "HTTP") then
        return {
            service = "http",
            confidence = 0.8
        }
    end
    return nil
end

10.4: Plugin API Reference

Global prtip Table:

All ProRT-IP functions exposed through prtip.*:

Logging:

prtip.log("info", "Message")   -- Levels: debug, info, warn, error

Target Information:

local target = prtip.get_target()
-- Returns: {ip: "192.168.1.1", port: 80, protocol: "tcp"}

Network Operations (requires network capability):

-- Connect
local socket_id = prtip.connect("192.168.1.1", 80, 5.0)  -- IP, port, timeout

-- Send
local bytes_sent = prtip.send(socket_id, "GET / HTTP/1.0\r\n\r\n")

-- Receive
local data = prtip.receive(socket_id, 4096, 5.0)  -- max_bytes, timeout

-- Close
prtip.close(socket_id)

Result Manipulation:

prtip.add_result("custom_field", "custom_value")

10.5: Security Model

Capabilities (Deny-by-Default):

Capability Description Risk Level
network Network connections Medium
filesystem File I/O operations High
system System commands Critical
database Database access Medium

Request Capabilities in plugin.toml:

capabilities = ["network", "filesystem"]

Sandboxing:

  • Dangerous Lua libraries removed: io, os, debug, package.loadlib
  • Safe libraries: string, table, math, prtip
  • Resource limits: 100MB memory, 5 seconds CPU, 1M instructions

Example Violation:

-- This will fail (io library removed)
local file = io.open("file.txt", "r")
-- Error: attempt to index nil value 'io'

10.6: Example Plugins

banner-analyzer (Included):

  • Purpose: Enhanced banner analysis for common services
  • Detects: HTTP, SSH, FTP, SMTP, MySQL, PostgreSQL, Redis, MongoDB
  • Capabilities: None (passive analysis)
  • Usage: --plugin banner-analyzer

ssl-checker (Included):

  • Purpose: SSL/TLS service detection
  • Detects: TLS ports (443, 465, 993, 995), protocol signatures
  • Capabilities: network (active probing)
  • Usage: --plugin ssl-checker

10.7: Creating Your First Plugin

Step 1: Create directory

mkdir -p ~/.prtip/plugins/my-detector
cd ~/.prtip/plugins/my-detector

Step 2: Write plugin.toml

[plugin]
name = "my-detector"
version = "1.0.0"
author = "Your Name"
description = "Custom service detector"
plugin_type = "detection"
capabilities = []

Step 3: Write main.lua

function on_load(config)
    prtip.log("info", "my-detector loaded")
    return true
end

function on_unload()
    prtip.log("info", "my-detector unloaded")
end

function analyze_banner(banner)
    if string.match(banner, "CUSTOM") then
        return {
            service = "custom",
            product = "CustomApp",
            confidence = 0.9
        }
    end
    return nil
end

Step 4: Test plugin

# List plugins
prtip --list-plugins

# Test with scan
prtip -sS -sV -p 80 127.0.0.1 --plugin my-detector

Step 5: Write README.md Document plugin purpose, usage, API, troubleshooting.

Troubleshooting:

Issue: Plugin not loading

# Check file locations
ls -la ~/.prtip/plugins/my-plugin/

# Verify plugin.toml syntax
cat ~/.prtip/plugins/my-plugin/plugin.toml

# Check logs
prtip --log-level debug --list-plugins

Issue: Capability errors

Error: Plugin lacks 'network' capability

Solution: Add to plugin.toml:

capabilities = ["network"]

Issue: Resource limit exceeded

Error: Instruction limit of 1000000 exceeded

Solution: Optimize Lua code (reduce loops, reuse tables)

See Also:


Use Case 11: Batch Scanning

Goal: Scan multiple targets from file

Command:

sudo prtip -sS -p 80,443 -iL targets.txt -oA batch_results

targets.txt:

192.168.1.10
192.168.1.20
10.0.0.0/24
example.com

Output:

  • batch_results.txt (normal output)
  • batch_results.json (JSON)
  • batch_results.xml (XML)
  • batch_results.gnmap (greppable)

Use Case 12: Output Processing

Goal: Parse scan results programmatically

12a: JSON Output

Command:

sudo prtip -sS -p 80,443 192.168.1.10 -oJ results.json

Parse with jq:

cat results.json | jq '.hosts[] | select(.state == "up") | .address'
# Output: "192.168.1.10"

cat results.json | jq '.hosts[].ports[] | select(.state == "open") | .port'
# Output: 80, 443

12b: Greppable Output

Command:

sudo prtip -sS -p 1-1000 192.168.1.0/24 -oG results.gnmap

Parse with grep:

# Find all hosts with port 22 open
grep "22/open" results.gnmap

# Count hosts with SSH
grep -c "22/open" results.gnmap

Use Case 13: Integration with CI/CD

Goal: Automate security scanning in CI/CD pipeline

GitLab CI Example:

security_scan:
  stage: test
  image: rust:1.85
  script:
    - cargo install prtip
    - prtip -sS -p 80,443 staging.example.com -oJ scan_results.json
    - python3 check_vulnerabilities.py scan_results.json
  artifacts:
    paths:
      - scan_results.json
    expire_in: 30 days

GitHub Actions Example:

name: Security Scan

on:
  push:
    branches: [main]

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install ProRT-IP
        run: |
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
          source $HOME/.cargo/env
          cargo install prtip
      - name: Run Scan
        run: sudo prtip -sS -p 1-1000 staging.example.com -oJ scan.json
      - name: Upload Results
        uses: actions/upload-artifact@v3
        with:
          name: scan-results
          path: scan.json

Use Case 14: Custom Payloads (UDP)

Goal: Probe UDP services with protocol-specific payloads

Command:

sudo prtip -sU -p 53,161,123,137 192.168.1.10

Explanation:

  • Port 53: DNS query payload
  • Port 161: SNMP get-request
  • Port 123: NTP query
  • Port 137: NetBIOS name query

ProRT-IP automatically uses appropriate payloads for 8 common UDP protocols.


Use Case 15: Timing Control

Goal: Fine-tune scan timing for specific scenarios

15a: Production Network (Polite)

Command:

sudo prtip -sS -T2 -p 1-1000 192.168.1.10

Timing:

  • Scan delay: 400ms between probes
  • Won't overwhelm production networks

15b: Local Testing (Fast)

Command:

sudo prtip -sS -T5 -p- 127.0.0.1

Timing:

  • Minimal delays
  • Maximum speed for local testing

Use Case 16: Multiple Scan Types

Goal: Combine TCP SYN and UDP scanning

Command:

sudo prtip -sS -sU -p 1-100 192.168.1.10

Explanation:

  • Scans TCP ports 1-100 with SYN scan
  • Scans UDP ports 1-100 with UDP scan
  • Comprehensive coverage

Use Case 17: Evasion Techniques

Goal: Combine multiple evasion techniques

Command:

sudo prtip -sS -T1 -f --ttl 64 -D RND:5 -p 80,443 192.168.1.10

Explanation:

  • -T1: Sneaky timing
  • -f: Fragmentation
  • --ttl 64: Custom TTL (mimic different OS)
  • -D RND:5: 5 random decoy IPs

Use Case: Maximum stealth for penetration testing


Use Case 18: Internet-Scale Scanning

Goal: Scan large public IP ranges (responsible disclosure)

Warning: Only scan networks you own or have permission to scan.

Command:

sudo prtip -sS -F --max-rate 500 203.0.113.0/24 -oG internet_scan.gnmap

Best Practices:

  • Use --max-rate to avoid overwhelming networks
  • Scan only essential ports (-F for top 100)
  • Use greppable output for post-processing
  • Respect robots.txt and scan policies

Use Case 19: Idle Scan Anonymous Scanning

Goal: Scan target without revealing your IP

Command:

# 1. Find zombie host
sudo prtip -sI RND 192.168.1.0/24

# 2. Use discovered zombie
sudo prtip -sI 192.168.1.5 -p 80,443 TARGET

Explanation:

  • -sI RND: Discover suitable zombie hosts
  • -sI 192.168.1.5: Use specific zombie
  • Target logs show zombie IP, not your IP

Warning: Ethical use only.

See Also:


Use Case 20: Performance Benchmarking

Goal: Validate ProRT-IP performance claims and track regression

20a: Running Benchmarks Locally

Prerequisites:

  • hyperfine installed: cargo install hyperfine
  • ProRT-IP release binary built: cargo build --release

Command:

cd benchmarks/05-Sprint5.9-Benchmarking-Framework
./scripts/run-all-benchmarks.sh

Output:

ProRT-IP Benchmarking Framework
Date: 2025-11-07 14:35:00
Binary: /home/user/ProRT-IP/target/release/prtip
Version: 0.5.0

Running: 01-syn-scan-1000-ports.sh
Benchmark 1: prtip -sS -p 1-1000 127.0.0.1
  Time (mean ± σ):      98.2 ms ±   4.5 ms    [User: 12.3 ms, System: 23.4 ms]
  Range (min … max):    90.1 ms … 108.9 ms    10 runs
✅ PASS (within target <100ms)
...

Benchmark Scenarios:

# Scenario Purpose Target
1 SYN Scan (1K ports) Throughput validation <100ms
2 Connect Scan (3 ports) Real-world baseline <50ms
3 UDP Scan (3 services) Slow protocol <500ms
4 Service Detection Overhead measurement <10%
5 IPv6 Overhead IPv4 vs IPv6 <15%
6 Idle Scan Timing Stealth cost 500-800ms/port
7 Rate Limiting V3 Performance claim -1.8% overhead
8 TLS Cert Parsing Certificate speed ~1.33μs

20b: Interpreting Results

hyperfine Output Fields:

  • mean ± σ: Average time ± standard deviation
  • Range: Fastest and slowest runs
  • User: CPU time in user space
  • System: CPU time in kernel (syscalls)

Good Results (Reproducible):

  • Stddev <5% of mean (e.g., 98.2ms ± 4.5ms = 4.6%)
  • Narrow range (max <20% higher than min)
  • User + System ≈ mean (CPU-bound)

Bad Results (High Variance):

  • Stddev >10% of mean
  • Wide range (max >50% higher than min)
  • User + System << mean (I/O-bound or waiting)

Regression Detection:

# Compare against baseline
./scripts/analyze-results.sh \
    baselines/baseline-v0.5.0.json \
    results/current.json

# Exit codes:
#   0 = PASS or IMPROVED
#   1 = WARN (5-10% slower)
#   2 = FAIL (>10% slower)

20c: CI Integration

Automated Testing:

  • Runs on every PR (GitHub Actions)
  • Compares against baseline
  • Posts results as PR comment

Example PR Comment:

## Benchmark Results

| Scenario | Baseline | Current | Diff | Status |
|----------|----------|---------|------|--------|
| SYN Scan | 98ms | 95ms | -3.1% | ✅ IMPROVED |
| Connect  | 45ms | 46ms | +2.2% | ✅ PASS |
| UDP      | 520ms | 540ms | +3.8% | ✅ PASS |
| Service  | 55ms | 62ms | +12.7% | ❌ REGRESSION |

20d: Performance Optimization Tips

Based on benchmark results:

  1. High System Time (>40%): Reduce syscalls (batch operations)
  2. Negative Overhead (V3): Rate limiting actually improves performance!
  3. Wide Range: Reduce background processes, disable frequency scaling

Troubleshooting:

Issue: hyperfine not found

cargo install hyperfine

Issue: High variance (stddev >10%)

# Pin CPU frequency (Linux)
sudo cpupower frequency-set --governor performance

# Increase runs
hyperfine --runs 20 <command>

Issue: Network benchmarks fail

# Check connectivity
ping target.com

# Use local target
prtip -sS -p 80 127.0.0.1

See Also:


Use Case 21: Rate Limiting Validation

Goal: Test rate limiting effectiveness

Command:

sudo prtip -sS -p 80 --max-rate 10 192.168.1.10

Explanation:

  • --max-rate 10: Limit to 10 packets/second
  • Verify network doesn't get overwhelmed

Benchmark:

# Measure actual packet rate
sudo prtip -sS -p 1-1000 --max-rate 100 192.168.1.10 | grep "packets/second"

See: 26-RATE-LIMITING-GUIDE.md for v3 rate limiter details


5. Configuration

5.1: Configuration File

Location Hierarchy:

  1. ./prtip.toml (current directory, highest priority)
  2. ~/.config/prtip/config.toml (user config)
  3. /etc/prtip/config.toml (system config, lowest priority)

Create User Config:

mkdir -p ~/.config/prtip
nano ~/.config/prtip/config.toml

Example Config:

[scan]
default_scan_type = "syn"  # sS by default
default_ports = "1-1000"
timeout = 5000  # milliseconds
max_retries = 3

[timing]
template = "normal"  # T3
min_rate = 10
max_rate = 1000

[output]
default_format = "text"
colorize = true
verbose = false

[performance]
numa = false
batch_size = 1000

[plugins]
enabled = true
plugin_dir = "~/.prtip/plugins"

5.2: Environment Variables

Variable Description Example
PRTIP_CONFIG Config file path /path/to/config.toml
PRTIP_PLUGIN_DIR Plugin directory /usr/share/prtip/plugins
RUST_LOG Logging level debug, info, warn, error
PRTIP_MAX_RATE Default max rate 1000

Usage:

export PRTIP_CONFIG=~/my-config.toml
export RUST_LOG=debug
sudo -E prtip -sS -p 80,443 192.168.1.10

5.3: CLI Flag Reference

See full reference: 14-NMAP-COMPATIBILITY.md

Essential Flags:

# Scan Types
-sT          # TCP Connect scan
-sS          # TCP SYN scan
-sU          # UDP scan
-sF/-sN/-sX  # Stealth scans (FIN/NULL/Xmas)
-sA          # ACK scan (firewall detection)
-sI ZOMBIE   # Idle/zombie scan

# Target Specification
-iL FILE     # Input from file
-6           # Force IPv6
-4           # Force IPv4

# Port Specification
-p PORTS     # Port ranges (e.g., 80,443,1-1000)
-F           # Fast scan (top 100 ports)
-p-          # All ports (1-65535)

# Service/OS Detection
-sV          # Service version detection
-O           # OS detection
-A           # Aggressive (OS + service + scripts)

# Timing
-T0 to -T5   # Timing templates (paranoid to insane)
--min-rate N # Minimum packet rate
--max-rate N # Maximum packet rate

# Evasion
-f           # Fragment packets
--mtu SIZE   # Custom MTU
--ttl VALUE  # Set IP TTL
-D DECOYS    # Decoy scanning
-g PORT      # Source port spoofing

# Output
-oN FILE     # Normal output
-oJ FILE     # JSON output
-oX FILE     # XML output
-oG FILE     # Greppable output
-oA BASE     # All formats

# Performance
--numa       # NUMA optimization
--batch-size # Batch size for parallelism

# Plugins
--plugin NAME # Load plugin

6. Troubleshooting

6.1: Permission Errors

Error:

Error: Permission denied (raw socket creation)

Solution:

# Option 1: Run with sudo (simple)
sudo prtip -sS -p 80,443 192.168.1.1

# Option 2: Set capabilities (Linux, persistent)
sudo setcap cap_net_raw,cap_net_admin=eip /usr/local/bin/prtip
prtip -sS -p 80,443 192.168.1.1  # No sudo needed

# Option 3: Use TCP Connect scan (no root required)
prtip -sT -p 80,443 192.168.1.1

6.2: Network Unreachable

Error:

Error: Network is unreachable

Possible Causes:

  1. Target is offline
  2. Routing issue
  3. Firewall blocking

Diagnosis:

# 1. Verify target is reachable
ping 192.168.1.1

# 2. Check routing
ip route get 192.168.1.1

# 3. Check firewall (Linux)
sudo iptables -L -n

6.3: Slow Scanning

Problem: Scan taking too long

Solutions:

# 1. Use faster timing template
sudo prtip -sS -T4 -p 1-1000 192.168.1.1

# 2. Scan fewer ports
sudo prtip -sS -F 192.168.1.1  # Top 100 instead of all

# 3. Increase parallelism (carefully)
sudo prtip -sS --batch-size 2000 -p 1-1000 192.168.1.1

# 4. Use NUMA optimization (Linux)
sudo prtip -sS --numa -p 1-1000 192.168.1.1

Note: Very fast scans may trigger IDS/IPS. Balance speed vs stealth.


6.4: High CPU Usage

Problem: prtip consuming too much CPU

Solutions:

# 1. Reduce batch size
sudo prtip -sS --batch-size 500 -p 1-1000 192.168.1.1

# 2. Use slower timing
sudo prtip -sS -T2 -p 1-1000 192.168.1.1

# 3. Limit max rate
sudo prtip -sS --max-rate 100 -p 1-1000 192.168.1.1

# 4. Check system resources
top -p $(pgrep prtip)

6.5: Platform-Specific Issues

Windows: Npcap Not Found

Error:

Error: Npcap not installed or not found

Solution:

  1. Download Npcap from https://npcap.com/
  2. Run installer
  3. ✅ Check "Install Npcap in WinPcap API-compatible Mode"
  4. Restart Command Prompt/PowerShell
  5. Retry scan

macOS: Permission Denied on /dev/bpf*

Error:

Error: Permission denied (/dev/bpf0)

Solution:

# Option 1: Run with sudo
sudo prtip -sS -p 80,443 192.168.1.1

# Option 2: Install ChmodBPF (advanced, non-root access)
# See: https://github.com/wireshark/wireshark/tree/master/packaging/macosx/ChmodBPF

Linux: libpcap Not Found

Error:

Error: libpcap.so.1: cannot open shared object file

Solution:

# Debian/Ubuntu
sudo apt install libpcap0.8

# Fedora/RHEL
sudo dnf install libpcap

# Arch Linux
sudo pacman -S libpcap

6.6: Common Mistakes

Mistake 1: Forgetting sudo for SYN Scan

Wrong:

prtip -sS -p 80,443 192.168.1.1
# Error: Permission denied

Correct:

sudo prtip -sS -p 80,443 192.168.1.1

Mistake 2: Scanning Without Permission

Wrong:

sudo prtip -sS -p 1-65535 8.8.8.8
# Illegal: Scanning Google DNS without permission

Correct:

# Only scan networks you own or have written permission to test
sudo prtip -sS -p 1-1000 scanme.nmap.org  # Nmap provides this for testing

Mistake 3: Using Wrong Port Syntax

Wrong:

sudo prtip -sS -p 80-443 192.168.1.1
# This scans ports 80 to 443 (364 ports), not just 80 and 443

Correct:

sudo prtip -sS -p 80,443 192.168.1.1
# Scan only ports 80 and 443

6.7: Debug Mode

Enable Detailed Logging:

RUST_LOG=debug sudo -E prtip -sS -p 80,443 192.168.1.1 2>&1 | tee debug.log

Explanation:

  • RUST_LOG=debug: Maximum verbosity
  • sudo -E: Preserve environment variables
  • 2>&1: Capture stderr and stdout
  • | tee debug.log: Save to file and display

Review Logs:

cat debug.log | grep ERROR
cat debug.log | grep WARN

7. FAQ

Q1: How does ProRT-IP compare to Nmap?

A: ProRT-IP aims for feature parity with Nmap while offering:

  • Performance: 10-30% faster due to Rust's zero-cost abstractions
  • Safety: Memory-safe (no buffer overflows, use-after-free bugs)
  • Extensibility: Lua plugin system for custom detection
  • Modern Codebase: Actively developed with latest Rust ecosystem

Feature Comparison:

  • ✅ Scan Types: Full parity (SYN, Connect, UDP, Stealth, Idle)
  • ✅ Service Detection: 85-90% accuracy (Nmap: 90-95%)
  • ✅ OS Fingerprinting: 2,000+ signatures (Nmap: 2,600+)
  • ✅ Evasion: Full parity (fragmentation, TTL, decoys, idle)
  • 🔄 NSE Scripts: Lua plugins (partial parity, growing)

See: Feature Comparison Chart


Q2: What are the system requirements?

Minimum:

  • CPU: 1 core
  • RAM: 512 MB
  • Disk: 100 MB
  • OS: Linux 4.15+, Windows 10+, macOS 11.0+, FreeBSD 12+

Recommended:

  • CPU: 4+ cores (better parallelism)
  • RAM: 4 GB
  • Disk: 500 MB (with room for results)
  • Network: 100 Mbps+ for large-scale scanning

Optimal (Large-Scale):

  • CPU: 8+ cores, NUMA-aware
  • RAM: 16 GB
  • Network: 1 Gbps+ with dedicated NIC
  • Disk: SSD for result storage

Q3: How do I scan IPv6 networks?

A: Use the -6 flag:

# Single IPv6 host
sudo prtip -6 -sS -p 80,443 2001:db8::1

# IPv6 subnet (small /120 subnet)
sudo prtip -6 -sS -p 80,443 2001:db8::0/120

# Dual-stack (both IPv4 and IPv6)
sudo prtip -sS -p 80,443 example.com

Important: IPv6 /64 subnets are impractically large (2^64 hosts). Use targeted scanning based on known patterns or discovered hosts.

See: 23-IPv6-GUIDE.md for complete guide


Q4: Can I use plugins?

A: Yes! ProRT-IP supports Lua plugins (v0.4.8+):

Load Plugin:

sudo prtip -sS -sV --plugin banner-analyzer -p 80,443 192.168.1.1

Available Plugins:

  • banner-analyzer: Enhanced banner parsing (HTTP, SSH, SMB, etc.)
  • ssl-checker: TLS certificate validation

Create Your Own: See 30-PLUGIN-SYSTEM-GUIDE.md for plugin development guide.

Plugin Directory:

  • User: ~/.prtip/plugins/
  • System: /usr/share/prtip/plugins/

Q5: Is it legal to scan networks?

A: It depends on ownership and permission.

Legal:

  • ✅ Scanning your own networks
  • ✅ Scanning with written permission (penetration testing contracts)
  • ✅ Scanning designated test targets (e.g., scanme.nmap.org)
  • ✅ Scanning localhost (127.0.0.1)

Illegal:

  • ❌ Scanning networks without permission (Computer Fraud and Abuse Act in US, Computer Misuse Act in UK, etc.)
  • ❌ Unauthorized penetration testing
  • ❌ Scanning to cause harm or disruption

Best Practices:

  1. Get Written Permission: Always obtain written authorization before scanning
  2. Respect Scope: Only scan agreed-upon IP ranges and services
  3. Be Courteous: Use rate limiting (--max-rate) to avoid disrupting networks
  4. Document: Keep logs of scans for audit trails
  5. Follow Laws: Know local cybersecurity laws

Disclaimer: ProRT-IP is a legitimate security tool. Users are responsible for legal and ethical use.


Q6: How do I contribute?

A: We welcome contributions!

Ways to Contribute:

  1. Report Bugs: GitHub Issues
  2. Feature Requests: GitHub Discussions
  3. Code Contributions: See CONTRIBUTING.md
  4. Documentation: Improve guides, tutorials, examples
  5. Plugins: Create and share Lua plugins

Development Setup:

git clone https://github.com/doublegate/ProRT-IP.git
cd ProRT-IP
cargo build
cargo test

Pull Request Process:

  1. Fork repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Make changes with tests
  4. Ensure cargo test, cargo clippy, cargo fmt pass
  5. Submit PR with description

Q7: What output format should I use?

A: Depends on use case:

Format Use Case Command
Text Human reading, terminal output -oN file.txt (default)
JSON Programmatic parsing, APIs -oJ file.json
XML Nmap compatibility, tools integration -oX file.xml
Greppable Shell scripting, grep/awk processing -oG file.gnmap
PCAPNG Packet analysis, Wireshark --pcap file.pcapng

Recommendation:

  • Interactive: Text (default)
  • Automation: JSON (easy to parse)
  • Nmap Tools: XML (drop-in replacement)
  • Scripts: Greppable (one line per host)

Q8: How accurate is service detection?

A: ProRT-IP achieves 85-90% accuracy:

Detection Methods:

  1. NULL Probe: Listen for self-announcing services (FTP, SSH banners)
  2. Protocol Probes: 187 embedded nmap-service-probes
  3. Banner Parsing: HTTP headers, SSH versions, SMB dialects, etc.
  4. TLS Handshake: Extract certificate details

Accuracy Factors:

  • Intensity Level: Higher = more probes = more accurate (but slower)
  • Protocol Support: Well-known services (HTTP, SSH, MySQL) = high accuracy
  • Custom Services: May require custom plugins

Comparison:

  • Nmap: 90-95% (slightly higher due to larger probe database)
  • ProRT-IP: 85-90% (good, improving)

See: 24-SERVICE-DETECTION-GUIDE.md for details


Q9: What about IPv6 support?

A:Complete IPv6 support (Sprint 5.1, v0.4.1+):

Supported:

  • All 6 scan types (Connect, SYN, UDP, Stealth, Idle, Discovery)
  • Dual-stack scanning (automatic IPv4/IPv6 selection)
  • IPv6-specific discovery (ICMPv6, NDP)
  • Decoy scanning with random IPv6 generation

Flags:

  • -6: Force IPv6
  • -4: Force IPv4
  • --prefer-ipv6: Prefer IPv6 when both available
  • --ipv6-only: IPv6 exclusive mode

Performance:

  • <15% overhead vs IPv4 (production-ready)

See: 23-IPv6-GUIDE.md for complete coverage


Q10: How do I report security issues?

A: Responsible Disclosure Process:

  1. Report via GitHub: Use Security Advisories for private disclosure
  2. Include:
    • Vulnerability description
    • Steps to reproduce
    • Potential impact
    • Suggested fix (if any)
  3. Response Time: We aim to respond within 48 hours
  4. Fix Timeline: Critical issues fixed within 7 days, others within 30 days
  5. Public Disclosure: After fix is released and deployed

Please DO NOT:

  • Open public GitHub issues for security vulnerabilities
  • Exploit vulnerabilities maliciously
  • Disclose publicly before fix is available

Bug Bounty: Coming soon (post-v1.0)

See: SECURITY.md for security policy


8. CLI User Experience Features

ProRT-IP provides professional-quality CLI experience with enhanced help, intelligent error messages, real-time progress tracking, safety confirmations, and productivity shortcuts.

8.1 Scan Templates

Scan templates provide one-command access to common scanning scenarios, eliminating the need to memorize complex flag combinations.

Built-in Templates (10 total):

# Web Server Scanning
prtip --template web-servers 192.168.1.0/24
# Equivalent to: -p 80,443,8080,8443 -sV --script http-*

# Database Discovery
prtip --template databases 192.168.1.1
# Equivalent to: -p 3306,5432,27017,6379,1521 -sV

# Quick Scan (Top 100 Ports)
prtip --template quick 192.168.1.0/24
# Equivalent to: -F -T4 -sS

# Comprehensive Scan
prtip --template thorough 192.168.1.1
# Equivalent to: -p- -T3 -sV -O

# Stealth Scan (Evasion)
prtip --template stealth 192.168.1.1
# Equivalent to: -sF -T0 -f -D RND:5

# SSL/TLS Analysis
prtip --template ssl-only 192.168.1.1
# Equivalent to: -p 443,8443,993,995,465,636,3389 -sV --tls-analysis

# More: discovery, admin-panels, mail-servers, file-shares

Template Management:

# List all available templates
prtip --list-templates

# Show template details
prtip --show-template web-servers

# Override template values
prtip --template quick -p 1-10000  # Override port range
prtip --template stealth -T3       # Override timing

Custom Templates (~/.prtip/templates.toml):

[templates.staging-web]
description = "Scan staging environment web servers"
ports = "80,443,3000,8080,8443"
scan_type = "syn"
timing = "T4"
service_detection = true

See Also: CHANGELOG.md Sprint 5.5.2, PHASE-5.5 TODO


8.2 Enhanced Help System

Multi-page help with fuzzy search enables quick discovery of any flag or feature.

Help Categories:

# Show all help categories
prtip help

# Topic-specific help
prtip help scan-types    # Connect, SYN, UDP, Stealth, Idle
prtip help timing        # T0-T5 templates, custom timing
prtip help output        # Output formats, filtering, storage
prtip help targeting     # CIDR, ranges, files, exclusions
prtip help detection     # Service, OS, banner grabbing
prtip help evasion       # Fragmentation, decoys, stealth
prtip help advanced      # IPv6, NUMA, plugins, rate limiting
prtip help examples      # Common usage scenarios

Searchable Help (Fuzzy Matching):

# Search across all help content
prtip help search "certificate"
# Finds: --tls-analysis, --tls-versions, TLS certificate guide

# Typo tolerance (edit distance ≤ 2)
prtip help search "syn scn"
# Finds: "SYN scan" topics with keyword highlighting

See Also: --help, prtip help examples


8.3 Progress Indicators with ETA

Real-time progress tracking with estimated time to completion, throughput metrics, and multi-stage visualization.

Progress Styles:

# Compact (default)
[Stage 3/5] Port Scanning ▓▓▓▓▓▓▓▓▓░ 87% | ETA: 3m 24s

# Detailed
prtip --progress-style detailed -sS -p- 192.168.1.0/24
# Shows: percentage, ETA, packets/sec, hosts/min, bandwidth

# Multi-stage Bars
prtip --progress-style bars -sS -sV -p 1-1000 192.168.1.0/24
# Stage 1: Target Resolution   ▓▓▓▓▓▓▓▓▓▓ 100%
# Stage 2: Host Discovery      ▓▓▓▓▓▓▓▓▓▓ 100%
# Stage 3: Port Scanning        ▓▓▓▓▓▓▓▓░░  87%
# Stage 4: Service Detection    ▓░░░░░░░░░  10%
# Stage 5: Finalization         ░░░░░░░░░░   0%
# Overall ▓▓▓▓▓░░░░░ 52% | ETA: 3m 24s | 1,240 pps | 42 hpm

ETA Algorithms:

  • Linear ETA: Simple current-rate projection
  • EWMA ETA: Exponentially Weighted Moving Average (α=0.2, smooths fluctuations)
  • Multi-stage ETA: Weighted prediction across 5 scan stages

Color-Coded Speed:

  • 🟢 Green: On track (<10% over ETA)
  • 🟡 Yellow: Slow (10-25% over ETA)
  • 🔴 Red: Very slow (>25% over ETA)

Disable Progress (CI/Automation):

prtip --no-progress -sS -p 80,443 192.168.1.0/24
prtip --progress-interval 5 -sS -p- 192.168.1.0/24  # Update every 5s

See Also: --progress-style, --progress-interval, --no-progress


8.4 Interactive Confirmations

Smart confirmations protect against accidental execution of dangerous operations.

Protected Operations:

# Internet-scale scans (0.0.0.0/0, ::/0)
prtip -sS -p 80,443 0.0.0.0/0
# ⚠️  Warning: Internet-scale scan detected
# Target: 0.0.0.0/0 (entire IPv4 internet)
# Estimated hosts: 4,294,967,296
# Estimated duration: 7 days 18 hours
# Legal risks: HIGH (may violate ToS, trigger IDS/IPS)
# Are you sure you want to proceed? [y/N]

# Large target sets (>10K hosts)
prtip -sS -p 80,443 10.0.0.0/8
# ⚠️  Warning: Large scan detected
# Scanning 16,777,216 hosts. Estimated duration: 4 days 6 hours
# Continue? [y/N]

# Aggressive timing (T5)
prtip -T5 -sS -p 80,443 192.168.1.1
# ⚠️  Warning: T5 is VERY aggressive
# May trigger IDS/IPS. Continue? [y/N]

# Evasion techniques (fragmentation, decoys)
prtip -f -D RND:10 -sS -p 80,443 192.168.1.1
# ⚠️  Warning: Evasion techniques may be illegal in your jurisdiction
# Continue? [y/N]

# Root/elevated privileges
sudo prtip -sS -p 80,443 192.168.1.1
# ℹ️  Info: Running as root. Drop privileges after socket creation? [Y/n]

Smart Skip Logic (Auto-bypass):

Confirmations are automatically skipped when:

  • Running in non-interactive terminal (CI/CD, automation)
  • --yes flag provided
  • Target set is "safe" (RFC1918 private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
  • Timing is polite (T0-T2)

Automation Mode:

# Bypass all confirmations (CI/CD)
prtip --yes -sS -p 80,443 0.0.0.0/0

See Also: --yes, SECURITY.md


8.5 Command History & Replay

Automatic scan history with replay capability for rapid re-execution and modification.

View History:

# Show last 20 commands
prtip history

# Output:
# [1] 2025-11-08 14:23:45 | prtip -sS -p 80,443 192.168.1.1 (12 results)
# [2] 2025-11-08 14:45:12 | prtip -sT -p 1-1000 10.0.0.1 (245 results)
# [3] 2025-11-08 15:10:33 | prtip --template web-servers 192.168.1.0/24 (89 results)

# Show last N commands
prtip history 50

Replay Commands:

# Re-run specific command by index
prtip replay 2

# Re-run most recent command
prtip replay --last

# Replay with modifications
prtip replay 3 -p 1-10000        # Change port range
prtip replay --last --template thorough  # Add template

Storage:

  • Location: ~/.prtip/history.json
  • Format: JSON with timestamps, args, summaries
  • Auto-rotation: Keeps latest 1,000 entries
  • Atomic writes: Prevents corruption on crash

Clear History:

prtip history --clear

See Also: ~/.prtip/history.json


8.6 Better Error Messages

Actionable error messages with platform-specific solutions reduce debugging time.

Error Categories:

  • 🔴 Fatal: Scan cannot proceed (permission, invalid target)
  • ⚠️ Warning: Scan degraded (rate limited, filtered ports)
  • ℹ️ Info: Informational (progress milestones)
  • 💡 Tip: Optimization suggestions

Example Errors:

# Permission denied
prtip -sS -p 80,443 192.168.1.1
# 🔴 Fatal: Permission denied creating raw socket
#
# Solution:
#   Option 1: Run with sudo privileges
#     sudo prtip -sS -p 80,443 192.168.1.1
#
#   Option 2: Set capabilities (Linux only)
#     sudo setcap cap_net_raw+ep $(which prtip)
#
#   Option 3: Use unprivileged scan type
#     prtip -sT -p 80,443 192.168.1.1  # TCP Connect scan
#
# Platform: Linux (x86_64)

# Invalid IP address
prtip -sS -p 80 999.999.999.999
# 🔴 Fatal: Invalid IP address
#   Expected: x.x.x.x (IPv4) or x:x:x:x:x:x:x:x (IPv6)
#   Got: 999.999.999.999
#   Suggestion: Use 192.168.1.1 or example.com

# Port out of range
prtip -sS -p 70000 192.168.1.1
# 🔴 Fatal: Port out of range
#   Ports must be 1-65535
#   Got: 70000

# Connection timeout
prtip -sS -p 80,443 192.168.1.1 --max-rtt-timeout 100
# ⚠️  Warning: Connection timeouts detected (15/100 hosts)
#   Try: --max-rtt-timeout 5000 OR -T0 (slower but more reliable)

# Too many open files (ulimit)
prtip -sS -p 1-65535 192.168.1.0/24 --batch-size 10000
# ⚠️  Warning: Too many open files
#   Detected ulimit: 1024
#   Recommended: 65535
#   Command: ulimit -n 65535
#   Automatically reducing batch size to 512. Re-run with --batch-size to override.

Coverage: 95%+ errors include actionable suggestions (19 error patterns)

See Also: docs/TROUBLESHOOTING.md


See Also:

  • CHANGELOG.md Sprint 5.5.2 (complete implementation details)
  • to-dos/PHASE-5.5-PRE-TUI-ENHANCEMENTS.md (sprint completion report)
  • /tmp/ProRT-IP/SPRINT-5.5.2-COMPLETE.md (full technical report)

Next Steps

Learn More

Tutorials:

Examples:

Technical Guides:

API Reference:

  • 05-API-REFERENCE.md - Public API documentation
  • rustdoc (docs.rs/prtip - not yet published) - Complete API docs (future)

Get Help

Resources:

Contribute

Ways to Help:

  • Report bugs and request features
  • Improve documentation
  • Write plugins
  • Submit code contributions
  • Spread the word!

See: CONTRIBUTING.md


Appendix

A. Command Reference Quick Card

# Basic Scans
prtip -sT -p 80,443 TARGET          # TCP Connect (no root)
sudo prtip -sS -p 1-1000 TARGET     # SYN scan (stealth)
sudo prtip -sU -p 53,161 TARGET     # UDP scan

# Service Detection
sudo prtip -sS -sV -p 1-1000 TARGET              # Version detection
sudo prtip -sS -O -p 1-1000 TARGET               # OS detection
sudo prtip -A -p 1-1000 TARGET                   # Aggressive (all)

# Stealth
sudo prtip -sS -T0 -p 80,443 TARGET              # Paranoid timing
sudo prtip -sS -f -p 80,443 TARGET               # Fragmentation
sudo prtip -sS -D RND:10 -p 80,443 TARGET        # Decoy scan
sudo prtip -sI ZOMBIE -p 80,443 TARGET           # Idle scan

# Performance
sudo prtip -sS -T4 -p 1-1000 TARGET              # Aggressive timing
sudo prtip -sS --numa -p 1-1000 TARGET           # NUMA optimization
sudo prtip -sS --max-rate 1000 -p 1-1000 TARGET  # Rate limiting

# Output
sudo prtip -sS -p 80,443 TARGET -oN results.txt  # Normal
sudo prtip -sS -p 80,443 TARGET -oJ results.json # JSON
sudo prtip -sS -p 80,443 TARGET -oA results      # All formats

B. Port Number Reference

Common Ports:

Port Service Description
20/21 FTP File Transfer Protocol
22 SSH Secure Shell
23 Telnet Unencrypted text
25 SMTP Email (sending)
53 DNS Domain Name System
80 HTTP Web traffic
110 POP3 Email (receiving)
143 IMAP Email (receiving)
443 HTTPS Secure web traffic
3306 MySQL MySQL database
3389 RDP Remote Desktop Protocol
5432 PostgreSQL PostgreSQL database
8080 HTTP-Alt Alternative HTTP

See: Full port list

C. Glossary

  • SYN Scan: Half-open TCP scan using SYN packets (stealthy)
  • TCP Connect Scan: Full TCP three-way handshake (non-stealthy, no root required)
  • UDP Scan: Probes UDP ports with protocol-specific payloads
  • Stealth Scan: FIN/NULL/Xmas scans that evade some firewalls
  • Idle Scan: Anonymous scan using zombie host (target never sees your IP)
  • Service Detection: Identifying service versions on open ports
  • OS Fingerprinting: Determining operating system via TCP/IP stack analysis
  • Rate Limiting: Controlling packet transmission rate to avoid network saturation
  • NUMA: Non-Uniform Memory Access (hardware architecture optimization)
  • Decoy Scanning: Using fake source IPs to hide real scanner
  • Fragmentation: Splitting packets to evade simple packet filters
  • TTL Manipulation: Setting IP Time-To-Live for OS mimicry

END OF USER GUIDE

Version: 2.0.0 (Sprint 5.5.1 Task 3 - Enhanced) Last Updated: 2025-11-07 Total Lines: 2,448 lines (+1,268 from v1.0.0, 107% growth) Enhancements:

  • ✅ Phase 5 feature coverage: 48%→92% (+44 percentage points)
  • ✅ 3 major sections expanded (Use Cases 6c, 10, 20)
  • ✅ 7 cross-reference "See Also" boxes added
  • ✅ 13 code snippets validated (100% accuracy) Status: ✅ COMPLETE (exceeds 1,200-1,500 target by 63%)