Skip to main content

blacklight-cli

Local network vulnerability scanner. Runs nmap service/version detection (-sV), matches detected services against the NVD CVE database, overlays exploitation intelligence (FIRST EPSS + CISA KEV), scores every host 0-100 by risk, and prints a severity-ranked report in the terminal with optional HTML/Markdown/JSON export.

Warning: use only on systems you own or are explicitly authorized to test (e.g. a home lab, Metasploitable VM, or your own infrastructure). Scanning networks without authorization may be illegal. Every scan is logged to ~/.blacklight/scan.log and recorded in the local scan history (~/.blacklight/history.db).

Install

Requires Python 3.11+ and the nmap binary (system package):

  • Debian/Ubuntu: sudo apt install nmap
  • macOS: brew install nmap
  • Windows: choco install nmap

Then install the package (recommended: into an isolated environment):

pipx install blacklight-cli        # isolated env, recommended
# or: pip install blacklight-cli   # into your current env

Usage

blacklight scan 192.168.1.0/24     network scan of hosts/CIDRs
blacklight web http://127.0.0.1    web application scan
blacklight history                 scan history, diffs, and risk trends
blacklight console                 interactive console
blacklight version                 show the installed version
blacklight                         show the banner and command help

Network scans — blacklight scan TARGET...

# Scan a private subnet (default-deny: public ranges are blocked
# unless you pass --i-have-permission)
blacklight scan 192.168.1.0/24

# Scan specific ports, export an HTML report
blacklight scan 192.168.1.10 --ports 22,80,443 -o report.html

# Scan a public host you are authorized to test (interactive confirmation)
blacklight scan 203.0.113.10 --i-have-permission

# JSON export for scripting
blacklight scan 192.168.1.0/24 --format json -o scan.json

Options:

Option Description
TARGET... One or more hostnames, IPs, or CIDRs (192.168.1.10 192.168.2.0/24).
-p, --ports Port range(s) to scan. Default 1-1024 (e.g. 22,80,443, 1-1000, 80,443,8000-9000).
-o, --output Export the report to a file (HTML by default; .md/.json suffixes switch the format automatically).
--format Export format: html, markdown, or json. Default html.
--no-tls-checks Skip TLS certificate/protocol/cipher checks (default: on).
--i-have-permission Confirm you are authorized to scan these targets (required for public ranges).
--no-cache Bypass the local NVD/EPSS cache and fetch fresh data.
--timeout Per-host nmap scan timeout in seconds. Default 30.

Web scans — blacklight web URL

# Scan a local web app (private targets need no flag)
blacklight web http://127.0.0.1:8080

# Scan a public site you are authorized to test (interactive confirmation)
blacklight web https://example.com --i-have-permission

# Export
blacklight web http://127.0.0.1:8080 -o web_report.html

Options: --i-have-permission, --no-cache, -o/--output, --format (html | markdown | json, default html), --timeout (HTTP request timeout in seconds, default 30).

Checks: missing security headers (X-Frame-Options, CSP, HSTS, ...), exposed files and admin paths (.git/config, .env, phpinfo, wp-admin, backups), directory listing, default install pages, error-based SQLi / reflected XSS / command-injection probes on discovered GET parameters, and tech fingerprinting (server/framework versions) fed through the same CPE → NVD CVE pipeline as network scans. Web findings are scored by severity only — CVE-backed rows show EPSS/KEV enrichment but it does not add to the web score (conservative by design) — and exported alongside network findings in HTML/Markdown/JSON reports.

Scan history — blacklight history

Every network and web scan is recorded in a local SQLite database (~/.blacklight/history.db): timestamp, target, authorization flag, host and service counts, and the full finding set (severity, CVSS, EPSS, KEV, and the fingerprint used for diffing).

# List the 20 most recent scans, newest first
blacklight history

# Diff the latest scan of a target against its previous scan
blacklight history diff 192.168.1.10

# Diff against the newest scan at/before a cutoff
blacklight history diff 192.168.1.10 --since 7d        # N days ago
blacklight history diff 192.168.1.10 --since 2026-07-01  # end of that day (UTC)

# List unchanged findings too (collapsed to a count line by default)
blacklight history diff 192.168.1.10 --verbose

# Risk-score trend for a target, oldest scan first
blacklight history trend 192.168.1.0/24
blacklight history trend 192.168.1.0/24 --host 192.168.1.20   # one host only
blacklight history trend 192.168.1.10 --limit 10              # newest 10 scans

What a diff shows:

  • NEW findings — present in the latest scan, not in the baseline.
  • FIXED findings — in the baseline, gone from the latest scan.
  • UNCHANGED findings — present in both (a single count line unless --verbose).
  • Risk score delta — latest minus baseline score, classified as worsened / improved / unchanged (delta beyond ±0.05). Network scores are the max host risk score in the scan; web scans use the web risk score.

