Updated Jul 15, 2026

Recon

Inventory TLS handshakes and certificates across hosts

TLS handshake and certificate grabs for host lists.

Agent

overview

What zgrab2-tls does

zgrab2-tls is the TLS module of zgrab2. Pointed at hosts, it completes a handshake and records the server certificate and chain, negotiated version and cipher suite, and handshake extensions as structured JSON.

Steer the ClientHello with --port, --server-name or --no-sni, --min-version and --max-version, and --cipher-suite. Enable --heartbleed to test during the grab, and --verify-server-certificate when chain trust must hold.

The node reads a host list via input-file and writes FILE plus FOLDER of JSON. Run it after a port scan finds TLS listeners. Prefer zgrab2-jarm for a clustering hash, or sslyze when one host needs a deep cipher audit.

source github.com/zmap/zgrab2

use cases

Where zgrab2-tls fits

Inventory certificates at scale

Grab the TLS handshake for every host in a list and capture the certificate and chain as JSON, building a structured certificate inventory across the estate.

Find weak protocol or cipher settings

Pin min and max versions and advertise cipher lists to test which hosts negotiate outdated TLS or weak ciphers worth flagging for remediation.

Map certificates back to hosts

Pull subject and SAN data from the grabbed certificates to relate hosts that share a certificate, exposing related infrastructure.

Survey TLS after a port scan

Feed open TLS ports from a scanner into zgrab2-tls so each one gets a full handshake grab instead of a guess about what is listening.

reference

zgrab2-tls inputs and flags

37 inputs
NameTypeFlagDescription
input-fileFILE·Input file of hosts to grab.
portSTRING--portPort to grab on (default 80).
server-nameSTRING--server-nameServer name used for certificate verification and SNI.
min-versionSTRING--min-versionMinimum acceptable SSL/TLS version.
max-versionSTRING--max-versionMaximum acceptable SSL/TLS version.
cipher-suiteSTRING--cipher-suiteComma-delimited list of hex cipher suites to advertise.
verify-server-certificateBOOLEAN--verify-server-certificateFail if the certificate does not match the server name or chain to a trusted root.
heartbleedBOOLEAN--heartbleedCheck if the server is vulnerable to Heartbleed.

Showing key inputs. zgrab2-tls exposes 37 inputs in total.

