This is our old Q&A Site. Please post any new questions and answers at

Hey All,

I am looking for a way to decrypt non-browser based traffic (i.e. e-mail, Citrix ICA, SFTP) on my local machine utilizing pre-master secrets. I know this is possible when utilizing the SSLKEYLOGFILE as described here,

The above link only appears to work for browser based traffic. My question is, how can I do the same level of decryption using Wireshark and pre-master secrets for non-browser based traffic?

Thank you for the help!

asked 12 Jan '14, 09:33

Brooks's gravatar image

accept rate: 0%

Kurt,I can obtain the first part of the requirement the Session-ID from the Wireshark trace. The master key will be the tough part. I am a bit new to OpenSSL, but it appears possible to extract the master key by parsing through memory. The article link below provides more information on that topic,

Jmayer, thank you for the comment. I do not have access to the source code for the applications, so I will be unable to add any additional code.

(14 Jan '14, 15:02) Brooks

I know its late but If you have the source code of the application then you can extract the master key from the SSL structure which is used to make the ssl system calls like ssl_write and so on..

(19 Feb '15, 02:03) koundi

How are you going to get the session keys? The applications you mentioned (most certainly) won't export the session keys, as some browsers do!?!

permanent link

answered 12 Jan '14, 10:36

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
accept rate: 15%

I am a bit new to OpenSSL, but it appears possible to extract the master key by parsing through memory

Yes, that's possible, but only 'easy' if the client software is using the OpenSSL library (easy because other people have documented what to look for). For other Software (ICA, SFTP?, etc.) you will have to do the reverse engineering yourself to get that key. Not impossible, but quite some work.

(14 Jan '14, 16:03) Kurt Knochner ♦

First you will have to find out which of these communication methods use ssl/tls for encryption at all. sftp definitely doesn't, I don't know about the others. The you will need to find out which library is being used to implement ssl/tls. If that library is loaded dynamically, create you own copy of that library and add code to export the (pre-) master secret. Build and the modified lib and replace the existing one with your own build.

permanent link

answered 12 Jan '14, 14:37

jmayer's gravatar image

accept rate: 0%

SFTP does not use SSL/TLS but SSH, that cannot be decrypted with the same methods as SSL.

The link you gave is dead, but it was likely describing a method where you run a NSS browser (Firefox) with SSLKEYLOGFILE. From the comments it seems that you think that SSL Session-ID are the only means to match a master-key, but this is not the case. The CLIENT_RANDOM value can be used instead of the Session-ID.

For applications not using NSS, but OpenSSL, you can use a debugger or interpose the SSL library as documented here. Whether it is HTTP, SMTP, IMAP or FTP, these all use SSL for transport encryption so the same methods apply.

permanent link

answered 16 Feb '15, 00:11

Lekensteyn's gravatar image

accept rate: 30%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 12 Jan '14, 09:33

question was seen: 6,359 times

last updated: 19 Feb '15, 02:03

p​o​w​e​r​e​d by O​S​Q​A