2025-05-19 16:29:00
2025-05-19 16:29:00
Discovery is a crucial step before implementing any SSL/TLS management solution, especially in complex or distributed IT environments.
To identify how many SSL/TLS certificates an organization has — without reaching out to the Certificate Authority (CA) — you can follow a technical discovery approach. Here's how:
🔍 1. Internal Network Scanning Tools Use network scanning tools to discover certificates in use across internal systems.
Recommended Tools:
nmap -p 443 --script ssl-cert <IP-range>
This reveals certificate details (issuer, subject, expiry, etc.).
SSLyze – Fast scanning of SSL endpoints, retrieves cert data.
OpenVAS or Nessus – Enterprise-grade vulnerability scanners that can include cert discovery.
🗂 2. Asset Inventory Systems Check existing asset or configuration management tools like:
These may contain data on certificate installations or services like IIS, Apache, or NGINX.
🧰 3. Agent-Based Certificate Discovery Deploy agents that search local machines for certificate stores:
You can automate this with:
🌐 4. Passive Network Monitoring Use tools that sniff traffic and identify SSL/TLS handshakes:
These tools detect certs as clients connect to services
📦 5. Web Application & Server Logs Check reverse proxies, load balancers (like F5, NGINX, HAProxy), and WAFs.
These often terminate SSL and may log cert details or point to where they're stored.
📊 6. Commercial Certificate Management Solutions Some solutions offer discovery via:
Examples: Venafi, AppViewX, Keyfactor, Sectigo Certificate Manager.
Note: These tools often don’t need the CA's help. They just look at the systems that are using the certificates.
✅ Summary To discover how many SSL certificates an organization has without contacting the CA, you should:
🔍 Targets
$stores = @(
"LocalMachine\My",
"CurrentUser\My"
)
$results = @()
foreach ($store in $stores) {
$storeScope, $storeName = $store -split "\\"
$location = if ($storeScope -eq "LocalMachine") {
[System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine
} else {
[System.Security.Cryptography.X509Certificates.StoreLocation]::CurrentUser
}
$x509Store = New-Object System.Security.Cryptography.X509Certificates.X509Store($storeName, $location)
$x509Store.Open("ReadOnly")
foreach ($cert in $x509Store.Certificates) {
if ($cert.HasPrivateKey -and $cert.Subject -ne $null) {
$results += [PSCustomObject]@{
Subject = $cert.Subject
Issuer = $cert.Issuer
Thumbprint = $cert.Thumbprint
Expires = $cert.NotAfter
FriendlyName = $cert.FriendlyName
Store = $store
}
}
}
$x509Store.Close()
}
$results | Sort-Object Expires | Format-Table –AutoSize
Notes
$results | Export-Csv -Path "certificates_report.csv" -NoTypeInformation
🔍 What it Does:
#!/bin/bash
# Common locations to scan
CERT_DIRS=(
"/etc/ssl/certs"
"/etc/pki/tls/certs"
"/etc/nginx"
"/etc/apache2"
"/usr/local/share/ca-certificates"
"/opt"
)
echo -e "Found certificates:\n"
echo -e "File Path\t\t\tSubject\t\t\tIssuer\t\t\tExpires"
# Scan for certificate files
for DIR in "${CERT_DIRS[@]}"; do
if [ -d "$DIR" ]; then
find "$DIR" -type f \( -name "*.crt" -o -name "*.pem" -o -name "*.cer" \) 2>/dev/null | while read -r CERTFILE; do
if openssl x509 -in "$CERTFILE" -noout &>/dev/null; then
SUBJECT=$(openssl x509 -in "$CERTFILE" -noout -subject | cut -d'=' -f2-)
ISSUER=$(openssl x509 -in "$CERTFILE" -noout -issuer | cut -d'=' -f2-)
EXPIRES=$(openssl x509 -in "$CERTFILE" -noout -enddate | cut -d'=' -f2)
echo -e "$CERTFILE\t$SUBJECT\t$ISSUER\t$EXPIRES"
fi
done
fi
done
Copyright © 2025 Secure Network Traffic. All rights reserved. SecureNT is a registered trademark of Secure Network Traffic.