Cannot Decrypt SSL/TLS Packets Using Pre-Master Secret Log File
Hi,
I'm trying to decode SSL/TLS packets in WireShark.
I set the Windows environmental variable SSLKEYLOGFILE=C:\Users\Dave\ssl-keys.log Just in case, I rebooted.
I then visited several web sites including the one I'm trying to decrypt messages. I did see the log file was written and the contents appear to be normal.
I then started a capture and used a curl command. I find the encrypted packets and my Pre-Master Secret log filename is correct, as shown in the banner above the packets.
Yet, I'm still not able to see decrypted messages.
What am I doing wrong?
Thanks,
Dave
Where does your version of "curl" come from? Look at the Properties -> Details of the file to find out.
I ask, because there's a possibility it's a binary that's linked to SChannel which does not observe the SSLKEYLOGFILE env var.
Hi grahamb,
Thanks for the reply. Here's the curl version information. I honestly don't remember where I got curl.
Thanks again,
Dave
Same as mine, and as you can see in the version info it's using
Schannel
, so won't emit pre-master secrets.Not sure where I got mine, I think it's part of the "standard" Windows install these days. Ahh, see here for more info about the MS build.
Have you tried a bigger hammer?
https://learn.microsoft.com/en-us/win...
Kind of overkill to load WSL and a linux image just for curl but it does work.
(currently using ancient ubuntu 18.04)
Yeah, actually went that route. Installed WSL but got UBUNTU errors. Investigated those, requiring updates to the BIOS. Searched into that, but couldn't find what was needed by UBUNTU, so I gave up and backed that all out.
Looks like (not tested yet) that you could get a very basic poller/query using openssl s_client.
(Openssl list of Windows binaries: https://wiki.openssl.org/index.php/Bi...)
Certainly not all the functionality of
curl
but may help someone that comes across this in the future.One of the reasons I'm running the old ubuntu is that it looked painful to upgrade from WSL 1 to WSL 2.
Was your install WSL 2? Is WSL 1 still an option to load?
If the rabbit gets too deep, can it ever dig its way out of the rabbit hole? Yet to be determined...
It appears there is no way to decrypt traffic with curl running under Windows. Correct? I will go back and look at WSL and try again. This involves reboots and BIOS updates.
Is there a way to use openssl s_client to do decrypt the curl traffic? I read the openssl documentation and I don't understand if or how to do this.
I thought there might be a work around by decrypting the traffic between a browser and the server. I can capture the traffic in WireShark, but now I no longer see TLS but QUIC. (Ooops, slipped further into that rabbit hole.) It appears there is no way to decrypt QUIC packets. True?
Here's my basic problem:
Using a browser, I can communicate with the server.
Using ...(more)
The
openssl
cli took me to the "certificates" rabbit hole which will require more research. :-)Not sure if your wsl install was defaulting to version 2 but see here that it requires tighter os integration:
https://learn.microsoft.com/en-us/win...
You might have success by forcing it to be a version 1 install which may not have the BIOS issues.
https://learn.microsoft.com/en-us/win...
I don't get an option to choose which version of WSL to use.
When Ubuntu runs, I get:
WslRegisterDistribution failed with error: 0x80370102 Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
Virtual Machine Platform is installed. I see no way to change virtualization in the BIOS.
I just fell to the bottom of this rabbit hole and am now dead.