Skip to main content

tls-scan

CLI tool to scan IP addresses for TLS/SSL certificates. Outputs results in JSONL format. Useful for detecting software such as VMWare.

Installation:

pip install tls-scan

This tool does not use third-party dependencies and can be run as a script.

Usage:

$ tls-scan -h

Example #1: scan whole internet:

$ tls-scan -v -a 0.0.0.0/0

Output sample:

{"ip": "193.201.66.1", "port": 443, "port_name": "https", "cert": {"subject": {"countryName": "LV", "localityName": "Rīga", "organizationName": "AS PrivatBank", "commonName": "*.privatbank.lv"}, "issuer": {"countryName": "US", "organizationName": "DigiCert Inc", "commonName": "DigiCert TLS RSA SHA256 2020 CA1"}, "version": 3, "serialNumber": "0CE443B97F070F5500D008EEDFB11F88", "notBefore": "Aug 12 00:00:00 2022 GMT", "notAfter": "Aug 24 23:59:59 2023 GMT", "subjectAltName": [["DNS", "*.privatbank.lv"], ["DNS", "www.privatbank.lv"], ["DNS", "ibank.privatbank.lv"], ["DNS", "b2a2.privatbank.lv"], ["DNS", "open.privatbank.lv"], ["DNS", "sof.privatbank.lv"]], "OCSP": ["http://ocsp.digicert.com"], "caIssuers": ["http://cacerts.digicert.com/DigiCertTLSRSASHA2562020CA1-1.crt"], "crlDistributionPoints": ["http://crl3.digicert.com/DigiCertTLSRSASHA2562020CA1-4.crl", "http://crl4.digicert.com/DigiCertTLSRSASHA2562020CA1-4.crl"]}, "hostname": "b2a2.privatbank.lv"}

You can specify the port using -p. Instead of a port number or port range, you can use an alias: smtp, imap, pop, https, ldap, rdp, ftp, telnet, cpanel, whm, kuber, portainer, proxmox, webmin, redis, activemq. Specify all to scan all listed ports and common for the most common ones.

Example #2: extract domains from certificate using jq:

$ tls-scan -a ... -p https smtp | jq -r '.cert.commonName, ( .cert.subjectAltName?[] | select(.[0]=="DNS")[1] ), .hostname | select(.)'
...
*.privatbank.lv
www.privatbank.lv
ibank.privatbank.lv
b2a2.privatbank.lv
open.privatbank.lv
sof.privatbank.lv
b2a2.privatbank.lv
...

Metadata

Release files for tls-scan 0.1.7

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

Source distribution (sdist)

Source distribution for tls-scan 0.1.7
File Size Uploaded
tls_scan-0.1.7.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tls-scan 0.1.7
File Interpreter ABI Platform
tls_scan-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 15.3 kB

Release files / tls_scan-0.1.7.tar.gz

Download URL tls_scan-0.1.7.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5042f968f0b49fd4eff0bb22103179313bc509cf105d0528b221cf2b2f9ccd7b
BLAKE2b-256 checksum
How to use checksums
d340840bd7e647d628eccb7d62a3a54efb017fa81a9c51c296fd5fb04b492d41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.7 Linux/6.7.4-arch1-1

Release files / tls_scan-0.1.7-py3-none-any.whl

Download URL tls_scan-0.1.7-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e145c3370b1c7b86ddd9e91d7070b1115938d1ab4d3aa2e7490203036a3281f
BLAKE2b-256 checksum
How to use checksums
ce775a3f3cf45add48bd74b1e8b693e99dcb361b533cd2a0d245fadccd8c7a77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.7 Linux/6.7.4-arch1-1

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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