Scan IP addresses for TLS/SSL certificates
Project description
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
...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tls_scan-0.1.7.tar.gz.
File metadata
- Download URL: tls_scan-0.1.7.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.7 Linux/6.7.4-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5042f968f0b49fd4eff0bb22103179313bc509cf105d0528b221cf2b2f9ccd7b
|
|
| MD5 |
054b03043de6106aab96edbb5a422cbe
|
|
| BLAKE2b-256 |
d340840bd7e647d628eccb7d62a3a54efb017fa81a9c51c296fd5fb04b492d41
|
File details
Details for the file tls_scan-0.1.7-py3-none-any.whl.
File metadata
- Download URL: tls_scan-0.1.7-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.7 Linux/6.7.4-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e145c3370b1c7b86ddd9e91d7070b1115938d1ab4d3aa2e7490203036a3281f
|
|
| MD5 |
3fdde5d95d3eacc865f0c493cd1596ae
|
|
| BLAKE2b-256 |
ce775a3f3cf45add48bd74b1e8b693e99dcb361b533cd2a0d245fadccd8c7a77
|