Skip to main content

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-info-mobile")]
86#[cfg_attr(docsrs, doc(cfg(feature = "domain-info-mobile")))]
87pub mod domain_info_mobile;
88
89#[cfg(feature = "domain-dns")]
90#[cfg_attr(docsrs, doc(cfg(feature = "domain-dns")))]
91pub mod domain_dns;
92
93#[cfg(feature = "domain-dns-mobile")]
94#[cfg_attr(docsrs, doc(cfg(feature = "domain-dns-mobile")))]
95pub mod domain_dns_mobile;
96
97#[cfg(feature = "seo-analysis")]
98#[cfg_attr(docsrs, doc(cfg(feature = "seo-analysis")))]
99pub mod seo_analysis;
100
101#[cfg(feature = "web-technologies")]
102#[cfg_attr(docsrs, doc(cfg(feature = "web-technologies")))]
103pub mod web_technologies;
104
105#[cfg(feature = "domain-validator")]
106#[cfg_attr(docsrs, doc(cfg(feature = "domain-validator")))]
107pub mod domain_validator;
108
109#[cfg(feature = "domain-validator-mobile")]
110#[cfg_attr(docsrs, doc(cfg(feature = "domain-validator-mobile")))]
111pub mod domain_validator_mobile;
112
113// ── Reconnaissance ──────────────────────────────────────────────────
114
115#[cfg(all(feature = "subdomain-discovery", not(any(target_os = "android", target_os = "ios"))))]
116#[cfg_attr(docsrs, doc(cfg(feature = "subdomain-discovery")))]
117pub mod subdomain_discovery;
118
119#[cfg(all(feature = "subdomain-discovery", any(target_os = "android", target_os = "ios")))]
120#[cfg_attr(docsrs, doc(cfg(feature = "subdomain-discovery-mobile")))]
121pub mod subdomain_discovery_mobile;
122#[cfg(all(feature = "subdomain-discovery", any(target_os = "android", target_os = "ios")))]
123pub use subdomain_discovery_mobile as subdomain_discovery;
124
125#[cfg(feature = "contact-spy")]
126#[cfg_attr(docsrs, doc(cfg(feature = "contact-spy")))]
127pub mod contact_spy;
128
129#[cfg(feature = "advanced-content-scanner")]
130#[cfg_attr(docsrs, doc(cfg(feature = "advanced-content-scanner")))]
131pub mod advanced_content_scanner;
132
133// ── Security Assessment ─────────────────────────────────────────────
134
135#[cfg(feature = "security-analysis")]
136#[cfg_attr(docsrs, doc(cfg(feature = "security-analysis")))]
137pub mod security_analysis;
138
139#[cfg(feature = "security-analysis-mobile")]
140#[cfg_attr(docsrs, doc(cfg(feature = "security-analysis-mobile")))]
141pub mod security_analysis_mobile;
142
143#[cfg(feature = "subdomain-takeover")]
144#[cfg_attr(docsrs, doc(cfg(feature = "subdomain-takeover")))]
145pub mod subdomain_takeover;
146
147#[cfg(feature = "subdomain-takeover-mobile")]
148#[cfg_attr(docsrs, doc(cfg(feature = "subdomain-takeover-mobile")))]
149pub mod subdomain_takeover_mobile;
150
151#[cfg(feature = "cloudflare-bypass")]
152#[cfg_attr(docsrs, doc(cfg(feature = "cloudflare-bypass")))]
153pub mod cloudflare_bypass;
154
155#[cfg(all(feature = "nmap-zero-day", not(any(target_os = "android", target_os = "ios"))))]
156#[cfg_attr(docsrs, doc(cfg(feature = "nmap-zero-day")))]
157pub mod nmap_zero_day;
158
159#[cfg(all(feature = "nmap-zero-day", any(target_os = "android", target_os = "ios")))]
160#[cfg_attr(docsrs, doc(cfg(feature = "nmap-zero-day-mobile")))]
161pub mod nmap_zero_day_mobile;
162#[cfg(all(feature = "nmap-zero-day", any(target_os = "android", target_os = "ios")))]
163pub use nmap_zero_day_mobile as nmap_zero_day;
164
165#[cfg(feature = "api-security-scanner")]
166#[cfg_attr(docsrs, doc(cfg(feature = "api-security-scanner")))]
167pub mod api_security_scanner;
168
169#[cfg(feature = "geo-analysis")]
170#[cfg_attr(docsrs, doc(cfg(feature = "geo-analysis")))]
171pub mod geo_analysis;
172
173#[cfg(feature = "react2shell")]
174#[cfg_attr(docsrs, doc(cfg(feature = "react2shell")))]
175pub mod react;
176
177#[cfg(feature = "react-honeypot")]
178#[cfg_attr(docsrs, doc(cfg(feature = "react-honeypot")))]
179pub mod react_honeypot;