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

Once published:

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.0

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.0
File Size Uploaded Provenance Actions
unk_scanner-0.1.0.tar.gz 145.5 kB Without provenance Details for unk_scanner-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 302.3 kB

Release files / unk_scanner-0.1.0.tar.gz

Download URL unk_scanner-0.1.0.tar.gz
Size 145.5 kB
Tags Source
SHA-256 checksum
How to use checksums
67525d9a858a2e2c55df65eb2a29547d04951fcc41b7e4530752cf3ed8579451
BLAKE2b-256 checksum
How to use checksums
d1c6683149b7d1d64b37fdafc4b033e083d4fcd6bdadbf490fe992c2f6c7f16f
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.0-py3-none-any.whl

Download URL unk_scanner-0.1.0-py3-none-any.whl
Size 156.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48f85599002ff1d0a2faa4174e34b24b14e4cb71a97c5b47fb7a2b286926d1c1
BLAKE2b-256 checksum
How to use checksums
38d66d9923a5a2f3a0e78173f2c3db4d4a37e8fee9f452ada8f2d34a87d7efec
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.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.

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