4

I am implementing a TLS connection with a basic server and client. It’s a one way connection: the server has a certificate chained to the CA, and the client has a collection of trusted root certificates.

Is it possible for a tool to log the connection as a man in the middle, but authorized? For the server this tool would appear to be a client; for the client it would be seen as the server.

Is this possible? Which certificates does this tool need?

TRiG
  • 609
  • 5
  • 14
Jean
  • 143
  • 5
  • 1
    Yes, there is a company that does authorized MiTM commercially called Blue Coat. The fake certificate gets pushed onto the customers workstations via group policy and as a user you are unaware of it till you look at the properties of the cert' and see their name! – back_ache Apr 23 '15 at 13:57
  • And how do they verify any of the sites that they are pushing out fake certs for? Very irresponsible to give users a false sense of security and possibly even negligent if data is leaked because of any of the various additional weaknesses they are introducing without warning the user about. – JamesRyan Apr 23 '15 at 14:41
  • Cisco, Microsoft, and other companies also have SSL inspection features that work the same way... – makerofthings7 Apr 27 '15 at 01:09

3 Answers3

8

You just need to add the tool certificate in the trust store of the client, so that the client trust your "tool as a server". Then in order not to have any errors, every time the client tries to open a TLS connection, you have to clone the actual cert with your custom CA:

  • Client tries to initiate connection with the server, it goes through your proxy

  • The proxy initiates actual connection with the server, gets the server certificate back

  • The proxy creates a new certificate with the same CN but with its custom CA

  • The proxy responds to the client with that new certificate, it's trusted by the client because you added your custom CA in the client trust store

Also be wary of propagating possible certs errors to the clients (not like Lenovo for instance..)

Dillinur
  • 468
  • 3
  • 7
  • Can you recommend a proxy server software which does this? I know there is one, but I can't remember its name right now. – Philipp Apr 23 '15 at 09:36
  • CN stands for Common Name ? (SSL beginner here) – Jean Apr 23 '15 at 10:41
  • @Philipp see lorenzog's answer for a link with tools. Otherwise I'd say that writing up your own proxy might be a very valuable exercise. – Dillinur Apr 23 '15 at 11:35
  • @JeanRene yes it does, but it's actually a simplification in this case. Ideally, you want to clone every single attribute of the original certificate except the for the CA (so that's CN, signature choice, creation & expiration date, cert role, etc) – Dillinur Apr 23 '15 at 11:36
3

Did you take a look at this answer? There are a few tools listed.

However the key point for you is to have a certificate that your client will accept. To answer your question, in its simplest form you need:

  • A valid SSL certificate (signed by the CAs that are trusted by the client)
  • Control of DNS resolution (but if you control the environment you'd have your tool set up on the gateway, as suggested in the comments)

A possible scenario would be:

  1. With DNS resolution:

    1. Client looks up server IP
    2. Your DNS resolves it to the IP address of your tool
  2. Client connects to your tool

  3. Your tool responds with a signed certificate for the requested hostname
  4. ...
  5. Profit! Also, MiTM

A slightly modified version of this set up is to install on your client the certificate of your own CA, with which you can sign the SSL certificate of your tool. Since you talk about 'authorised' SSL stripping, I assume you have control of the client environment.

lorenzog
  • 1,911
  • 11
  • 18
0

Zorp Firewall (http://en.m.wikipedia.org/wiki/Zorp_firewall) can do this. It supports not only web/http but a couple other protocols too. Also it is very lightweight, easily deployable on an OpenWRT device.

You will have to get trusted your proxy CA by clients though, but in an authorized scenario it should not be a problem.

djozsef
  • 161
  • 1
  • 1
  • 8