Full flag reference (37 inputs)
NameTypeFlagDescription
sctBOOLEAN--sctRequest Signed Certificate Timestamps during TLS Handshake
portSTRING--portSpecify port to grab on (default: 80)
timeSTRING--timeExplicit request time to use, instead of clock. YYYYMMDDhhmmss format.
debugBOOLEAN--debugInclude debug fields in the output.
flushBOOLEAN--flushFlush after each line of output.
inputSTRING·Input target
no-sniBOOLEAN--no-sniDo not send domain name in TLS Handshake regardless of whether known
sendersSTRING--sendersNumber of send goroutines to use (default: 1000)
timeoutSTRING--timeoutSet connection timeout (0 = no timeout) (default: 10s)
triggerSTRING--triggerInvoke only on targets with specified tag
maxbytesSTRING--maxbytesMaximum byte read limit per scan (0 = defaults)
no-ecdheBOOLEAN--no-ecdheDo not allow ECDHE handshakes
root-casFILE--root-casSet of certificates to use when verifying server certificates
gomaxprocsSTRING--gomaxprocsSet GOMAXPROCS (default: 0)
heartbleedBOOLEAN--heartbleedCheck if server is vulnerable to Heartbleed
input-fileFILE·Input file
prometheusSTRING--prometheusAddress to use for Prometheus server (e.g. localhost:8080). If empty, Prometheus is disabled
dsa-enabledBOOLEAN--dsa-enabledAccept server DSA keys
max-versionSTRING--max-versionThe maximum SSL/TLS version that is acceptable. 0 means use the highest supported value.
min-versionSTRING--min-versionThe minimum SSL/TLS version that is acceptable. 0 means that SSLv3 is the minimum.
next-protosFILE--next-protosA list of supported application-level protocols
server-nameSTRING--server-nameServer name used for certificate verification and (optionally) SNI
certificatesFILE--certificatesSet of certificates to present to the server
cipher-suiteSTRING--cipher-suiteA comma-delimited list of hex cipher suites to advertise.
client-helloSTRING--client-helloSet an explicit ClientHello (base64 encoded)
client-randomSTRING--client-randomSet an explicit Client Random (base64 encoded)
session-ticketBOOLEAN--session-ticketSend support for TLS Session Tickets and output ticket if presented
certificate-mapFILE--certificate-mapA file mapping server names to certificates
extended-randomBOOLEAN--extended-randomSend TLS Extended Random Extension
keep-client-logsBOOLEAN--keep-client-logsInclude the client-side logs in the TLS handshake
curve-preferencesSTRING--curve-preferencesA list of elliptic curves used in an ECDHE handshake, in order of preference.
heartbeat-enabledBOOLEAN--heartbeat-enabledIf set, include the heartbeat extension
read-limit-per-hostSTRING--read-limit-per-hostMaximum total kilobytes to read for a single host (default 96kb) (default: 96)
connections-per-hostSTRING--connections-per-hostNumber of times to connect to each host (results in more output) (default: 1)
signature-algorithmsSTRING--signature-algorithmsSignature and hash algorithms that are acceptable
extended-master-secretBOOLEAN--extended-master-secretOffer RFC 7627 Extended Master Secret extension
verify-server-certificateBOOLEAN--verify-server-certificateail if the server certificate does not match the server-name, or does not chain to a trusted root.

example

Run zgrab2-tls

zgrab2-tls · command
# TLS grab on 443 for a host list, limit senderszgrab2 tls --port 443 --input-file hosts.txt --senders 200 --timeout 10s --output-file tls.json
sample output
{"ip":"198.51.100.10","data":{"tls":{"status":"success","result":{"handshake_log":{"server_certificates":{"certificate":{"parsed":{"subject_dn":"CN=www.example.com","issuer_dn":"CN=Example CA"}}},"server_hello":{"version":771,"cipher_suite":{"id":4865,"name":"TLS_AES_128_GCM_SHA256"}}}}}}{"ip":"198.51.100.22","data":{"tls":{"status":"success","result":{"handshake_log":{"server_hello":{"version":771}}}}}}{"ip":"203.0.113.40","data":{"tls":{"status":"success","result":{"handshake_log":{"server_certificates":{"certificate":{"parsed":{"subject_dn":"CN=api.example.com"}}}}}}}}{"ip":"203.0.113.55","data":{"tls":{"status":"connection-timeout"}}}{"ip":"198.51.100.90","data":{"tls":{"status":"success","result":{"handshake_log":{"server_hello":{"version":770}}}}}}{"ip":"203.0.113.100","data":{"tls":{"status":"success","result":{"handshake_log":{"server_hello":{"cipher_suite":{"name":"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"}}}}}}}

guidance

Choosing zgrab2-tls

Use zgrab2-tls to grab certificates and handshake detail across many hosts after a port scan finds TLS services. For one clustering hash, use zgrab2-jarm. For deep single-host auditing, use sslyze.

zgrab2-jarm

One JARM hash per host for clustering. Use it to group hosts, not to inspect certificates.

tlsx

TLS data toolkit with rich output options. Close alternative for certificate and handshake fields.

sslyze

Deep TLS configuration analyzer for one host. Prefer it for thorough cipher and protocol audits.

faq

zgrab2-tls questions

Handshake results as JSON: server certificate and chain, negotiated version and cipher suite, and handshake extensions when present.

Run zgrab2-tls yourself

A CIDR range feeds zmap, which finds open TLS ports and passes them to zgrab2-tls so each service's handshake and certificate land as a queryable output.

Facts on this page come from the live Trickest tool library.