Wireshark TLS报文解析
Wireshark TLS报文解析
Using the (Pre)-Master-Secret 使用(预)主密钥
The master secret enables TLS decryption in Wireshark and can be supplied via the Key Log File. The pre-master secret is the result from the key exchange and can be converted to a master secret by Wireshark. This pre-master secret can be obtained when a RSA private key is provided and a RSA key exchange is in use.
主密钥用于在 Wireshark 中启用 TLS 解密,可通过密钥日志文件提供。预主密钥是密钥交换的结果,可通过 Wireshark 转换为主密钥。当提供 RSA 私钥并使用 RSA 密钥交换时,即可获取此预主密钥。
Step-by-step instructions to decrypt TLS traffic from Chrome or Firefox in Wireshark:
使用 Wireshark 解密来自 Chrome 或 Firefox 的 TLS 流量的分步说明:
Close the browser completely (check your task manager just to be sure).
完全关闭浏览器(检查任务管理器以确保无误)。Set environment variable
SSLKEYLOGFILE
to the absolute path of a writable file.
将环境变量SSLKEYLOGFILE
设置为可写文件的绝对路径。Start the browser. 启动浏览器。
Verify that the location from step 2 is created.
验证步骤 2 中的位置是否已创建。In Wireshark, go to Edit -> Preferences -> Protocols -> TLS, and change the (Pre)-Master-Secret log filename preference to the path from step 2.
在 Wireshark 中,转到_编辑_ -> 首选项 -> 协议 -> TLS ,然后将 _(Pre)-Master-Secret 日志文件名_首选项更改为步骤 2 中的路径。Start the Wireshark capture.
开始 Wireshark 捕获。Open a website, for example https://www.wireshark.org/
打开一个网站,例如 https://www.wireshark.org/Check that the decrypted data is visible. For example, using the
tls and (http or http2)
filter.
检查解密数据是否可见。例如,使用tls and (http or http2)
过滤器。
不需要创建文件,在环境变量配置时写文件名 D:\ssllog\keylogfile.txt
,在验证时会自动创建,效果如下。
设置 Wireshark 首选项 -> Protocols -> TLS 的 (Pro)-Master-Secret log filename