1

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.

6
  • Does this answer your question? Displaying a remote SSL certificate details using CLI tools Commented Sep 27, 2020 at 8:47
  • Nope. That's not nmap.
    – JustAGuy
    Commented Sep 27, 2020 at 11:27
  • 3
    Just out of curiosity: why is it so important to use nmap, and no other tools? I mean, the command you wrote does print the expiration date, all you need to grep it out.
    – Lacek
    Commented Sep 27, 2020 at 12:11
  • 2
    uhm, yes, there are answers to that question that use nmap. But nmap is generally not the tool of choice for this, usually one just uses openssl. Commented Sep 27, 2020 at 12:42
  • doesnt quite work. Would help if you provided the output of the command.
    – Greg Askew
    Commented Sep 27, 2020 at 13:06

2 Answers 2

1

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.

0

The right way to us is:

nmap -sV -p 443 --script ssl-cert example.com

You need to include -sV option for service discovery.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .