Skip to content

Releases

3.6

Choose a tag to compare

@github-actions github-actions released this 13 Nov 11:52

Added

  • A sensor without LOG_SERVER (sensor and server on one host) sent no heartbeats, so a dead local sensor looked exactly like a quiet network. It now writes the heartbeat to LOG_DIR/.heartbeat, which the server reads with the file's mtime as last seen, so the silence and capture-drop alerts cover the single-host install too.
  • The heartbeat carries the capture's received and dropped packet counts. /sensors and the Sensors view show the dropped share, and the server alerts once when a sensor drops more than 1% of its packets within an hour (SENSOR_DROP_ALERT, SENSOR_DROP_WINDOW), and once when that stops. Before, kernel drops never left the sensor host.
  • Alerts: dropped alerts are counted in the log, /sensors shows webhook delivery status, and LOG_DIR/alerts.json keeps the tail position and queue, so a restart neither loses pending alerts nor skips events written while the server was down (up to 1,000). Senders whose clock is outside LOG_SERVER_SKEW are counted and shown; their events, dated -2 d or 1979, used to land in other days' logs and never alert.
  • Sensor: ERSPAN type I and type III (with the optional platform sub-header), MPLS label stacks up to 8 deep, and Ethernet over MPLS with or without a control word are decapsulated.
  • A sensor that stops sending heartbeats for 15 minutes (SENSOR_STALE_AFTER) is alerted on once, and once when it reports again; with or without a webhook it goes to error.log. The sensor table is kept in LOG_DIR/sensors.json, so a restart still knows who should be reporting.
  • Dashboard: a day is parsed and aggregated in a Web Worker (js/worker.js, the same engine the page runs in js/engine.js) and the page applies its deltas, so the table stays usable while a day loads. A million-event day blocked the page for 4.6 s in 58 tasks; it blocks for 1.5 s in 15 now, and a 200k-event day for 0.3 s instead of 1.1 s. The day then holds two copies (worker and page): 350 MB instead of 240 MB for a 60k-event day, and the biggest day completes 15-30% later. No worker (or one that fails to load or crashes) means the in-thread path, as before; localStorage.mt_worker = "0" forces it.
  • Static trail files carry TLS fingerprints typed, one per line: ja3:, ja4:, cert:. The assembler publishes the bare value; check_trails.py fails a value that does not fit its type, warns on an untyped one, and no longer rejects JA4 as "not a valid DNS name". Certificate trails may be SHA-256 as well as SHA-1.
  • The sensor keeps the trail tables it builds next to TRAILS_FILE (<TRAILS_FILE>.store) and maps them on the next start, -T or reload instead of parsing the CSV. With 1.9M trails on one core, -T takes 0.08 s instead of 0.78 s, a start 0.18 s instead of 0.89 s, and peak RSS drops from 145 MB to 89 MB. The store is used only when it was built from the exact current CSV (content included), whitelist and sensor version. 'maltrail-sensor --verify-trail-store' checks it; TRAIL_STORE_CACHE false turns it off.
  • A static ARMv7 sensor build with NEON (armv7-unknown-linux-musleabihf) for the Pi 2 and later on a 32-bit OS, which ran the ARMv6 build until now. install.sh picks it only when /proc/cpuinfo reports neon, vfpv4 and idiva, and falls back to the ARMv6 build otherwise.
  • DNS responses are checked for listed CNAME targets. A client asking for an innocent-looking name the resolver aliases to a listed one never looked the listed name up, so nothing matched. The event is reported like the query it answers (source the client, destination the resolver), its trail names both ("(x).evil.com (innocent.org)"), and a response yields at most one event; targets are matched against trails only, not judged by the heuristics.
  • Heuristic 'icmp_tunneling' (icmpsh, ptunnel, ICMP exfiltration): more than 10 distinct echo payloads from one host to one destination that match no ping tool's pattern. Real iputils ping (default, -s, -p), mtr and busybox ping raised nothing; a 40-request tunnel was reported.
  • Heuristic 'idn_homograph': a queried name whose xn-- label, with its Cyrillic/Greek/Armenian lookalike letters read as Latin, becomes a whitelisted domain it is not (xn--pple-43d.com, "Π°pple.com"). Every IDN in the Cisco and Alexa top 1M lists (3,291) raised nothing.
  • Right-click -> "Reverse DNS" for an event's addresses, resolved by the server on click (#19613)
  • SESSION_EXPIRATION_HOURS: how long a dashboard login lasts (default 24) (#106)
  • Format gate for every data/*.txt (sensor/tools/check_data.py), run on any data/ change: their loaders skip a line they cannot read, so a typo there passed CI and did nothing (#19624). It found a whitelist entry that was never whitelisted (inline comment), three IPv6 worst-ASN ranges the loader never read (now supported), and UA patterns that compiled differently per Python version

Changed

  • Windows: built with Rust 1.100, the sensor bound WaitOnAddress to vertdll.dll (through pcap's windows-sys 0.36) and did not load under Wine; the system synchronization library is linked first, as with earlier toolchains.
  • Alerts: one message per threat per day (ALERT_THROTTLE 86400), keyed on the dashboard's threat id, which %(threat)s now carries. Over 7 days of a home network: high 10 -> 4, medium 656 -> 90, low 8,982 -> 1,099.
  • Dashboard: a copy Chrome renders invisibly ahead of a predicted visit (Settings > Performance > Preload pages) used to fetch the whole day's /events, a full file scan on the server, for a page that might never be shown. The day is loaded once the page is actually shown.
  • Server: text event lines are split by csv's C reader (same quoting as safe_value()); a cold /fail2ban of a 1M-event day went from 9.7 s to 6.7 s.
  • Server: static files are compressed once per modification and the trail set once per validator and entitlement: a /trails poll of a 95 MB set cost 2.1 s of CPU and ~110 MB of memory every time, now once; 100 requests for main.js went from 1.3 s to 0.1 s of CPU.
  • Dashboard: progressive repaints during a day load are paced by their own measured cost; a 1M-event day on a 4x-throttled CPU loads in 22 s instead of 32 s, unchanged at full speed.
  • Server: a restricted analyst's CIDR was expanded into a regex of up to 65,536 alternatives and run over every line of every scoped read. The CIDR stays a CIDR, each megabyte is sieved for the scope's fixed octets before any line is decoded, and the destination gets the same fast accept as the source: on a 1M-event day a /24 analyst's /events went from 3.0 s to 0.4 s and /counts over a month from 7.6 s to 0.8 s.
  • User-Agent reports the machine (aarch64, x86_64) instead of the pointer width ("x64").
  • A host without the memory for one dict builds the trail set streamed: 1,762,779 of 1,763,354 rows are new to the merge, so a 4 MB bit filter finds the few trails seen more than once, only those are held, and the rest go straight to trails.csv. Byte for byte the same file; 52 MB peak and 27 minutes on a Pi Zero squeezed to 51 MB free, where SQLite took over an hour. The SQLite store (core/disktrails.py) is removed.
  • A trail reload parses with one thread fewer than the cores, so the capture worker keeps a core. Parsing trails.csv is ~15% faster (0.80 s -> 0.68 s on one core).
  • A Pi Zero starts in 1.9 s instead of 5.8 s with the trail store:
    • the store no longer hashes all of trails.csv on every start when the file's inode and ctime show it untouched since the store was built (ext4, XFS, btrfs, F2FS, tmpfs, overlayfs; anything else is hashed);
    • data/ua.txt lines are syntax-checked instead of each being compiled (1.8 s on a Pi Zero);
    • static musl builds use mimalloc: musl's own malloc was a third of the start. 12% less time per packet as well; glibc builds are unchanged.
  • The trail loader no longer "prefetches" table slots ahead of each insert. It was a real load, which an in-order core (ARM11, Cortex-A53) stalls on: 18% slower inserts on a Pi Zero, and the whole load was 9% slower with it on a Ryzen too (0.69 s -> 0.63 s).
  • The sensor's fast hash starts from a random per-process state, so colliding source addresses cannot be computed in advance.
  • Scan heuristics keep threshold+1 items per key instead of up to 1024, and DNS tunneling judges distinctness on a pair's first 256 queries and stops recording once it has reported: a flood could fill gigabytes.
  • Stale trails are reported every update cycle instead of once per process (error.log and a new maltrail_trails_age_seconds metric), and a trail update that hangs is killed after an hour instead of blocking reloads.
  • meta.sqlite is written by one thread, not by the capture workers: a worker hands its window over in ~10-90 us instead of stalling capture for the write. The write itself is one sorted upsert per row.
  • The trail hash table is sized to its entries instead of the next power of two: 109 -> 74 MB for the full trail set (RSS 158 -> 122 MB).
  • The trail store is built file-backed only on hosts with under 2 GB of RAM. Its pages are reclaimable only after being written back, so every start and reload wrote the whole store to disk (125 MB measured on a Pi 4, to its SD card) even where the heap holds it comfortably. A Pi 4 now writes ~5 MB in its first minute instead of 125 MB.
  • DNS queries for new names and subdomains are 25-37% cheaper (subdomain query 660 -> 430 ns, cold 405 -> 300 ns). The tunneling heuristic decides a zone's exemption once per (source, zone) pair instead of per query, the exempt-zone set no longer uses SipHash, both DNS accumulators share one hash of each name, the domain caches hash a name once per lookup and insert, and short-key hashing no longer calls memcpy. Events unchanged.
  • potential remote code execution heur is improved (Issue #19646).
  • JA3, JA4 and certificate SHA-1 digests are computed only when the trail set holds a key of that shape. The shipped trail set holds none, so a TLS handshake no longer pays for an MD5, two SHA-256s and a SHA-1 that could never match (ClientHello path ~...
Read more

3.5

3.5

Choose a tag to compare

@github-actions github-actions released this 14 Oct 12:42

Highlights

Runs on a 256 MB Raspberry Pi

The trail update needed ~1.1 GB and was OOM-killed on small boxes, and the sensor needed 153 MB, twice that across a trail reload. Measured in a 221 MB container with no swap, against the full 1.9M-trail set:

3.4 3.5
trail update (peak) 1,144 MB 69 MB
sensor (steady) 153 MB 32 MB
sensor during a reload 304 MB 58 MB
  • The static trail set is streamed from its cache instead of being held in memory whole: the update peaks at ~255 MB on every machine now, not 1.1 GB.
  • Below 768 MB available (container and systemd limits included), the merge spills to a SQLite file. Same code, byte-identical trails.csv.
  • UPDATE_SERVER downloads stream to disk.
  • The sensor's trail store is file-backed (reclaimable page cache instead of heap); lookups measured the same speed.
  • Hosts with under 1 GB get a capture ring of 10% of RAM instead of 64 MB.

Thanks to @gpaterson for the report and the idea (#19641).

32-bit ARM sensor

New static ARMv6 build, arm-unknown-linux-musleabihf: one binary for every 32-bit Raspberry Pi, Pi 1 and Zero included, on Raspberry Pi OS, DietPi or Alpine. install.sh picks it automatically, also on a 64-bit kernel with a 32-bit userland. Each release replays a trail through it on an emulated Pi 1 CPU and refuses to publish a binary that does not detect it.

Also

  • Basic sensor status on the dashboard (#19627).
  • Windows installer (install.ps1); NetBSD and OpenBSD added to the tested platform matrix.
  • Workflows and shell scripts are linted in CI.

Full list in CHANGELOG.

Full Changelog: 3.4...3.5

3.4

3.4

Choose a tag to compare

@github-actions github-actions released this 04 Sep 22:39

Full Changelog: 3.3...3.4

3.3

3.3

Choose a tag to compare

@stamparm stamparm released this 31 Aug 22:11

Four ways traffic could reach the sensor and never be inspected. All four are closed in this release.

Nothing to do on upgrade β€” unlike 3.2, this one needs no configuration change.


Traffic that was not being looked at

Each of these was confirmed by replay before it was fixed: the packet arrived, and no event came out.

  • IPv6 extension headers. A packet carrying a Hop-by-Hop, Routing or Destination-Options header reported protocol 0/43/60, so the transport header was never located β€” no port, no DNS name, no HTTP host, no TLS SNI. Eight bytes hid a packet from every payload-derived trail. The chain is walked now.
  • Tunnels. A SPAN feed at a datacentre or corporate border is usually an overlay: the addresses on the mirror port are your own tunnel endpoints, and every host worth watching is inside. A DNS query for a listed domain inside VXLAN, GENEVE, GRE or ERSPAN produced zero events. Those, plus IP-in-IP, are decapsulated now, and outer-header matching is unchanged.
  • Stacked VLAN tags. The Ethernet path skipped exactly one 0x8100 tag and dropped anything else β€” QinQ frames never reached detection at all.
  • Multi-worker capture. CAPTURE_WORKERS defaulted to 1 because scaling out cost detections: PACKET_FANOUT_HASH splits by flow, the scan heuristics count by source, and a scanner walking ephemeral ports is a new flow per probe, so its evidence scattered across workers until none reached the threshold. Measured against the corpus, of the heuristic alerts one worker raises, 91% survived at 2 workers, 87% at 4, 66% at 8. Source-affine fanout is now the default whenever more than one worker is configured, and retains 100%.

The dashboard

Profiled in a browser against a real server holding a busy day β€” 200k events, 120k distinct threats. Interleaved A/B, medians:

before after
/events over the wire 24.3 MB 6.1 MB
Cold load 2979 ms 1465 ms
Opening a threat's detail panel 39.9 ms 6.2 ms
Sorting by severity 390 ms 101 ms
Showing 100 rows 159 ms 84 ms
Typing a word into search (main thread blocked) 571 ms 75 ms
Scrolling the page behind the open panel 46% of frames dropped 0%
The panel's open animation 83% of frames over 20 ms 13%

The event log is compressed while streaming β€” only when the client asks for it, and a 100 MB day still never has to fit in memory. Behind the numbers: risk scores and IP sort keys were being re-derived inside sort comparators millions of times per sort, the grid re-filtered and re-sorted every threat merely to turn a page, and the detail panel walked all 120k threats to produce two integers.

Three detail-panel bugs went with it: the panel was sized in vh so the text-size control left it short at the smallest step and 1200 px tall in an 857 px viewport at the largest, with its own buttons off-screen; scrolling past its end scrolled the table behind it by 600 px; and closing it left keyboard focus on a button in an off-screen panel.

Also in this release

  • Multiple days at once (#4, open since November 2015). Shift-click a second day; the arrows then step a whole window. /geo was taking only the first date in a range and quietly mapping one day's worth under a heading covering seven.
  • LOCAL_LOG_FORMAT text|json (#19130). Every reader β€” server, sensor and the browser β€” understands both, and a single day's file may hold both if the option is flipped mid-day.
  • Ignore list: networks, ranges and port ranges (#19142). 192.168.1.0/24, 2001:db8::/64, 10.0.0.1-10.0.0.50, 1024-65535. Previously exact string equality on all four fields, so silencing a subnet meant writing out every address in it.
  • DNS tunnelling detection, built to be hard to trigger: a tunnel and an antivirus reputation lookup look nearly identical from query shape alone, so a plain entropy-and-length detector is a machine for generating tickets about your own antivirus.
  • /trails answers an unchanged set with 304 instead of 87 MB. Every sensor polling UPDATE_SERVER re-downloaded the whole set every cycle.
  • A redistribution check. Nine integrations in our README are marked "trails only" β€” FireHOL, oisd, NextDNS, pfBlockerNG and the rest turn our lists into firewall DROP rules and DNS blocklists without ever running update_trails(), so none of our filtering reaches them. Every check we had asked "would Maltrail match this?", which says nothing about what those consumers get.

Also: constant-time auth comparison and tests for three auth surfaces that had none; the shipped fail2ban regex no longer bans your own hosts; an event-log handle that leaked on some request paths; two platforms the suspicious lists exist to name were being whitelisted; and a batch of allocation removals on the DNS, TLS and QUIC paths.

Removed: the Python sensor and the differential harness that existed to drive it. It was kept after the 3.0 cutover as an oracle β€” replay the corpus through both and diff β€” which was right while the port was being proved. Three releases later, "agrees with a retired implementation" stopped being a property worth a 45-minute gate step.

See the CHANGELOG for the full list.

Verifying what you downloaded

sha256sum -c maltrail-sensor-3.3-x86_64-unknown-linux-gnu.tar.gz.sha256
gh attestation verify oci://ghcr.io/stamparm/maltrail:3.3 --repo stamparm/maltrail

Binaries are built inside AlmaLinux 8 with libpcap linked statically, so they start on RHEL 8/9, Debian 12, Ubuntu and openSUSE Leap 15 whether or not libpcap is installed. Alpine/musl has no prebuilt sensor; build from source there.

Container: ghcr.io/stamparm/maltrail:3.3

Full Changelog: 3.2...3.3

3.2

3.2

Choose a tag to compare

@github-actions github-actions released this 27 Aug 18:09

The static trails now live in their own repository, stamparm/trails, and reach a deployment as one assembled file instead of shipping in the source tree.

Everything else in this release is secondary to that, so read the upgrade note first.


Upgrading from 3.1.x β€” do this

A maltrail.conf written before 3.2 has no STATIC_TRAILS_URL, and without it the static trail set is not loaded at all. Add:

STATIC_TRAILS_URL https://github.com/stamparm/trails/releases/latest/download/trails.csv.gz

…or re-run install.sh, which writes it for you.

Maltrail will not let this pass quietly. The updater prints a banner across the terminal, server --doctor fails with exit 1, and maltrail-sensor -T fails its preflight β€” so the systemd unit's ExecStartPre catches it before the sensor ever runs. Losing the trail set is indistinguishable from a quiet network, and that is not a thing to discover in a month.

There is deliberately no silent fallback to a default URL. A deployment that fetches its detection content from an address the operator never configured is a worse answer than one that says what is missing.

Why the split

trails/static was 98.7% of every blob byte in this repository's history and 9,169 of 9,549 commits. Two consequences: git log, git blame and git bisect were useless on the code, and updating detection content meant pulling a new version of the software.

The repository went from 9,578 commits and a 110 MiB pack to 353 commits and 3.3 MiB. Content history was not deleted β€” it moved, with authorship intact.

What changes for a deployment

Static trails fetched from STATIC_TRAILS_URL, cached next to TRAILS_FILE
Update cost ~11 MB gzipped, or 65 bytes when the published digest says nothing changed
Content freshness published up to 4Γ—/day; new indicators reach you within hours instead of on your next git pull
Pinning point STATIC_TRAILS_URL at a dated content-YYYYMMDD-HHMM release so a bad publish is not immediately global
Offline / air-gapped trails-bootstrap.csv.gz ships with this release and install.sh seeds the cache from it, so a first start detects immediately even with no connectivity
Integrity a payload that does not match its published sha256 is refused in favour of the cache
Feeds unchanged β€” still fetched by your deployment directly from each publisher
Custom trails unchanged, but CUSTOM_TRAILS_DIR no longer defaults inside the installation directory

trails/feeds/ moved to feeds/. trails/static and trails/custom stopped pretending to be feed plugins β€” they only ever were so update_trails() could run one loop, which is why DISABLED_FEEDS static used to silently disable 1.6M trails.

Also in this release

Everything that accumulated since 3.1.1:

  • Alerting: ALERT_WEBHOOK_URL posts events at or above a severity threshold, with throttling. Slack, Mattermost, Discord, a SIEM collector, or your own endpoint.
  • Event index: a per-day SQLite sidecar. /counts is exact rather than estimated, and /hunt skips non-matching lines instead of reading every one.
  • JA3/JA4 client fingerprints matched as trails, byte-identical to the Python implementation and pinned by generated vectors.
  • Beaconing heuristic β€” timer-regular reconnects to one destination, rated suspicious, never malware, because uptime monitors beacon too.
  • Trail confidence: how strongly sources agree, surfaced in /check and the trail drawer.
  • server --doctor preflight, and both config parsers now flag an unknown option instead of ignoring a typo.
  • Longest-match whitelist precedence β€” an exact static trail on a more specific name than its whitelisted ancestor now fires. 3,082 trails on shared platforms were loaded, counted, and could never match.
  • Source citations survive the split: each release of the trail set carries a provenance sidecar, so the trail drawer still shows the report an indicator was extracted from.

Fixes worth naming: UDP event intake was losing 24% at 10k events/s (a thread and an open() per datagram β€” now lossless to 20k/s); /hunt's IP search was 9Γ— slower than a plain substring hunt; --detect-test told a healthy install its detection was broken; --smoke-test printed nothing and exited 1; every IPv6 event was unmapped on the attack map. The server also refuses to start with the private key Maltrail used to ship, and RIPEstat is proxied through /ripe so script-src is back to 'self'.

See the CHANGELOG for the full list.

Verifying what you downloaded

sha256sum -c maltrail-sensor-3.2-x86_64-unknown-linux-gnu.tar.gz.sha256
gh attestation verify oci://ghcr.io/stamparm/maltrail:3.2 --repo stamparm/maltrail

Binaries are built inside AlmaLinux 8 with libpcap linked statically. Checked on the published x86_64 binary: highest glibc symbol required is 2.28, and libpcap is not among its dynamic dependencies β€” so it starts on RHEL 8/9, Debian 12, Ubuntu and openSUSE Leap 15 whether or not libpcap is installed. Alpine/musl has no prebuilt sensor; build from source there.

Container: ghcr.io/stamparm/maltrail:3.2

3.1.1

Choose a tag to compare

@github-actions github-actions released this 11 Aug 20:25

Full Changelog: 3.1...3.1.1

3.1

3.1

Choose a tag to compare

@github-actions github-actions released this 11 Aug 08:46

Full Changelog: 3.0.1...3.1

3.0.1

Choose a tag to compare

@github-actions github-actions released this 10 Aug 14:18

Full Changelog: 3.0...3.0.1

3.0

3.0

Choose a tag to compare

@github-actions github-actions released this 08 Aug 06:42

What's Changed

  • build(deps): bump fancy-regex from 0.16.2 to 0.19.0 in /sensor by @dependabot[bot] in #19587
  • build(deps): bump the actions group with 12 updates by @dependabot[bot] in #19592

New Contributors

Full Changelog: 2.1...3.0

v3.0-rc1

v3.0-rc1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Aug 01:10

What's Changed

  • build(deps): bump fancy-regex from 0.16.2 to 0.19.0 in /sensor by @dependabot[bot] in #19587
  • build(deps): bump the actions group with 12 updates by @dependabot[bot] in #19592

New Contributors

Full Changelog: 2.1...v3.0-rc1