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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blacklight_cli-0.3.0.tar.gz (60.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blacklight_cli-0.3.0-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file blacklight_cli-0.3.0.tar.gz.

File metadata

  • Download URL: blacklight_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 60.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for blacklight_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5c932ef02e3f8578433369373b493e7b34bb9815c9dc8194541f2c95c6388131
MD5 c605920e8e9c8702d8d116998fcdf842
BLAKE2b-256 89b0de319158be597e59a1e70d65e01edf39bb788414091a95e00e1d7c63d0a1

See more details on using hashes here.

File details

Details for the file blacklight_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: blacklight_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for blacklight_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aca8d4a0047d751738962cb408ac9abb87b8fd642d19914526b332680579e56b
MD5 72aae6fa60929cd51313713795723385
BLAKE2b-256 3efa348056a350ff640f84ebd2fcd6315fe5cf0aceabe78a2ca50b1b3ec5a638

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.2

2 files

This release

0.3.0 This release

2 files

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