Nmap – get ssl expiration from fqdn

nmap

lets say i have the following url:

www.domain.com:4567/blabla/index.html

I'm trying to get its' ssl expiration date.

There's this:

nmap --script=ssl-cert.nse -p 9194 www.domain.com

but it doesnt quite work.
I'm unable to find the right argument in nmap.

Edit: I could go for Openssl but I need a Windows based solution.

Best Answer

The URL you showed is for port 4567. Therefore, you need to use that port in your Nmap scan: nmap -p4567 --script ssl-cert www.domain.com

Also, if the port you're scanning is not one of the typically-expected ports for SSL/TLS, then the script might not run. You can force it to run by adding + to the script name (not recommended for scans of multiple ports): nmap -p4567 --script +ssl-cert www.domain.com. Newer versions of Nmap will usually not need this because they will just try a probe to check if they can open a SSL connection anyway.