Wireshark 將TLS (https) decrypt 並保存明文
使用 SSL/TLS 協議傳輸的封包在 handshake 之後以加密形式傳輸,即使wireshark 抓包也無法看到內容,
本文介紹使TLS 封包解為明文的方法
文章目錄
- 版本資訊
- Decrypt Steps
- Run wireshark to capture
- 添加環境變數
- Add SSLKEYLOGFILE to wireshark
- Decrypted TCP
- Save printable text file
- Save in wireshark
- 查看保存下來的內文
- Reference
版本資訊
| windows 作業系統名稱 | Microsoft Windows 7 專業版 |
| wireshark Version | 3.4.9 (v3.4.9-0-g365e236f5efe) |
| vlc | v3.0.8 |
| google chrome | 版本 95.0.4638.54 (正式版本) (64 位元) |
Decrypt Steps
Run wireshark to capture
原本的情況是會顯示 protocol 為 TLS v<TLS 的版本> (圖中是 TLS v1.2) Applicaiton Data
出現在 certificated, Server (client) Key exchange 之後
內文處於加密的狀態
添加環境變數
新增一個環境變數 SSLKEYLOGFILE,數值是一個全新的檔案
然後 重啟瀏覽器,或是其他目標 https clients (VLC Player etc)
開始串流之後這個檔案會被創建且出現類似如下內文
Add SSLKEYLOGFILE to wireshark
Edit -> Preference -> Protocol -> TLS
加入(pre)-master-secret log filename
Decrypted TCP
完成上一步之後重新開始抓包,在 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
勾選如圖
查看保存下來的內文
會顯示package number 等協議內容
Reference
https://www.youtube.com/watch?v=5qecyZHL-GU&ab_channel=ChrisGreer
總結
以上是生活随笔為你收集整理的Wireshark 將TLS (https) decrypt 並保存明文的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 免费节假日API
- 下一篇: 从智慧交通、智慧安防、智能电网的应用来看