Installation
Add whatwaf to yourCargo.toml:
Main exports
The library exposes the following key components:scan_url- Primary function for scanning a URL and detecting WAFslist_detectors- Returns a list of all available WAF detectorsScanConfig- Configuration struct for customizing scan behaviorProbeResult- Result type containing probe and detection informationScanError- Error enum for handling scan failuresDetector- Trait for implementing custom WAF detectors
Basic usage
API design philosophy
The whatwaf API is designed with the following principles:- Simplicity - The core API requires just one function call to perform a complete scan
- Flexibility - Optional callback mechanism allows real-time processing of probe results
- Blocking I/O - Uses synchronous requests for predictable behavior in CLI and scripting contexts
- Error transparency - Detailed error types help identify network, proxy, or request issues
- Extensibility - The
Detectortrait allows custom WAF detectors to be registered via the inventory pattern
List available detectors
To see all WAF detectors included in the library:Next steps
scan_url function
Learn about the main scanning function and its parameters
Configuration
Explore ScanConfig options and ProbeResult structure
Error handling
Understand error types and how to handle them