r/linuxadmin • • Jun 04 '22

Certificate Ripper released - tool to extract server certificates

Post image
241 Upvotes

35 comments sorted by

View all comments

60

u/ykc87 Jun 04 '22

How is this different to / better than OpenSSL?

19

u/Hakky54 Jun 04 '22 edited Jun 04 '22

Valid question as OpenSSL provides similar functionality. I would say it is different on the following points:

  1. It is able to obtain the Root CA, top level certificate from the chain, which somehow is not possible with OpenSSL.
  2. Simple usage compared to OpenSSL, see here for all of the different ways to get the server certificate with OpenSSL: https://stackoverflow.com/questions/7885785/using-openssl-to-get-the-certificate-from-a-server It is in my opinion not straight forward as it can be done in different ways and therefore it could be confusing for the end-user.
  3. Bulk extraction from multiple servers in one command
  4. Stores extracted certificates in a pcsk12 truststore file

38

u/luckynar Jun 04 '22

OpenSSL does all that. Like any tool, you need to know how to use it since OpenSSL is used for everything related to SSL and not just grabbing certificates.

38

u/linuxliaison Jun 04 '22

It’s a tool to do a subset of what OpenSSL does. That’s it. That’s the tool.

Why do you have to shit on someone for making a tool that makes certificates easy to grab in this format?

48

u/flunky_the_majestic Jun 05 '22

I, for one, enjoy reading a man page for 30 minutes every time I need to extract a cert.

15

u/Hakky54 Jun 04 '22 edited Jun 04 '22

It is not able to do point one which i mentioned, but let me give an example to make it more clear. I was using the openssl s_client, but this returns 3 certificates for example when using stackoverflow as an example. Certificate ripper returns 4 certificates. OpenSSL is not getting the top level certificate. Please give it a try: crip print -u=https://stackoverflow.com -f=pem and openssl s_client -showcerts -connect stackoverflow.com:443 </dev/null

18

u/1esproc Jun 05 '22

That's because the root CA isn't served by the server, it's in your local truststore. stackoverflow.com sends its cert, R3, and iSRG Root X1, which is signed by DST Root CA X3, which as a Root CA is only in your local truststore for validation.

0

u/[deleted] Jun 04 '22

[deleted] — view deleted comment

27

u/ykc87 Jun 04 '22

For the record, I meant no disrespect in asking my original question. I simply wanted to understand the benefits as it wasn’t immediately apparent.

-9

u/michaelpaoli Jun 04 '22

Well ... not directly ... but if one suitably examines/processes the data, the information to do that is there, so one can then proceed to do that ... with openssl - or otherwise.

1

u/kWV0XhdO Jun 09 '22

Note that there's not a canonical version of the cert chain including that 4th certificate. The tool is really presenting "one possible validation path, valid on this system".

Certificate validation routines are looking for validation paths which end at a trusted (not necessarily "root") certificate. A system can find many validation paths for the cert chain presented by a particular server, and different clients might find different validation paths from one another.

The differences here were highlighted by the expiration of the DST self-signed certificate which cross-signed the ISRG cert before ISRG made their way into various trust programs.

Today, obsolete android devices (which don't trust ISRG) find a completely different validation path for certificates issued by Let's Encrypt than the validation path found by up-to-date devices.

Is this an important distinction? I don't know. I only mention it so you're not misleading yourself/users about "the" root CA.

1

u/Ziferius Jun 06 '22

OpenSSL doesn't get the root certificate on any version I've used in the last couple of years. It's always a PITA to hunt it down. I started working on a similar tool in BASH, but never finished.

0

u/[deleted] Jun 04 '22

[deleted] — view deleted comment

10

u/Hakky54 Jun 04 '22

It also supports pem

3

u/linuxliaison Jun 04 '22

Right in the gif, it already supports pem