pwn3d.es

Visual guide

TLSKeyLab

What each part of tlskeylab does to read your own HTTPS traffic in Wireshark: the console, the key log file and the already-decrypted capture.

~2 MB
a single Go binary
100 %
reversible
TLS 1.2/1.3
both versions
0
attacks on the crypto
>_ pwn3d.esLEARNTLSKeyLab
  1. 01 Console
  2. 02 Keylog
  3. 03 Wireshark

3 screens · 10 parts explained

The console: set up, launch and capture

Everything is done with tlskeylab.exe subcommands on Windows. Every action is logged and can be undone.

tlskeylab.exe setup

✔ %USERPROFILE%\tlskeylab\sslkeys.log

✔ SSLKEYLOGFILE (user)

folder shared read-only

tlskeylab.exe status

SSLKEYLOGFILE
OK
keys
148
share
RO
firewall
rule

tlskeylab.exe launch chrome

chrome inherits the variable

tlskeylab.exe capture 30 -i 4

dumpcap → capture_1042.pcapng

✔ 30 s · 2 318 packets

  1. setup
  2. launch
  3. capture
  4. tlsviewer
  5. uninstall
CSS mock-up: a recreation of the interface to explain it, not the running tool. Hover a note to see its area.
  1. setup

    Creates the key log file and sets SSLKEYLOGFILE for your user. It is the only system change, and it is reverted later.

  2. status

    Shows at a glance the variable, how many keys have been written, the share and the firewall rule.

  3. launch and capture

    Opens the browser so it inherits the variable and records traffic with dumpcap next to the key log.

  4. Full cycle

    From setup to uninstall. uninstall keeps the files; --purge deletes them too.

How it is used

  1. setup

    Create the key log and set the variable.

  2. Browse and capture

    Launch the browser through tlskeylab and record with capture.

  3. Open in Wireshark

    tlsviewer.py prepares everything and shows the decrypted traffic.

  4. Undo

    uninstall returns the system to its previous state.

Key concepts

SSLKEYLOGFILE
A standard environment variable: if set, browsers and TLS libraries write their session secrets there.
ClientHello
The first TLS handshake message; its Random field identifies the session.
pcapng
The network capture format Wireshark opens.
ECDHE
Ephemeral key exchange: without each session’s secret it cannot be decrypted, not even with the server key.

Want to use it for real?

tlskeylab only decrypts traffic from your own processes on your own machine. The full tool and its download are on the official site.