| Crates.io | huginn-net-tls |
| lib.rs | huginn-net-tls |
| version | 1.7.2 |
| created_at | 2025-10-04 10:09:36.731317+00 |
| updated_at | 2026-01-10 15:45:48.696272+00 |
| description | TLS fingerprinting and JA4 analysis for huginn-net |
| homepage | https://github.com/biandratti/huginn-net |
| repository | https://github.com/biandratti/huginn-net |
| max_upload_size | |
| id | 1867760 |
| size | 254,366 |
This crate provides JA4 TLS client fingerprinting capabilities for passive network analysis. It implements the official JA4 specification by FoxIO, LLC for identifying TLS clients through ClientHello analysis.
ObservableTlsClient) without being limited to predefined JA4 fingerprintsNote: Live packet capture requires
libpcap(usually pre-installed on Linux/macOS).
Add this to your Cargo.toml:
[dependencies]
huginn-net-tls = "1.7.2"
use huginn_net_tls::{FilterConfig, HuginnNetTls, HuginnNetTlsError, IpFilter, PortFilter, TlsClientOutput};
use std::sync::mpsc;
fn main() -> Result<(), HuginnNetTlsError> {
// Create analyzer
let mut analyzer = HuginnNetTls::new(10000);
// Optional: Configure filters (can be combined)
if let Ok(ip_filter) = IpFilter::new().allow("192.168.1.0/24") {
let filter = FilterConfig::new()
.with_port_filter(PortFilter::new().destination(443))
.with_ip_filter(ip_filter);
analyzer = analyzer.with_filter(filter);
}
let (sender, receiver) = mpsc::channel::<TlsClientOutput>();
// Live capture (use parallel mode for high throughput)
std::thread::spawn(move || {
if let Err(e) = analyzer.analyze_network("eth0", sender, None) {
eprintln!("Analysis error: {e}");
}
});
// Or PCAP analysis (always use sequential mode)
// std::thread::spawn(move || {
// if let Err(e) = analyzer.analyze_pcap("capture.pcap", sender, None) {
// eprintln!("Analysis error: {e}");
// }
// });
for tls in receiver {
println!("{tls}");
}
Ok(())
}
For a complete working example with signal handling, error management, and CLI options, see examples/capture-tls.rs.
The library supports packet filtering to reduce processing overhead and focus on specific traffic. Filters can be combined using AND logic (all conditions must match):
Filter Types:
All filters support both Allow (allowlist) and Deny (denylist) modes. See the filter documentation for complete details.
[TLS Client] 192.168.1.10:45234 → 172.217.5.46:443
SNI: www.google.com
Version: TLS 1.3
JA4: t13d1516h2_8daaf6152771_b0da82dd1658
JA4_r: t13d1516h2_002f,0035,009c,009d,1301,1302,1303_0005,000a,000b,000d,0012,0015,002b,0033,002d
JA4_o: t13d1516h2_8daaf6152771_b0da82dd1658
JA4_or: t13d1516h2_002f,0035,009c,009d,1301,1302,1303_0005,000a,000b,000d,0012,0015,002b,0033,002d
This crate is part of the Huginn Net ecosystem. For multi-protocol analysis, see huginn-net. For protocol-specific analysis:
For complete documentation, examples, and JA4 specification details, see the main huginn-net README.
This implementation follows the JA4 specification by FoxIO, LLC. JA4 methodology and specification are Copyright (c) 2023, FoxIO, LLC.
Dual-licensed under MIT or Apache 2.0.