SkillAgentSearch skills...

SslMasterKey

Retrieve the Master Key and Client Random from an ssl.SSLSocket

Install / Use

/learn @joernheissler/SslMasterKey
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SslMasterKey

Python module to retrieve the Master Key and Client Random from an ssl.SSLSocket.

This can be used to decrypt TLS traffic with WireShark. See https://wiki.wireshark.org/SSL#Using_the_.28Pre.29-Master-Secret for more details.

Deprecated

For python >= 3.8 use https://docs.python.org/3/library/ssl.html#ssl.SSLContext.keylog_filename instead!

Requirements

  • cpython
  • libssl1.1

Usage

  • Dump your encrypted traffic into a pcap file.
  • Use get_ssl_master_key on your ssl.SSLSocket.
  • Write its output (CLIENT_RANDOM .....) into a text file.
  • In WireShark in the protocol preferences for SSL, set the "(Pre)-Master-Secret log filename" to this file.
  • Load the pcap file.

Help wanted

The code is ugly. Please improve it, e.g.:

  • Port it to cffi
  • Add support for other OpenSSL versions
  • Add support for PyPy

Related Skills

View on GitHub
GitHub Stars14
CategoryDevelopment
Updated11mo ago
Forks6

Languages

Python

Security Score

82/100

Audited on Apr 15, 2025

No findings