web_analyzer/lib.rs
1//! # Web Analyzer
2//!
3//! **Enterprise domain security & intelligence platform** — a high-performance
4//! Rust toolkit for comprehensive web reconnaissance, security assessment, and
5//! technology fingerprinting.
6//!
7//! ## Module Architecture
8//!
9//! The crate is organized into three security pillars, each gated by
10//! individual Cargo feature flags:
11//!
12//! ### 🔎 Intelligence Gathering
13//! - [`domain_info`] — WHOIS, SSL certificates, DNS, port scanning, security score
14//! - [`domain_dns`] — A, AAAA, MX, NS, SOA, TXT, CNAME record resolution
15//! - [`seo_analysis`] — 13-category SEO audit with composite scoring
16//! - [`web_technologies`] — Technology fingerprinting across 16 categories
17//! - [`domain_validator`] — Bulk domain validation with parallel processing
18//!
19//! ### 🕵️ Reconnaissance
20//! - [`subdomain_discovery`] — Subfinder integration with deduplication
21//! - [`contact_spy`] — BFS crawl for email, phone, and social media extraction
22//! - [`advanced_content_scanner`] — Secret pattern detection & JS vulnerability analysis
23//!
24//! ### 🛡️ Security Assessment
25//! - [`security_analysis`] — WAF detection, SSL grading, CORS, cookies, composite score
26//! - [`subdomain_takeover`] — 36-service vulnerability database with exploitation ratings
27//! - [`cloudflare_bypass`] — Origin IP discovery via history lookup
28//! - [`nmap_zero_day`] — Nmap integration with NVD CVE and Exploit-DB lookup
29//! - [`api_security_scanner`] — 9 test suites: SQLi, XSS, SSRF, path traversal, and more
30//! - [`geo_analysis`] — AI/LLM readiness analysis and crawler directives
31//!
32//! ## Quick Start
33//!
34//! ```toml
35//! [dependencies]
36//! web-analyzer = "0.1"
37//! tokio = { version = "1", features = ["full"] }
38//! ```
39//!
40//! ```rust,no_run
41//! use web_analyzer::domain_info::get_domain_info;
42//!
43//! #[tokio::main]
44//! async fn main() {
45//! let info = get_domain_info("example.com", None).await.unwrap();
46//! println!("IP: {:?}", info.ipv4);
47//! }
48//! ```
49//!
50//! ## Feature Flags
51//!
52//! By default, **all modules** are enabled. Disable default features and
53//! select only what you need to reduce compile times:
54//!
55//! ```toml
56//! [dependencies]
57//! web-analyzer = { version = "0.1", default-features = false, features = ["domain-info", "security-analysis"] }
58//! ```
59
60#![cfg_attr(docsrs, feature(doc_cfg))]
61
62/// Error types for the web-analyzer crate.
63pub mod error;
64
65use serde::{Deserialize, Serialize};
66
67/// Standardized progress event for async tasks.
68#[derive(Debug, Clone, Serialize, Deserialize)]
69pub struct ScanProgress {
70 pub module: String,
71 pub percentage: f32,
72 pub message: String,
73 pub status: String,
74}
75
76/// Compile-time embedded payloads from the `payloads/` directory.
77pub mod payloads;
78
79// ── Intelligence Gathering ──────────────────────────────────────────
80
81#[cfg(feature = "domain-info")]
82#[cfg_attr(docsrs, doc(cfg(feature = "domain-info")))]
83pub mod domain_info;
84
85#[cfg(feature = "domain-dns")]
86#[cfg_attr(docsrs, doc(cfg(feature = "domain-dns")))]
87pub mod domain_dns;
88
89#[cfg(feature = "seo-analysis")]
90#[cfg_attr(docsrs, doc(cfg(feature = "seo-analysis")))]
91pub mod seo_analysis;
92
93#[cfg(feature = "web-technologies")]
94#[cfg_attr(docsrs, doc(cfg(feature = "web-technologies")))]
95pub mod web_technologies;
96
97#[cfg(feature = "domain-validator")]
98#[cfg_attr(docsrs, doc(cfg(feature = "domain-validator")))]
99pub mod domain_validator;
100
101// ── Reconnaissance ──────────────────────────────────────────────────
102
103#[cfg(feature = "subdomain-discovery")]
104#[cfg_attr(docsrs, doc(cfg(feature = "subdomain-discovery")))]
105pub mod subdomain_discovery;
106
107#[cfg(feature = "contact-spy")]
108#[cfg_attr(docsrs, doc(cfg(feature = "contact-spy")))]
109pub mod contact_spy;
110
111#[cfg(feature = "advanced-content-scanner")]
112#[cfg_attr(docsrs, doc(cfg(feature = "advanced-content-scanner")))]
113pub mod advanced_content_scanner;
114
115// ── Security Assessment ─────────────────────────────────────────────
116
117#[cfg(feature = "security-analysis")]
118#[cfg_attr(docsrs, doc(cfg(feature = "security-analysis")))]
119pub mod security_analysis;
120
121#[cfg(feature = "subdomain-takeover")]
122#[cfg_attr(docsrs, doc(cfg(feature = "subdomain-takeover")))]
123pub mod subdomain_takeover;
124
125#[cfg(feature = "cloudflare-bypass")]
126#[cfg_attr(docsrs, doc(cfg(feature = "cloudflare-bypass")))]
127pub mod cloudflare_bypass;
128
129#[cfg(feature = "nmap-zero-day")]
130#[cfg_attr(docsrs, doc(cfg(feature = "nmap-zero-day")))]
131pub mod nmap_zero_day;
132
133#[cfg(feature = "api-security-scanner")]
134#[cfg_attr(docsrs, doc(cfg(feature = "api-security-scanner")))]
135pub mod api_security_scanner;
136
137#[cfg(feature = "geo-analysis")]
138#[cfg_attr(docsrs, doc(cfg(feature = "geo-analysis")))]
139pub mod geo_analysis;