Wireshark will decrypt the TLS (HTTPS) traffic and save the plain text: 將TLS (https) decrypt 並保存明文

本文详细介绍了如何使用Wireshark捕获并解密通过SSL/TLS协议传输的HTTPS流量,使其变为明文。通过设置SSLKEYLOGFILE环境变量,结合Wireshark的TLS预主密钥日志文件配置,可以解密TCP数据包,并将内容保存为纯文本文件进行查看。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Packets transmitted using the SSL/TLS protocol are encrypted after the handshake, making their content inaccessible even when captured with Wireshark. This article introduces a method to decrypt TLS packets into plaintext.

使用 SSL/TLS 協議傳輸的封包在 handshake 之後以加密形式傳輸,即使wireshark 抓包也無法看到內容,
本文介紹使TLS 封包解為明文的方法

Version info
windows OSMicrosoft Windows 7
wireshark Version3.4.9 (v3.4.9-0-g365e236f5efe)
vlcv3.0.8
google chrome版本 95.0.4638.54 (正式版本) (64 位元)

Decrypt Steps

Run wireshark to capture

Under normal circumstances, the protocol will be displayed as TLS v (in the image, it shows TLS v1.2) Application Data. This appears after the Certificate, Server (Client) Key Exchange. The content is in an encrypted state.

原本的情況是會顯示 protocol 為 TLS v<TLS 的版本> (圖中是 TLS v1.2) Applicaiton Data
出現在 certificated, Server (client) Key exchange 之後
內文處於加密的狀態
在这里插入图片描述

Add env variables

Add an environment variable SSLKEYLOGFILE with the value set to a new file. Then, restart the browser or other target HTTPS clients (e.g., VLC Player, etc.).

新增一個環境變數 SSLKEYLOGFILE,數值是一個全新的檔案
然後 重啟瀏覽器,或是其他目標 https clients (VLC Player etc)

在这里插入图片描述
After starting the stream, this file will be created, and it will contain content similar to the following.
開始串流之後這個檔案會被創建且出現類似如下內文

在这里插入图片描述

Add SSLKEYLOGFILE to wireshark

Edit -> Preference -> Protocol -> TLS
Add (pre)-master-secret log filename

在这里插入图片描述

Decrypted TCP

After completing the previous step, start capturing packets again. In the packets following the Change Cipher Spec Finished (completion of the TLS handshake), you will see info [TLS segment of a reassembled PDU], which indicates the encrypted TCP content. By clicking on it, you will see ‘Decrypted TLS,’ containing the decrypted plaintext.
完成上一步之後重新開始抓包,在 Change Cipher spec Finished (TLS 握手完成)以後的包, info [TLS segment of a reassembled PDU] 這就是被加密的 tcp 內容,點開以後會出現 Decrypted TLS 裡面是解密的明文
在这里插入图片描述

Save printable text file

Save in wireshark

File -> export packet deceptions -> As Plain text
select as:
在这里插入图片描述

View the saved decrypted content 查看保存下來的內文

It will display the package number and other protocol details
會顯示package number 等協議內容

在这里插入图片描述

在这里插入图片描述

Reference

https://www.youtube.com/watch?v=5qecyZHL-GU&ab_channel=ChrisGreer

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值