A production-grade Rust browser fingerprinting library supporting complete TLS and HTTP fingerprints for 6 core browsers (69+ versions), with high-performance HTTP client implementation (HTTP/1.1, HTTP/2, HTTP/3).
π¦ Workspace Architecture: The project uses Cargo Workspace architecture with modular design and clear responsibilities. See Architecture Documentation
- 6 Core Browsers: Chrome 103/133, Firefox 133, Safari 16.0, Opera 91, Edge 120/133
- 69 Browser Versions: Including mobile and application-specific fingerprints (Chrome 20, Firefox 12, Safari 9, Opera 3, Edge 3, Mobile clients 22)
- TLS 1.3 Compatible: ChangeCipherSpec, Session ID, Real key generation
- Real KeyShare: Uses
ringto generate X25519, P-256, P-384 key pairs - BoringSSL Padding: Compatible with Chrome/Chromium padding strategy
| Protocol | Status | Avg Response Time | Features |
|---|---|---|---|
| HTTP/1.1 | β Fully Supported | 44.4ms | Chunked, Gzip/Deflate/Brotli, Redirects, Keep-Alive |
| HTTP/2 | β Fully Supported | 48.0ms | Multiplexing, HPACK, Server Push |
| HTTP/3 | β Fully Supported | 40.3ms π₯ | QUIC, 0-RTT, Connection Migration |
- 100% Test Pass Rate: All browsers Γ All protocols (15/15 combinations)
- Real Environment Validation: Google Earth API end-to-end testing
- Protocol Fallback: HTTP/3 β HTTP/2 β HTTP/1.1 automatic downgrade
- Connection Pool: Deep integration with
netconnpool-rust - Performance Monitoring: Detailed link time analysis
- JA4+ Full Stack Fingerprinting: Integrated JA4 (TLS), JA4H (HTTP), JA4T (TCP) generation and identification
- Cross-Layer Consistency Audit: Detect inconsistencies between User-Agent and underlying TCP stack, TLS version
- Fingerprint Self-Learning: Automatically identify and record unknown stable fingerprint features to combat 0-day bots
- Persistent Analysis: SQLite-based traffic and threat analysis database
- Real-time Capture: Support real-time network traffic audit via Pcap
[dependencies]
fingerprint = { version = "2.0", features = ["rustls-tls", "http2", "http3"] }Recommended Feature Combinations:
# Full features (recommended)
fingerprint = { version = "2.0", features = ["rustls-tls", "compression", "http2", "http3", "connection-pool"] }
# Minimal configuration
fingerprint = { version = "2.0", features = ["rustls-tls"] }use fingerprint::{HttpClient, HttpClientConfig};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create HTTP client (automatic protocol negotiation)
let config = HttpClientConfig {
user_agent: "Mozilla/5.0 (X11; Linux x86_64) Chrome/133.0.0.0".to_string(),
prefer_http3: true, // Prefer HTTP/3, auto fallback on failure
prefer_http2: true, // Then HTTP/2
..Default::default()
};
let client = HttpClient::new(config);
// Send request
let response = client.get("https://example.com/")?;
println!("β
HTTP Version: {}", response.http_version);
println!("β
Status Code: {}", response.status_code);
println!("β
Body: {} bytes", response.body.len());
Ok(())
}use fingerprint::{chrome_133, HttpClient, HttpClientConfig};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Get Chrome 133 fingerprint configuration
let profile = chrome_133();
println!("β
Browser: {}", profile.get_client_hello_str());
// Output: Chrome-133
// Generate TLS ClientHello Spec
let spec = profile.get_client_hello_spec()?;
println!("β
Cipher Suites: {:?}", spec.cipher_suites.len());
println!("β
Extensions: {:?}", spec.extensions.len());
// Send request with this configuration
let config = HttpClientConfig {
user_agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36".to_string(),
prefer_http2: true,
..Default::default()
};
let client = HttpClient::new(config);
let response = client.get("https://www.google.com/")?;
println!("β
Status Code: {}", response.status_code);
Ok(())
}use fingerprint::{chrome_133, TLSHandshakeBuilder};
use std::net::TcpStream;
use std::io::Write;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// 1. Get browser fingerprint
let profile = chrome_133();
let spec = profile.get_client_hello_spec()?;
// 2. Build real TLS ClientHello (using ring to generate keys)
let client_hello = TLSHandshakeBuilder::build_client_hello(
&spec,
"www.google.com"
)?;
println!("β
ClientHello Size: {} bytes", client_hello.len());
// 3. Send to server
let mut stream = TcpStream::connect("www.google.com:443")?;
stream.write_all(&client_hello)?;
// 4. Send ChangeCipherSpec (TLS 1.3 compatible)
let ccs = [0x14, 0x03, 0x01, 0x00, 0x01, 0x01];
stream.write_all(&ccs)?;
// 5. Read server response
let mut response = vec![0u8; 5];
stream.read_exact(&mut response)?;
println!("β
Server Response: {:?}", response);
// Expected: [0x16, 0x03, 0x03, ...] (ServerHello)
Ok(())
}| Browser | HTTP/1.1 | HTTP/2 | HTTP/3 | Success Rate |
|---|---|---|---|---|
| Chrome 103 | β 5/5 | β 5/5 | β 5/5 | 100% |
| Chrome 133 | β 5/5 | β 5/5 | β 5/5 | 100% |
| Firefox 133 | β 5/5 | β 5/5 | β 5/5 | 100% |
| Safari 16.0 | β 5/5 | β 5/5 | β 5/5 | 100% |
| Opera 91 | β 5/5 | β 5/5 | β 5/5 | 100% |
Total Tests: 15 browser-protocol combinations
Total Success: 15/15
Success Rate: 100.0% π
Test Endpoint: https://kh.google.com/rt/earth/PlanetoidMetadata (Google Earth API)
Average Response Time Comparison:
Protocol Average Min Max Success Rate
ββββββββββββββββββββββββββββββββββββββββββββββββββ
HTTP/3 40.3ms 35ms 48ms 100% π₯ Fastest
HTTP/1.1 44.4ms 37ms 79ms 100% π₯
HTTP/2 48.0ms 43ms 60ms 100% π₯
Best Combination: Chrome 133 + HTTP/3 = 39.6ms average response π
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β β β β β β
β netconnpool βββββββΆβ TLS Fingerpr βββββββΆβ Google API β
β (Conn Mgmt) β 100% β (Chrome 133) β 100% β kh.google. β
β β β
β β β
β com β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
| Browser | Version | TLS Version | Status |
|---|---|---|---|
| Chrome | 103, 133 | TLS 1.3 | β 100% |
| Firefox | 133 | TLS 1.3 | β 100% |
| Safari | 16.0 | TLS 1.3 | β 100% |
| Opera | 91 | TLS 1.3 | β 100% |
| Edge | 120, 124, 133 | TLS 1.3 | β 100% |
chrome_103, chrome_104, chrome_105, chrome_106, chrome_107, chrome_108, chrome_109, chrome_110, chrome_111, chrome_112, chrome_116_PSK, chrome_116_PSK_PQ, chrome_117, chrome_120, chrome_124, chrome_130_PSK, chrome_131, chrome_131_PSK, chrome_133, chrome_133_PSK
firefox_102, firefox_104, firefox_105, firefox_106, firefox_108, firefox_110, firefox_117, firefox_120, firefox_123, firefox_132, firefox_133, firefox_135
safari_15_6_1, safari_16_0, safari_ios_15_5, safari_ios_15_6, safari_ios_16_0, safari_ios_17_0, safari_ios_18_0, safari_ios_18_5, safari_ipad_15_6
opera_89, opera_90, opera_91
edge_120, edge_124, edge_133
OkHttp4 (Android 7-13), Mesh (Android/iOS), Nike, Zalando, MMS, Confirmed
[features]
default = ["rustls-tls", "compression", "http2"]
# TLS implementation
rustls-tls = ["rustls", "webpki-roots"] # Recommended
# Feature flags
compression = ["flate2", "brotli-decompressor"] # Gzip/Deflate/Brotli decompression
http2 = ["h2", "http", "tokio", ...] # HTTP/2 support
http3 = ["quinn", "h3", "h3-quinn", ...] # HTTP/3 support
connection-pool = ["netconnpool"] # Connection pool
reporter = ["chrono"] # Report generator
async = ["tokio"] # Async runtime
dns = ["serde", "serde_json", "toml", "serde_yaml", "tokio", "futures", "rustls-tls", "hickory-resolver"] # DNS pre-resolution# Production (full features)
fingerprint = { version = "2.0", features = ["rustls-tls", "compression", "http2", "http3", "connection-pool"] }
# Development (fast compilation)
fingerprint = { version = "2.0", features = ["rustls-tls", "http2"] }
# Minimal dependencies
fingerprint = { version = "2.0", features = ["rustls-tls"] }See examples/ directory for complete examples:
- basic.rs - Basic HTTP client usage
- custom_tls_fingerprint.rs - Custom TLS ClientHello
- export_config.rs - Export configuration to JSON
- connection_pool.rs - Connection pool usage
- http2_with_pool.rs - HTTP/2 + Connection pool
- http3_with_pool.rs - HTTP/3 + Connection pool
- useragent.rs - User-Agent generation
- headers.rs - HTTP Headers generation
- tls_config.rs - TLS configuration generation
- debug_clienthello.rs - ClientHello debugging
- dns_service.rs - DNS automatic maintenance service
- resolve_domains.rs - DNS domain resolution example
# Unit tests (fast)
cargo test --lib --features "rustls-tls,http2"
# All browser fingerprint tests
cargo test --test all_browser_fingerprints_test --features "rustls-tls,http2,http3" -- --nocapture --ignored
# Performance benchmarks
cargo test --test performance_benchmark --features "rustls-tls,http2,http3" -- --nocapture --ignored# Google Earth API complete test (all protocols)
cargo test --test google_earth_full_test test_google_earth_all_protocols --features "rustls-tls,http2,http3" -- --nocapture --ignored
# Full chain monitoring
cargo test --test full_chain_monitor_test --features "rustls-tls,http2,http3" -- --nocapture --ignored
# Continuous stress test
cargo test --test continuous_stress_test test_continuous_quick_cycle --features "rustls-tls,http2,http3" -- --nocapture --ignored# HTTP/3 step-by-step debugging
cargo test --test http3_advanced_debug test_http3_step_by_step --features "http3" -- --nocapture --ignored
# HTTP/3 performance test
cargo test --test performance_benchmark benchmark_http3 --features "rustls-tls,http3" -- --nocapture --ignored- INDEX.md - Documentation index (recommended starting point)
- API.md - Complete API reference
- ARCHITECTURE.md - System architecture design (includes Workspace architecture)
- CHANGELOG.md - Changelog
- USAGE_GUIDE.md - Usage guide: How to randomly select and specify browser fingerprints
- CAPTURE_BROWSER_FINGERPRINTS.md - How to capture real browser TLS fingerprints
- GOOGLE_EARTH_TEST.md - Google Earth API testing instructions
- profiles.md - Browser fingerprint profiles module
- http_client.md - HTTP client module (HTTP/1.1, HTTP/2, HTTP/3)
- dns.md - DNS pre-resolution module
- tls_config.md - TLS configuration module
- tls_handshake.md - TLS handshake module
- headers.md - HTTP Headers generation module
- useragent.md - User-Agent generation module
- RUSTLS_FINGERPRINT_INTEGRATION.md - rustls fingerprint integration guide
- CUSTOM_TLS_IMPLEMENTATION.md - Custom TLS implementation documentation
- CLIENTHELLO_ANALYSIS.md - ClientHello analysis documentation
- UTLS_STYLE_API.md - uTLS style API documentation
- TEST_REPORT.md - Complete test report (includes all test results)
rand = "0.8" # Random number generation
sha2 = "0.10" # Hash functions
once_cell = "1.19" # Lazy initialization
thiserror = "2.0" # Error handling
ring = "0.17.14" # Cryptography library (real key generation)rustls = "0.21" # TLS implementation
webpki-roots = "0.25" # Root certificates
httparse = "1.10.1" # HTTP parsing
flate2 = "1.0" # Gzip/Deflate decompression
brotli-decompressor = "4.0" # Brotli decompression# HTTP/2
h2 = "0.4"
http = "1.1"
tokio = "1.40"
# HTTP/3
quinn = "0.10"
h3 = "0.0.4"
h3-quinn = "0.0.5"netconnpool = { git = "https://github.com/vistone/netconnpool-rust", tag = "v1.0.1" }// Optimized transport parameters
transport.stream_receive_window((1024 * 1024u32).into()); // 1MB per stream
transport.receive_window((10 * 1024 * 1024u32).into()); // 10MB total
transport.max_concurrent_bidi_streams(100u32.into()); // 100 concurrent streams
transport.keep_alive_interval(Some(Duration::from_secs(10))); // 10s keep-aliveuse fingerprint::{HttpClient, HttpClientConfig};
use netconnpool::{ConnectionPoolManager, PoolManagerConfig};
use std::sync::Arc;
// Create connection pool
let pool_config = PoolManagerConfig {
max_idle_per_host: 10,
max_idle_time: Duration::from_secs(90),
..Default::default()
};
let pool_manager = Arc::new(ConnectionPoolManager::new(pool_config));
// Use connection pool to send requests (automatic connection reuse)
let client = HttpClient::new(config);
// pool_manager will automatically manage connection reuseUses ring library to generate real X25519, P-256, P-384 key pairs for KeyShare Extension:
// Automatic generation
let client_hello = TLSHandshakeBuilder::build_client_hello(&spec, "example.com")?;
// KeyShare Extension contains real public keys- β Non-empty Session ID (32 bytes)
- β ChangeCipherSpec after ClientHello
- β BoringSSL Padding Style
- β Real KeyShare public keys
let config = HttpClientConfig {
prefer_http3: true, // Prefer HTTP/3
prefer_http2: true, // Fallback to HTTP/2
// Final fallback to HTTP/1.1
..Default::default()
};// Auto handle Transfer-Encoding: chunked
// Auto decompress Content-Encoding: gzip/deflate/brotli
// Auto follow HTTP redirects (configurable max redirects)
let response = client.get("https://httpbin.org/gzip")?;
let body = response.body_as_string()?; // Already decompressed
// Configure redirects
let config = HttpClientConfig {
max_redirects: 10, // Maximum redirect count
..Default::default()
};# Export configuration to JSON
cargo run --example export_config --features "rustls-tls"HTTP client fully integrates custom TLS ClientHello:
- β HTTP Layer Fingerprint: User-Agent, Headers, HTTP/2 Settings - Complete Match
- β TLS ClientHello Generation: Using our code - Full Control
- β
TLS Handshake Integration: Auto-apply browser fingerprints to rustls via
ClientHelloCustomizer - β Extension Order Control: Auto-adjust extension order to match real browsers
Implementation: Uses ProfileClientHelloCustomizer to automatically apply browser fingerprints during TLS handshake, no manual operation needed. When configuring HttpClientConfig's profile field, the corresponding browser fingerprint is automatically applied.
- β 6 Core Browsers: Chrome 103/133, Firefox 133, Safari 16.0, Opera 91, Edge 120/133 - 100% pass
- β Google Earth API: Real environment end-to-end validation - 100% pass
- β All Protocol Support: HTTP/1.1, HTTP/2, HTTP/3 - All tests pass
- β
50+ Browser Versions: Configurations implemented and tested
- Chrome series: 19 versions
- Firefox series: 13 versions
- Safari series: 14 versions
- Opera series: 3 versions
- Edge series: 3 versions
- Mobile clients: 17+ versions
Contributions welcome! Please see CONTRIBUTING.md (if exists).
# Clone repository
git clone https://github.com/vistone/fingerprint-rust.git
cd fingerprint-rust
# Install dependencies (Workspace architecture, auto-build all crates)
cargo build --workspace --features "rustls-tls,http2,http3"
# Run tests (test entire workspace)
cargo test --workspace --features "rustls-tls,http2,http3"
# Code check (check entire workspace)
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Code formatting (format entire workspace)
cargo fmt --all
# Build specific crate
cargo build -p fingerprint-core
cargo build -p fingerprint-http --features "rustls-tls,http2"
# Test specific crate
cargo test -p fingerprint-core
cargo test -p fingerprint-http --features "rustls-tls,http2"Project uses Cargo Workspace architecture with 7 independent crates:
- fingerprint-core: Core types and utility functions
- fingerprint-tls: TLS configuration, extensions, and handshake
- fingerprint-profiles: Browser fingerprint profiles
- fingerprint-headers: HTTP Headers and User-Agent generation
- fingerprint-http: HTTP client implementation (HTTP/1.1, HTTP/2, HTTP/3)
- fingerprint-dns: DNS pre-resolution service (optional)
- fingerprint: Main library, re-exports all functionality (maintains backward compatibility)
See Architecture Documentation for detailed architecture description.
This project is licensed under the BSD-3-Clause license - see LICENSE file for details.
Project URL: vistone/fingerprint-rust
Thanks to the following open source projects:
- rustls - Modern TLS implementation
- ring - Cryptography library
- h2 - HTTP/2 implementation
- quinn + h3 - HTTP/3 implementation
- tokio - Async runtime
- netconnpool-rust - Connection pool management
Version: v2.0.1 (Workspace)
Status: β
Production Ready
Last Updated: 2025-12-14
- 69+ Browser Fingerprints - 6 core browsers 100% tested
- HTTP/1.1 Client - Chunked, Gzip, Keep-Alive
- HTTP/2 Client - Multiplexing, HPACK, Server Push
- HTTP/3 Client - QUIC, 0-RTT, 40.3ms average response
- TLS 1.3 Compatible - ChangeCipherSpec, Session ID, Real keys
- Connection Pool Integration - Deep netconnpool integration
- 100% Test Pass - Google Earth API real environment validation
- Complete Documentation - 21 documentation files, fully aligned with code
- Configuration Export - JSON format configuration export
- Fastest Response: 35ms (HTTP/3)
- Average Response: 40.3ms (HTTP/3), 44.4ms (H1), 48ms (H2)
- Success Rate: 100% (15/15 browser-protocol combinations)
- Throughput: 2.6+ requests/second
- GitHub: https://github.com/vistone/fingerprint-rust
- Issues: https://github.com/vistone/fingerprint-rust/issues
- Original Project: https://github.com/vistone/fingerprint
π 100% Test Pass Β· Production Ready Β· Feature Complete π
Made with β€οΈ in Rust
High-performance Rust implementation with low memory footprint and high execution efficiency