“Crucially, this service is configured with Before=sysinit[].target, ensuring th...
Stephan Berger @malmoeb@infosec.exchange
“Crucially, this service is configured with Before=sysinit[].target, ensuring the rootkit executes on every system boot prior to the initialization of any security tooling.” [1]
This is an interesting approach, but it may be worded too generically. With DefaultDependencies=no and Before=sysinit[.]target, the malicious systemd unit is deliberately moved into very early userspace initialization. That can matter from a detection perspective: if an EDR only attaches its eBPF programs, kprobes, tracepoints, or other telemetry after its userspace service starts, the rootkit may already have loaded and established its hooks by then.
But "before any security tooling" is too absolute IMO. In the analyzed unit (see blog post from TALOS), the rootkit is explicitly stating "After=systemd-modules-load.service", so kernel modules loaded through the normal early boot path may already be resident.
The rootkit is using insmod to load the malicious module, and the module itself resides on disk. Plus, after loading, you face various rootkit detection techniques. Loading it before any EDR / security tooling might be the easier part of the whole "stealth" journey.