Exit codes: 0 for success and for the no-history / no-previous-scan messages; 1 for a corrupt history database or a bad --since value.

Interactive console — blacklight console

An msfconsole-style session with the same functionality as the CLI:

blacklight > help
blacklight > use scan
blacklight (scan) > set TARGET 192.168.1.10
blacklight (scan) > set PORTS 22,80,443
blacklight (scan) > run
blacklight (scan) > history              list recent scans
blacklight (scan) > history 192.168.1.10 diff that target
blacklight (scan) > trend 192.168.1.10   risk-score trend
blacklight (scan) > back
blacklight > exit

Commands: help, modules, use <module>, show options, set <OPTION> <value>, unset <OPTION>, run, back, history, history <target>, trend <target>, exit / quit. Command names tab-complete. history and trend are available without selecting a module.

Modules and their options:

Module Options
scan TARGET, PORTS, OUTPUT, FORMAT, NO_CACHE, TIMEOUT, PERMISSION
web TARGET, TIMEOUT, NO_CACHE, OUTPUT, FORMAT, PERMISSION

PERMISSION accepts true/false; set it true to authorize scanning public targets (you will still be asked to confirm interactively).

Version — blacklight version

blacklight version
# blacklight-cli 0.3.0

NVD API key (optional)

A free NVD API key raises the rate limit from 5 to 50 requests per 30 seconds. Set it once: export BLACKLIGHT_NVD_KEY=your-key (Request one at https://nvd.nist.gov/developers/request-an-api-key)

How it works

  1. Scan — shells out to nmap -sV -oX -, parses host/port/service/version.
  2. Match — maps each service to a CPE identifier and queries NVD for affected CVEs (cached in ~/.blacklight/cache/, refreshed weekly).
  3. Enrich — adds FIRST EPSS exploitation probability and a badge for CVEs on the CISA Known Exploited Vulnerabilities list (feed refreshed daily).
  4. Score — each host gets a 0-100 risk score: severity-weighted base (critical=20, high=10, medium=4, low=1, capped at 60) + 10 per KEV finding (capped at 20) + max EPSS x 10; total capped at 100.
    • TLS checks — on TLS-enabled ports, nmap's ssl-cert and ssl-enum-ciphers scripts inspect certificate expiry (expired = high), legacy protocols (SSLv3 = high, TLSv1.0 = medium, TLSv1.1 = low), weak ciphers (NULL/EXPORT/anonymous = high; RC4/single-DES = medium), and self-signed certs; findings score and report like service findings.
  5. Report — rich terminal table sorted by CVSS, summary panel, and HTML/Markdown/JSON export.
  6. History — every scan (network and web) is stored in ~/.blacklight/history.db; blacklight history diff and blacklight history trend compare findings and scores between scans without re-scanning.

Guardrails

  • Only private RFC1918 ranges and loopback are scannable by default.
  • Public targets require --i-have-permission plus an interactive confirmation.
  • Every scan is logged with timestamp, target, and outcome to ~/.blacklight/scan.log and recorded in ~/.blacklight/history.db.

Development

pip install -e ".[dev]"
pytest

License

MIT

Metadata

Release files for blacklight-cli 0.3.2

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

Source distribution (sdist)

Source distribution for blacklight-cli 0.3.2
File Size Uploaded Provenance Actions
blacklight_cli-0.3.2.tar.gz 69.5 kB With provenance Details for blacklight_cli-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for blacklight-cli 0.3.2
File Interpreter ABI Platform Actions
blacklight_cli-0.3.2-py3-none-any.whl Python 3 none any Details for blacklight_cli-0.3.2-py3-none-any.whl

Total release size: 120.7 kB

Release files / blacklight_cli-0.3.2.tar.gz

Download URL blacklight_cli-0.3.2.tar.gz
Size 69.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fffaee9839b4f7f9df63102ddf87fdd0250902dab427e1715e13a1270fbf31af
BLAKE2b-256 checksum
How to use checksums
dd7d1839905db9ae580c7b78a726261b7c1467953d9668ffe6c5288c623de356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / blacklight_cli-0.3.2-py3-none-any.whl

Download URL blacklight_cli-0.3.2-py3-none-any.whl
Size 51.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00b5620db360ca1bfd0c49a8737662320d4775a240d030c68bfddfa79a35398b
BLAKE2b-256 checksum
How to use checksums
df07f92d73de5ad19f30695f3fd22768d398829b3c5d085969c1d29ded540e42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Security for blacklight-cli 0.3.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for blacklight_cli-0.3.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files Full provenance

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