-
Notifications
You must be signed in to change notification settings - Fork 1
architecture
sloth wiki-sync edited this page Sep 30, 2026
·
1 revision
Summary: How sloth's source is organised: header → CLI → platform vtable → capture pipeline → per-protocol parsers → state → views.
Sources: CLAUDE.md, docs/views/connections.md, docs/views/packets.md, docs/views/dashboard.md, docs/views/devices.md.
Last updated: 2026-05-25.
include/sloth.h -- central header: shared structs, view_t enum, VIEW_COUNT
src/main.c -- CLI, signal handlers, poll loop
src/tui.c / tui.h -- ncurses rendering, colour init, key polling (ANSI fallback)
src/platform/linux*.c -- rtnetlink, nl80211, /proc readers, INET_DIAG
src/capture/capture.c -- libpcap thread; dispatches to per-protocol parsers
src/{dns,tls,quic,http,ntp,icmp}_log.c -- ring buffers + snapshot ([[ring-buffers]])
src/{alerts,beacon_detect,devices,threat_intel,filter,jsonl,alert_pcap,
top_hosts,ip_color,ip_owner}.c -- synthesis + export
src/views/*.c -- one file per VIEW_*
src/md5.c -- embedded MD5 for JA3 (RFC 1321 vectors verified)
tests/ -- unit tests, fake platform, scenarios (9304 assertions)
docs/views/*.md -- per-view deep dives
-
Platform vtable (
platform_ops_tinsloth.h) — see platform-vtable. Views never call platform ops directly; they readsloth_state_t. -
Capture pipeline —
src/capture/capture.cruns a libpcap thread, decodes Ethernet → IPv4/v6 → TCP/UDP, then dispatches todns_log,tls_log,quic_log,http_log,ntp_log,icmp_log. ARP, LLC, and unknown ethertypes are filtered before the ring buffer. -
Alert engine —
src/alerts.cruns each rule every poll, dedupes by stable key, fires JSONL + per-alert pcap. See alerts. -
Correlation seams — modules that answer a question sloth's own
sensors cannot.
src/inventory.creads the operator's approved-BSSID file (inventory);src/wired_attach.cis a one-slot in-process registration point for a future switch/controller/DHCP correlator, so the twin surfaces can render "is this AP on the wire" without any of them pretending RF answers it (#89 slice 3). Both are read-only, in-process, and neither is a control surface or a plugin loader.
sloth_state_t is the single shared structure. Each view declares ring
buffers + counters + selection index on it. Views read; capture and
platform code write.
-
make testreturns 0. Never commit a red test. -
makeis warning-clean. -
VIEW_COUNTmust stay in sync acrossinclude/sloth.h,tests/test_state.c, andtests/test_arp.cwhen adding / removing a view. - Parser tests use raw byte arrays built from RFCs — no parser-feeds-itself circular tests.
Mirrored from docs/wiki/ on main by .github/scripts/wiki_sync.sh. Edit there, not here — hand edits to this wiki are overwritten on the next push.
Read this first — the complete reference
- what-sloth-does
- how-wifi-works
- monitor-mode
- where-exploits-happen
- wifi-sigint-techniques
- cli-reference
- wifi-state-of-the-art
Start here
Engines
WiFi SIGINT
- wifi-sigint
- non-ip-sensors
- mac-randomisation
- evil-twin-reproducer
- btm-abuse
- action-frames
- research-corpus
- captive-portal
- fragattacks
- tool-fingerprints
- enterprise-rogue
- ipv6-ndp
- smb-snoop
- kerberos-snoop
- ldap-snoop
- bgp-snoop
- ssh-snoop
- rdp-snoop
- snmp-snoop
- mqtt-snoop
UI and infrastructure
- ip-palette
- platform-vtable
- version-checkin
- manifest-format
- pcap-export
- jsonl-schema
- data-socket-exposure
- sqlite-schema
- ring-buffers
Factory infrastructure
Reference
Source material
Maintenance