| Crates.io | passivetcp-rs |
| lib.rs | passivetcp-rs |
| version | 1.3.1 |
| created_at | 2024-12-01 16:35:03.006061+00 |
| updated_at | 2025-07-05 11:59:28.956884+00 |
| description | ⚠️ DEPRECATED: This crate has been renamed to 'huginn-net'. Please use 'huginn-net' instead. Multi-protocol passive fingerprinting library: TCP/HTTP (p0f-style) + TLS (JA4) analysis |
| homepage | |
| repository | https://github.com/biandratti/huginn-net |
| max_upload_size | |
| id | 1467620 |
| size | 391,340 |
huginn-netImportant Notice: This crate (
passivetcp-rs) has been renamed tohuginn-net.Please migrate to
huginn-netfor:
- Latest features and improvements
- Ongoing maintenance and security updates
- Better naming that reflects the library's evolution
Migration is simple: Just update your
Cargo.toml:# Old (deprecated) passivetcp-rs = "1.3.1" # New (recommended) huginn-net = "1.4.0"
passivetcp-rs combines p0f-inspired TCP fingerprinting with JA4 TLS client analysis, achieving the same detection accuracy as the original p0f tool while adding modern TLS fingerprinting capabilities. This Rust implementation has been thoroughly validated against real-world traffic and consistently delivers reliable fingerprinting results.
Passive Traffic Fingerprinting is a technique that allows you to infer information about remote hosts and applications without sending any probes. By analyzing characteristics of the TCP/IP packets and TLS handshakes that are exchanged during normal network conversations, passivetcp-rs provides insights into:
flowchart LR
subgraph layers ["🌐 Network Analysis Layers"]
direction TB
TLS["TLS Layer<br/>JA4 (FoxIO-style)"]
HTTP["HTTP Layer<br/>Headers & User-Agent"]
TCP["TCP Layer<br/>OS Detection (p0f-style)"]
end
subgraph engine ["passivetcp-rs"]
direction TB
ANALYZER["Packet Analysis<br/>& Fingerprinting"]
end
%% Clean horizontal connections
layers --> engine
classDef layerStyle fill:#e8f4fd,stroke:#1565c0,stroke-width:3px,color:#000,font-weight:bold
classDef engineStyle fill:#fff8e1,stroke:#ef6c00,stroke-width:3px,color:#000,font-weight:bold
class TLS,HTTP,TCP layerStyle
class ANALYZER engineStyle
⚠️ This crate is deprecated. Please use huginn-net instead:
[dependencies]
# Deprecated (use for legacy compatibility only)
passivetcp-rs = "1.3.1"
# Recommended (new name)
huginn-net = "1.4.0"
use passivetcp_rs::{Database, PassiveTcp};
use std::sync::mpsc;
// Load signature database and create analyzer
let db = Box::leak(Box::new(Database::default()));
let (sender, receiver) = mpsc::channel();
let passive_tcp = PassiveTcp::new(Some(db), 100, None);
// Analyze network traffic (choose one)
std::thread::spawn(move || {
// Live network capture
passive_tcp.analyze_network("eth0", sender);
// OR PCAP file analysis
// passive_tcp.analyze_pcap("traffic.pcap", sender);
});
// Process results
for output in receiver {
if let Some(syn) = output.syn {
info!("{}", syn);
}
if let Some(syn_ack) = output.syn_ack {
info!("{}", syn_ack);
}
if let Some(mtu) = output.mtu {
info!("{}", mtu);
}
if let Some(uptime) = output.uptime {
info!("{}", uptime);
}
if let Some(http_request) = output.http_request {
info!("{}", http_request);
}
if let Some(http_response) = output.http_response {
info!("{}", http_response);
}
if let Some(tls_client) = output.tls_client {
info!("{}", tls_client);
}
}
.-[ 1.2.3.4/1524 -> 4.3.2.1/80 (syn) ]-
|
| client = 1.2.3.4/1524
| os = Windows XP
| dist = 8
| params = none
| raw_sig = 4:120+8:0:1452:65535,0:mss,nop,nop,sok:df,id+:0
`----
.-[ 1.2.3.4/1524 -> 4.3.2.1/80 (syn+ack) ]-
|
| server = 4.3.2.1/80
| os = Linux 3.x
| dist = 0
| params = none
| raw_sig = 4:64+0:0:1460:mss*10,0:mss,nop,nop,sok:df:0
`----
.-[ 1.2.3.4/1524 -> 4.3.2.1/80 (mtu) ]-
|
| client = 1.2.3.4/1524
| link = DSL
| raw_mtu = 1492
`----
.-[ 1.2.3.4/1524 -> 4.3.2.1/80 (uptime) ]-
|
| client = 1.2.3.4/1524
| uptime = 0 days 11 hrs 16 min (modulo 198 days)
| raw_freq = 250.00 Hz
`----
.-[ 1.2.3.4/1524 -> 4.3.2.1/80 (http request) ]-
|
| client = 1.2.3.4/1524
| app = Firefox:10.x or newer
| lang = English
| params = none
| raw_sig = 1:Host,User-Agent,Accept=[,*/*;q=],?Accept-Language=[;q=],Accept-Encoding=[gzip, deflate],?DNT=[1],Connection=[keep-alive],?Referer:Accept-Charset,Keep-Alive:Firefox/
`----
.-[ 192.168.1.22/58494 -> 91.189.91.21/80 (http response) ]-
|
| server = 91.189.91.21/80
| app = nginx/1.14.0 (Ubuntu)
| params = anonymous
| raw_sig = server=[nginx/1.14.0 (Ubuntu)],date=[Tue, 17 Dec 2024 13:54:16 GMT],x-cache-status=[from content-cache-1ss/0],connection=[close]:Server,Date,X-Cache-Status,Connection:
`----
.-[ 192.168.1.10/45234 -> 172.217.5.46/443 (tls client) ]-
|
| client = 192.168.1.10/45234
| 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
| sni = www.google.com
| version = 1.3
`----
See benches/README.md for detailed performance analysis.
Based on signatures available in the p0f database. See config/p0f.fp for complete signature list.
The current signature database includes patterns for:
passivetcp-rs provides intelligent quality scoring for all fingerprint matches, helping you assess the reliability of each detection. The quality score is calculated based on the distance between observed network characteristics and known signatures. To achieve the best quality in matching, a rich database will be needed.
JA4 Attribution: This implementation follows the official JA4 specification by FoxIO, LLC. JA4 (TLS client) methodology and specification are Copyright (c) 2023, FoxIO, LLC. Our implementation covers only JA4 (TLS client fingerprinting) under BSD 3-Clause license and is written from scratch for passivetcp-rs while adhering to the published JA4 standard. We do not implement JA4+ components which are under FoxIO License 1.1.
For visual analysis and experimentation, use our companion web application:
🔗 huginn-net-profiler: Passive TCP Fingerprint Analyzer
Features:
We welcome contributions! Areas where help is especially valuable:
.fp signatures in the config/ directoryYour signature contributions directly improve detection accuracy for the entire community!
This project is licensed under the MIT License - see the LICENSE file for details.