Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script ssl-cert does not retrieve multiple certs from server #2303

Open
git-blame opened this issue May 13, 2021 · 1 comment
Open

Script ssl-cert does not retrieve multiple certs from server #2303

git-blame opened this issue May 13, 2021 · 1 comment
Labels

Comments

@git-blame
Copy link

I ran into a server that has multiple certs configured depending on the negotiated cipher suite. From RFC 5246#7.4.2:

If the server has multiple certificates, it chooses one of them based
on the above-mentioned criteria (in addition to other criteria, such
as transport layer endpoint, local configuration and preferences,
etc.).

ssl-cert uses the librarysslcert.lua's getCertificate() but there are some issues:

  • Library assumes there is only 1 cert per host/port in the cache
  • More importantly, I suspect the function socket:get_ssl_certificate() includes all cipher suites in the ClientHello. Its equivalent non-openssl function: handshake_cert() definitely does (by calling tls.client_hello() without options). So the server will always return the same one, probably the one associated with the most secure suite (or some other criteria).

However, if you debug print the cert retrieved by script ssl-enum-ciphers, which probes with multiple ClientHello with different/smaller set of cipher suites, you will see that there could be different certs on such a server.

It would be great if ssl-cert can enumerate all the certs configured on a server.

@git-blame git-blame added the Nmap label May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@git-blame and others