Check out these great references as well: |
|---|
| Our custom profiles repository for Wireshark |
| Our Udemy course on Wireshark |
| Our Udemy course on Wireless Packet capture |
Whenever your web browser connects to a web server using HTTPS, a secure connection is established, keys are exchanged, and the traffic is encrypted. We won’t spend any time in this article describing that HTTPS process, instead we will focus on how you can decrypt the encrypted traffic using Wireshark.
There are a couple of environment constraints in this explanation:
- We are on Windows with administrative privileges
- We are using the Chrome web browser
The step by step is illustrated in this video on our Patreon site: https://www.patreon.com/posts/decrypting-https-159406125
The steps I followed were (you must follow each of these steps):
- Windows Start> Environment Variables (just start typing) – a System Properties dialogue will appear.
- Click on the Environment Variables button (bottom right) – an Environment Variables dialogue appears.
- On the top half of that dialogue (User Variables) – click New
- An input box appears, in the Variable Name field enter: “SSLKEYLOGFILE”
- In the Variable Value field enter a path to where you want to store the keys: “C:\Users\user1\sslkeylog.txt” as an example
- Click on OK – you should see the new variable in the list.
- Click on OK to close the Environment Variables dialogue.
- Click on OK to close the System Properties dialogue.
- Now Reboot.
- Once rebooted, launch either Chrome or Firefox.
- Open Wireshark and start a capture.
- In Wireshark, go to Edit> Preferences> Protocols> TLS
- In the Pre-Master Secret log filename box, browse to and select the file you created in Step 5. Make sure the entire path is in there.
- Click OK and close the dialogue.
Back in Wireshark, you will see that Wireshark will now use the saved keys to decrypt anything your machine is capturing using that browser.
You can open the log file in a text editor. You can search the log file for the client random field, and cut and paste the key pairs into a stand alone file and send them to another machine to decrypt the traffic elsewhere.
I hope this video and article helps and explains.
You may want to check on my separate article on SSL/TLS decryption using Key files here.
If you would like to help support the continued development of independent networking, broadband, Wi-Fi, VoIP, and packet analysis content, please consider joining our Patreon community where you will gain access to exclusive technical resources, downloadable labs and PCAPs, bonus course content, troubleshooting guides, and additional member-only material. Comments and technical discussion are always welcomed at our Patreon community or on our Discord server. You can also support our work by simply buying us a coffee — every contribution helps us continue creating practical, real-world network science education for professionals and enthusiasts alike.
