This repository contains a single Bash script that scans a workstation or a directory tree for common indicators associated with a malicious JavaScript supply chain event involving axios and the package plain-crypto-js.
It is designed to be practical for responders and developers. It checks lockfiles, node_modules, npm cache, global installs, a few known filesystem IOCs, and active network connections.
For fully updated incident context, detection playbook, and containment checklist, see the CyberReplay axios npm compromise write-up.
The script looks for:
- Compromised
axiosversions in common JavaScript lockfiles and innode_modulesaxios@1.14.1axios@0.30.4
- The malicious package
plain-crypto-js - Stage 2 filesystem IOCs
- macOS:
/Library/Caches/com.apple.act.mond - Linux:
/tmp/ld.py - Windows (WSL, MSYS, Git Bash patterns):
%PROGRAMDATA%\wt.exe,%TEMP%\6202033.vbs,%TEMP%\6202033.ps1
- macOS:
- Active network connections to suspicious domains
sfrclak.compackages.npm.org(including evidence of requests to/product0,/product1,/product2)
- Global packages installed via npm, yarn, pnpm, and bun
- npm cache artifacts in
~/.npm(or the configured npm cache directory) - Running processes that include known IOC strings
- Optional evidence of past requests to
packages.npm.org/product{0,1,2}- DNS queries on macOS (mDNSResponder unified log)
- Browser history matches (Chrome, Edge, Brave, Firefox, Safari) when
sqlite3is available - Shell history references
- Common proxy and web server log locations (best effort)
- Bash
- Standard Unix tools:
find,grep,awk,sed,ps - Optional but recommended:
nodefor accuratepackage-lock.jsonparsing and for reading installed package versionsnpm,yarn,pnpm,bunif you want the global package checks for those managerssqlite3for browser history checksssornetstatorlsoffor active connection checksdigfor DNS resolution checks
On macOS, sqlite3 and dig may not be present by default depending on system configuration.
-
Make the script executable.
chmod +x shell.sh -
Run it with no arguments to scan your home directory.
./shell.sh -
Or pass a directory to scan a specific location (for example, a workspace or a drive mount).
./shell.sh /path/to/projects
The script limits recursion depth when scanning for lockfiles and node_modules to avoid extremely deep traversals.
- Green lines indicate a check completed without finding the indicator.
- Yellow lines are warnings. They often indicate possible historical artifacts, like npm cache references.
- Red lines indicate a positive match for an IOC or a compromised dependency.
If the script reports findings, treat them as a strong signal to investigate. In most environments you should also:
- Identify where the dependency was introduced and which builds consumed it
- Rotate credentials that may have been present on the machine or in CI at the time
- Review outbound network logs for the listed domains and any resolved IPs
The packages.npm.org/product0, product1, and product2 strings are checked in a few different ways.
- Active connections are checked using
ss,netstat, orlsofif available. - Past activity checks are best effort and depend on what logs are available on the host.
- Browser history checks only detect explicit URL visits. They do not prove that a background library made an HTTP request.
A clean result here does not guarantee the host never contacted the endpoints.
- This is a detection script, not a remediation tool.
- It does not attempt memory forensics.
- It cannot reliably parse
bun.lockbas text. The script attempts a best effort check ifbunis available. - Host log sources vary widely. Some checks may be skipped silently if tools or files are not present.
This script is read-only. It does not delete anything. It runs local commands to inspect files and system state.
Still, it should be reviewed and tested in your environment before you run it at scale.
If you need a license statement, add one that matches your intended distribution and usage. Credit to https://github.com/luiyongsheng for the original script.