Skip to main content

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, source locations, findings, 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 recognizes literal and selected identifier markers, clipboard writes, and one linked AES-GCM loader pattern. It does not decrypt payloads, resolve general aliases or obfuscated string tables, prove execution, or determine whether a file is safe. Exact identity matches cover only the listed bytes.

Input and decompressed sizes are limited to 8 MiB. Parsing uses a worker with a 10-second deadline and V8 heap limits; reports are capped at 10,000 findings. The Python wrapper applies an additional process timeout. Limit failures return an error rather than a partial report. These controls are not an OS security sandbox. Output can contain input strings and should be handled accordingly.

The CLI returns 0 for completed analysis, including findings, and 2 for errors. 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.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unk-scanner 0.1.1
File Size Uploaded Provenance Actions
unk_scanner-0.1.1.tar.gz 145.6 kB Without provenance Details for unk_scanner-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unk-scanner 0.1.1
File Interpreter ABI Platform Actions
unk_scanner-0.1.1-py3-none-any.whl Python 3 none any Details for unk_scanner-0.1.1-py3-none-any.whl

Total release size: 302.3 kB

Release files / unk_scanner-0.1.1.tar.gz

Download URL unk_scanner-0.1.1.tar.gz
Size 145.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0d4f209a19a93ddae96d69f08ea884d903fcc5eff23b89d1e4bc5422ede9998a
BLAKE2b-256 checksum
How to use checksums
9c8c62fee699b6a6deff96a42a470927a852f18ade246ce86fea1408642dfde2
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.1.1-py3-none-any.whl

Download URL unk_scanner-0.1.1-py3-none-any.whl
Size 156.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74a2d22248518560b78575e2c1ab591a973b3b5a3decdba7a521b1dc0b59a78d
BLAKE2b-256 checksum
How to use checksums
d60882dfc0cbdc12c378adf9845ead8653a8f4c1e6c494a56292e1cf7a0ca923
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.1.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page