Post

Uncovering GhostMap The Rootkit Behind Shai-Hulud's Rusty Cousin

Uncovering GhostMap The Rootkit Behind Shai-Hulud's Rusty Cousin

Uncovering GhostMap: The Rootkit Behind Shai-Hulud’s Rusty Cousin

GhostMap is Aqua Nautilus’s research name for the Linux eBPF rootkit shared across examined IronWorm and Atomic Arch malware payloads. It blinds user-space applications by manipulating kernel data on the fly to hide malicious processes, files, and network sockets. In controlled experiments, Aqua Nautilus traced these evasion mechanics and proved their limits: while overwriting a single byte in application memory forces directory readers to skip hidden files, GhostMap’s socket concealment fails completely against standard inspection tools, hiding a listener from /proc/net/tcp while leaving it exposed to ss. Crucially, this user space deception did not hide GhostMap from Tracee, Aquasec’s open source runtime security and forensics tool. Tracee detected and alerted on its eBPF attachments and memory writing capabilities as the programs were attached.

IronWorm, described by JFrog as Shai-Hulud’s “rustier cousin,” is a Rust malware implant delivered through compromised software packages. This investigation focuses on its Linux eBPF rootkit, which we call GhostMap. The component conceals selected processes, file entries, and sockets, and interferes with debugging. The Atomic Arch comparison adds evidence that the rootkit is reused across delivery channels. A process listing is a view assembled for an application. If malware changes that view, an investigator can reach the wrong conclusion about what is running. GhostMap makes this distinction practical. In our tests, a hidden process remained accessible through its known /proc/PID path. Its disappearance from enumeration did not mean it had exited. Runtime monitoring provides another source of evidence. In our investigation, Tracee alerted on GhostMap’s attached programs even though the malware could hide selected entries from system listings.

GhostMap runs as part of a larger implant. IronWorm handles installation, service persistence, and collection; the rootkit provides concealment and anti-debugging. In the initial runtime investigation, the specimen copied itself to /var/lib/glugi/glugi, created glugi.service, and enabled the service. That successor process loaded GhostMap’s eBPF components. eBPF (extended Berkeley Packet Filter) lets small programs run at defined points inside the Linux kernel. GhostMap comprised 13 programs, 10 maps, and 13 links at an active checkpoint in the IronWorm run. For process hiding, hidden_names holds selected process names. An execution hook can add matching processes to hidden_pids. For socket hiding, hidden_inodes stores socket inode identifiers, which the network concealment programs use to select entries.

Linux exposes process information through /proc, a virtual filesystem. The getdents64 syscall returns directory entries in a buffer in application memory. GhostMap’s enter_getdents program remembers the buffer address. At sys_exit_getdents64, its exit_getdents program examines the returned records and checks numeric names against hidden_pids. When it finds a selected entry, it uses bpf_probe_write_user to modify the record chain. Increasing the preceding record’s length makes the reader advance past the hidden entry. In the November 8 experiment, hidden_pids included benign test processes 3035 and 3934. Both disappeared from /proc enumeration while their known /proc/PID paths remained accessible. After the rootkit stopped, the hidden test processes became visible again. In a separate experiment on November 10, the preceding record’s length changed from 32 to 56 bytes, causing the reader to skip a file whose numeric name matched the hidden process’s PID. Across all six altered buffers, only one byte changed: the low byte of the two-byte length field. The hidden records’ bytes remained in the buffer, and the syscall’s returned byte count stayed unchanged.

Linux exposes socket information through more than one interface. /proc/net/tcp provides a text listing, while socket diagnostic requests over Netlink return structured messages that tools such as ss can interpret. GhostMap targets both paths.

Read full article

This post is licensed under CC BY 4.0 by the author.