| Crates.io | rswappalyzer |
| lib.rs | rswappalyzer |
| version | 0.2.4 |
| created_at | 2025-12-21 15:12:02.981973+00 |
| updated_at | 2026-01-21 10:51:06.196948+00 |
| description | A high-performance Wappalyzer rule detection engine. |
| homepage | |
| repository | https://github.com/FlyfishSec/rswappalyzer |
| max_upload_size | |
| id | 1998101 |
| size | 3,890,415 |
A high-performance Wappalyzer rule detection Library.
极速 wappalyzer 规则检测库
Add this to your Cargo.toml:
cargo add rswappalyzer
Below is a minimal example demonstrating how to detect web technologies from an HTTP response using rswappalyzer.
use reqwest::Client;
use reqwest::header::HeaderMap;
use rswappalyzer::{RuleConfig, TechDetector};
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// 1. Build rule configuration
// Use default configuration (recommended for most users)
let config = RuleConfig::default();
// load rules from a local file
// let mut config = RuleConfig::default();
// config.origin = RuleOrigin::LocalFile("/path/to/rules.json".to_string());
// ---------------------------------------------------------------------
// Remote rule configuration (optional)
// ---------------------------------------------------------------------
// Remote rule source
// This example uses the official WappalyzerGo fingerprint dataset
// as a standardized, community-maintained rule source.
//
// NOTE:
// - Remote rules will be downloaded and cached locally
// - Suitable for keeping rules up-to-date without bundling them into the binary
//
// const RULE_REMOTE_URL: &str =
// "https://raw.githubusercontent.com/projectdiscovery/wappalyzergo/refs/heads/main/ fingerprints_data.json";
//
// let mut config = RuleConfig::remote_custom(
// RULE_REMOTE_URL, // Remote rule URL
// Duration::from_secs(10), // HTTP request timeout
// RetryPolicy::Times(2), // Retry policy (retry up to 2 times on failure)
// );
// ---------------------------------------------------------------------
// Optional configuration overrides
// ---------------------------------------------------------------------
// Disable remote rule update checks
// Useful for fully offline or deterministic environments
// config.options.check_update = false;
// Specify a custom cache directory for downloaded rules
// Defaults to the library-managed cache location
// config.options.cache_dir = PathBuf::from("./custom_cache");
// 2. Create a technology detector instance
// The detector owns all compiled rule data and is safe to reuse
// across multiple requests.
let detector = TechDetector::new(config).await?;
// 3. Send HTTP request
let client = Client::new();
let url = "https://example.com";
let response = client.get(url).send().await?;
// 4. Extract headers and response body
let headers: HeaderMap = response.headers().clone();
let body = response.bytes().await?;
// 5. Run technology detection
let result = detector.detect(&headers, &[url], body.as_ref())?;
// 6. Consume detection results
// Get detected technology names
println!("Technologies: {:?}", result.tech_list());
// Get full structured result as pretty-printed JSON
println!("{}", result.to_json_pretty()?);
Ok(())
}
Example Output:
Detected technologies:
["Cloudflare"]
Full detection result (JSON):
{
"technologies": [
{
"name": "Cloudflare",
"categories": ["CDN"],
"confidence": 85
}
]
}
cargo run --release --example benchmark_detect_concurrent
Happy hacking with rswappalyzer!
The following projects are used as rule sources:
WebAppAnalyzergo
https://github.com/projectdiscovery/wappalyzergo
WebAppAnalyzer
https://github.com/enthec/webappanalyzer
Wappalyzer (HTTPArchive)
https://github.com/HTTPArchive/wappalyzer
RustedWappalyzer
https://github.com/shart123456/RustedWappalyzer
wappalyzergo
https://github.com/projectdiscovery/wappalyzergo
This project is licensed under the MIT License.
本项目基于 MIT 许可证 开源。