From: https://serverfault.com/a/881415
nmap -p 443 --script ssl-cert gnupg.org
The -p 443
specifies to scan port 443 only. All ports will be scanned if it is omitted, and the certificate details for any SSL service that is found will be displayed. The --script ssl-cert
tells the Nmap scripting engine to run only the ssl-cert
script. From the doc, this script "(r)etrieves a server's SSL certificate. The amount of information printed about the certificate depends on the verbosity level."
Sample output:
Starting Nmap 7.40 ( https://nmap.org ) at 2017-11-01 13:35 PDT
Nmap scan report for gnupg.org (217.69.76.60)