unk-scanner for Python
Python CLI and API for the static JavaScript scanner from the UNK_DeadDrop investigation.
Requires Python 3.10+ and Node.js 22+ on PATH. The wheel bundles the same JavaScript engine as the npm distribution, plus Acorn 8.17.0. It does not require npm, execute submitted JavaScript, or download code during analysis.
Installation and usage
pip install unk-scanner
python -m unk_scanner suspect.js > findings.json
python -m unk_scanner --gzip captured-response.js > findings.json
The distribution also installs an unk-scanner command. Prefer python -m unk_scanner if both npm and Python versions are installed, to make the selected installation explicit.
from unk_scanner import scan, ScannerError
try:
report = scan("suspect.js")
print(report["findings"])
except ScannerError as error:
print(error)
Scope
Reports contain original SHA-256 hashes, byte counts, findings with severities and source locations, a deobfuscation summary, limitations and separate artifact identity records. With --gzip, decoded records the decompressed hash and size. artifactMatches can identify ordinary login code or a shared polyfill; these are context, not malware alerts.
The scanner reports ClickFix clipboard command substitution, Electron ELECTRON_RUN_AS_NODE launches, obfuscator.io string arrays (recovering their strings without running the decoder), one linked AES-GCM loader pattern and campaign markers. See the rule reference. It does not prove execution or determine whether a file is safe.
Each file is parsed in a separate Node process under the permission model, with a capped heap, a per-file deadline and an empty environment. On Linux, where permitted, the process also gets a network namespace and rlimits. The Python wrapper applies an additional process timeout. Input and decompressed sizes are limited to 8 MiB and reports to 10,000 findings; limit failures return an error rather than a partial report. These controls are not a sandbox against an engine exploit. Output can contain input strings and should be handled accordingly.
The CLI returns 0 for completed analysis, 1 when a finding reaches --fail-on, and 2 for errors. All npm CLI options, including --format sarif, are available. The Python API raises ScannerError when analysis fails.
Original code is MIT licensed. Bundled Acorn includes its MIT license. No malware samples or active credentials are distributed. See the companion repository and preprint.
Metadata
Release files for unk-scanner 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unk_scanner-0.2.0.tar.gz | 168.0 kB | Without provenance | Details for unk_scanner-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unk_scanner-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for unk_scanner-0.2.0-py3-none-any.whl |
Total release size: 351.5 kB
Release files / unk_scanner-0.2.0.tar.gz
| Download URL | unk_scanner-0.2.0.tar.gz |
|---|---|
| Size | 168.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
859a8dc94db1293f1ebff2583733d8a015493ce6ba336caf65151fec14b836bd
|
|
BLAKE2b-256 checksum How to use checksums |
05b742448779a18f9a77358b51535302595f5690e919b00931ec191018750c13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / unk_scanner-0.2.0-py3-none-any.whl
| Download URL | unk_scanner-0.2.0-py3-none-any.whl |
|---|---|
| Size | 183.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
882fcff1df1b10daee57238e2d07f5e4fdfc88e95efc3578fc2ecf12d47ed7e3
|
|
BLAKE2b-256 checksum How to use checksums |
57f9c552d0312dee40d7d3a18f0cf4c8fa6e7ceae431619fb237cc6fc1bea29e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for unk-scanner 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.