Repository navigation
Fingerprint Sources
Leetha's device identification accuracy depends on 12 community-maintained reference databases plus built-in JSON pattern files. The PatternLoader reads synced databases from the cache directory (~/.leetha/cache/) at runtime, loading each source on demand when a lookup is first requested.
leetha sync # refresh every source
leetha sync --list # print source names, ages, and record counts
leetha sync --source ieee_oui # update a single sourceThe React dashboard exposes the same functionality at /sync with real-time download progress bars.
IEEE OUI Master Registry -- 86,000+ records mapping 3-byte MAC prefixes to registered manufacturers. Built from the IEEE MA-L, MA-M, and MA-S registries. This is the authoritative layer for manufacturer attribution.
Note: A separate Huginn-Muninn MAC vendor feed was evaluated and removed. Its upstream export was 99.7%
Unknown MAC Vendor (xxxxxx)placeholder rows (a full 24-bit prefix enumeration) and contributed only 5 real vendors beyond the IEEE OUI registry, at a 700 MB+ cost. MAC-to-vendor resolution relies solely on the IEEE OUI registry.
PatternLoader pipeline: On every observed MAC, the OUI processor first checks the 1,900+ curated vendor entries in patterns/data/ (which include device type, category, and model hints). If no curated match exists, the IEEE OUI table provides a manufacturer-only fallback.
Huginn-Muninn DHCP Signatures -- 368,000+ fingerprints keyed by the ordered DHCP Option 55 parameter request list. Each entry maps to an OS family and device type.
Huginn-Muninn DHCP Vendor Strings -- 425,000+ Option 60 (Vendor Class Identifier) values that directly name the manufacturer, model, or firmware.
PatternLoader pipeline: When a DHCPv4 Discover or Request enters the PARSER_CHAIN, the DHCP processor extracts Option 55 and Option 60. The Option 55 sequence acts as a behavioral fingerprint -- Windows, macOS, Linux, and embedded systems each request different parameters in a characteristic order. Option 60 provides an explicit vendor declaration (e.g. MSFT 5.0, udhcp 1.33.2).
Huginn-Muninn DHCPv6 Signatures -- 1,600+ fingerprints derived from the DHCPv6 Option Request Option (ORO), the IPv6 analog of DHCP Option 55.
Huginn-Muninn DHCPv6 Enterprise IDs -- 58,000+ enterprise numbers extracted from vendor-specific DHCPv6 options.
IANA Private Enterprise Number Registry -- 65,000+ official IANA enterprise-to-organization mappings used to resolve DUID-EN identifiers and vendor options.
PatternLoader pipeline: DHCPv6 Solicit and Request frames carry an ORO that the DHCPv6 processor matches against the Huginn signatures. Enterprise IDs embedded in DUID-EN fields are resolved through both the Huginn enterprise table and the IANA registry.
Huginn-Muninn Device Database -- 116,000+ hierarchical profiles linking manufacturer, device type, model, and OS family. Used as a cross-referencing layer: once initial signals (OUI + DHCP + mDNS) are collected, the device database narrows identification from a generic vendor to a specific product and firmware revision.
p0f Signature Database -- 192 passive TCP/IP stack fingerprints capturing IP version, TTL, window size, MSS, window scale, TCP option order, and behavioral quirks. Labels follow the type:class:name:flavor convention (e.g. s:unix:Linux:3.11 and newer).
PatternLoader pipeline: The TCP stack processor constructs a signature from each SYN packet and searches the p0f database. Because TTL, window size, and option ordering are set by the OS kernel, this identification method works even for encrypted traffic.
JA3 Fingerprint Database -- 598 TLS ClientHello fingerprints from the Trisul set, covering browsers, mobile apps, and desktop clients. JA3 is an MD5 hash over cipher suites, extensions, elliptic curves, and EC point formats.
Leetha previously used Salesforce's osx-nix-ja3.csv, but that repository is archived and the list only covered 157 macOS/Linux desktop applications. The Trisul set is actively maintained and a near-superset -- it carries 155 of those 157 hashes plus mobile-app and browser fingerprints. Records identifying malware or scanner traffic are dropped at ingest: they carry no vendor, OS, or device type, and leetha identifies devices rather than threats.
Trisul ships no explicit OS field, so leetha infers one from each description -- 124 entries resolve an OS family, and Android/iOS app fingerprints additionally imply a handset.
JA4+ Fingerprint Database -- 70 mappings from FoxIO's ja4plus-mapping.csv. More collision-resistant than JA3.
Note: the full JA4 database moved from
ja4db.com/api/read/toja4db.foxio.io/api/ja4/and now requires an account (403without credentials). The GitHub-hosted CSV is the only unauthenticated JA4 source FoxIO publishes, so coverage is limited to what it contains.
PatternLoader pipeline: The TLS processor computes both JA3 and JA4 from each ClientHello and queries both databases. Matches reveal the application (browser, curl, Python requests) and by extension the likely OS.
Upstream Format PatternLoader Cache
--------------- -------------------
IEEE OUI CSV --> ieee_oui.json
p0f.fp plaintext --> p0f.json
Huginn devices JSON --> huginn_devices.json
Huginn dhcp JSON --> huginn_dhcp.json
Huginn dhcp_vendor --> huginn_dhcp_vendor.json
Huginn dhcpv6 JSON --> huginn_dhcpv6.json
Huginn dhcpv6_ent --> huginn_dhcpv6_enterprise.json
IANA enterprise-num --> iana_enterprise.json
Satori JSON (x7) --> satori_*.json
Recog XML (19 files) --> recog.json
Trisul JA3 JSONL --> ja3.json
JA4 mapping CSV --> ja4.json
|
v
PatternLoader
(lazy init per source)
Each upstream format has a dedicated parser in src/leetha/sync/parsers.py. Parsers normalize data into a uniform JSON structure: {"source": "<name>", "entries": {<key>: <value>}}. The PatternLoader in src/leetha/patterns/loader.py reads these cached JSON files the first time a lookup is performed.
In addition to the synced community databases, Leetha ships with curated JSON pattern files under patterns/data/. These files cover multiple protocol categories:
| File Category | Content |
|---|---|
| Hostname patterns | Regex rules mapping hostnames to vendor/device type |
| DNS patterns | Domain-to-vendor mappings for DNS query classification |
| mDNS patterns | Service type to device category mappings, including exclusive services |
| Banner patterns | Service banner strings to application/version mappings |
| DHCP patterns | Option 60 vendor class and Option 55 sequence rules |
| SSDP patterns | Server header and device description patterns |
| ICMPv6 patterns | Router advertisement flag combinations to OS mappings |
| NetBIOS patterns | Workgroup and hostname format rules |
The PatternLoader validates each JSON file on load and pre-compiles all regex patterns for efficient matching at capture time. Invalid entries are logged and skipped without halting the loader. Pre-compilation means regex patterns are compiled once at startup rather than on every packet, reducing per-packet processing overhead.
The 1,900+ curated vendor patterns in patterns/data/ have been verified against the IEEE OUI registry:
- Every prefix is confirmed to match the IEEE registrant
- Corporate acquisitions are mapped (Nest -> Google, Ring -> Amazon, Beats -> Apple)
- Enriched fields (device type, category, model hints) supplement what the IEEE data alone cannot provide
- The IEEE OUI dataset (86K+ entries) serves as a broad catch-all behind the curated layer
Run integrity checks at any time:
leetha validate # all checks
leetha validate --check oui # OUI accuracy
leetha validate --check stale # outdated sources
leetha validate --verbose # per-host detailFeeds are removed when they cannot pay their way. A retired feed's cache file
is deleted automatically on the next full leetha sync, so a dropped source
does not linger on disk.
| Feed | Why it was removed |
|---|---|
huginn_mac_vendors |
99.7% Unknown MAC Vendor (xxxxxx) placeholder rows -- a full 24-bit enumeration adding only 5 real vendors beyond the IEEE OUI database, at a 700 MB cost. |
satori_ntp |
Its lookup key encodes Satori's own undocumented timestamp heuristics (set/unset, current/random) and the field count is inconsistent (7 vs 8), so the key cannot be reconstructed from an observed NTP header. Its 25 identities are covered more reliably by DHCP, mDNS, OUI, and TCP fingerprints. |
Retired caches are pruned only after a full sync that completed without failures -- never after a single-source run, which has no view of the whole catalogue.