Skip to main content

TLSCertHound - crt.sh collector with recursion, caching, and OpenGraph export.

Project description

TLSCertHound

TLSCertHound is a crt.sh collector focused on large-scale domain discovery from TLS certificates. It supports recursive expansion, cache-backed resumable runs, and OpenGraph export for BloodHound CE using the bhopengraph library.

Feel free to open issues if anything doesn't work (PR are more than welcome as well!)

Features

  • Query crt.sh for certificates related to a domain or keyword.
  • Recursive subdomain discovery with optional depth limit.
  • Automatic throttling that adapts to HTTP 5xx responses.
  • Resumable runs (state persisted per domain).
  • Cache reuse and offline OpenGraph generation.
  • Multi-domain runs from a file with a single combined output.
  • OpenGraph export with Search, TLSCertificate, CA, and domain nodes.
  • Blacklist support (simple patterns with ^, $, and *).

Installation

Recommended (from PyPI):

pip install tls_cert_hound

From source using requirements.txt:

pip install -r requirements.txt

This installs the tls_cert_hound console script and the bhopengraph dependency.

Quick start

Single domain:

tls_cert_hound example.com

Recursive discovery (unlimited depth):

tls_cert_hound example.com --recursive

Recursive with depth 3:

tls_cert_hound example.com --recursive --depth 3

Multi-domain from file:

tls_cert_hound --domain-file domains.txt --recursive --depth 2

Generate OpenGraph only (offline mode):

tls_cert_hound --offline --input-data .tls_cert_hound_data/example.com/example.com_all_cert_data.json

Outputs

Cache and state

  • Cache (per queried domain): .tls_cert_hound_cache/<domain>/<domain>.json
  • State (per root domain, for resume): .tls_cert_hound_cache/<domain>/.tls_cert_hound_state_<domain>.json

Compiled data

Single-domain default:

.tls_cert_hound_data/<domain>/<domain>_all_cert_data.json

Multi-domain default (domain file named domain_list.txt):

.tls_cert_hound_data/domain_list_results/domain_list_all_cert_data.json

Override with --output-data.

OpenGraph

By default, OpenGraph output is placed alongside result data:

.tls_cert_hound_data/<domain|domain file name>/<domain|domain file name>_opengraph.json

Override with --opengraph-output.

OpenGraph model

Nodes:

  • CertIssuerCA
  • TLSCertificate
  • WebDomainName
  • Search

Edges:

  • Issued (CA -> TLSCertificate)
  • IsCommonName (TLSCertificate -> WebDomainName)
  • IsInSAN (TLSCertificate -> WebDomainName)
  • Discovered (Search -> WebDomainName)

Resume and recovery

  • Runs save a state file per root domain.
  • If a request fails after all retries, the current domain is re-queued so a resume will retry it.
  • --ignore-state ignores saved state while still using cache files.
  • --show-result generates outputs from saved state/cache without querying.

Blacklist

Provide a blacklist file with one entry per line:

example.com
*.example.com
^internal\..*$

Only ^, $, and * are supported. Matching domains are skipped and not included in results or OpenGraph output.

CLI reference

usage: tls_cert_hound [domain] [options]

positional arguments:
  domain                  Domain name to query (e.g. example.com) or keyword.

options:
  --domain-file FILE      Read domains from file (one per line).
  --recursive             Enable recursive subdomain discovery.
  --depth N               Max recursion depth (default: unlimited).
  --throttle SECONDS      Initial delay between requests (default: 1.0).
  --no-auto-throttle      Disable adaptive throttling on HTTP 5xx responses.
  --timeout SECONDS       HTTP timeout per request (default: 30).
  --retries N             Retry count for temporary errors (default: 2).
  --blacklist-file FILE   Skip domains matching entries in blacklist file.
  --force-data-refresh    Ignore cached JSON and re-fetch from crt.sh.
  --ignore-state          Ignore saved state files but keep cache reuse.
  --show-result           Generate outputs from saved state/cache only.
  --output-data PATH      Override compiled data output path.
  --input-data PATH       Compiled data input (required with --offline).
  --opengraph-output PATH Override OpenGraph output path.
  --offline               No crt.sh queries; uses --input-data.
  --subdomain-discovery   Output discovered domain names only.
  --pretty                Pretty-print JSON output.
  --no-disk-write         Disable cache/state/data/OpenGraph writes.
  --no-colorized-output   Disable ANSI colors.
  --no-banner             Disable ASCII banner.
  --verbose               Verbose logs.

Notes

  • crt.sh can return transient HTTP 5xx responses; auto-throttle adapts delay and retries.
  • Wildcard SAN/CN entries are preserved as distinct domain nodes (e.g. *.example.com).

License

MIT. See LICENSE.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

tls_cert_hound-1.0.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file tls_cert_hound-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tls_cert_hound-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for tls_cert_hound-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60b1a2027908a6edf7bd5904c453103a4f7c05cff291c068535ac846230e1b6e
MD5 d6262d7ab510bd4416f9fcb37c7b883f
BLAKE2b-256 239f3fee8c2688ec7f030a6502e6470976bb65fecfb9eb9d6c5cfe563d4660a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page