PcapPlusPlus icon indicating copy to clipboard operation
PcapPlusPlus copied to clipboard

TLS Decryption, packet replay

Open niclar opened this issue 3 years ago • 11 comments

Hi, I'm trying to figure out how to replay (& capture) a secure web socket feed in my application, for low-level network debugging. I'm in full control of the client/application and have the ssl session master key. I'm not in control of the server.

Does pcapplusplus support TLS decryption given the master key and the client random value ?

Wireshark seem to be able to replay a modified/re-encrypted pcap from what I understand.

(https://www.ibm.com/support/pages/decrypt-datapower-tlsssl-traffic-using-master-secret-logging) (https://unit42.paloaltonetworks.com/wireshark-tutorial-decrypting-https-traffic/) (https://wiki.wireshark.org/TLS)

-Also is it possible to inject the secret in the pcap file to streamline the replay process; (see "Embedding decryption secrets in a pcapng file" in https://wiki.wireshark.org/TLS#using-the-pre-master-secret )

niclar avatar Mar 18 '22 11:03 niclar

Unfortunately PcapPlusPlus does not support TLS decryption. This will require integration with OpenSSL which currently doesn't exist

seladb avatar Mar 19 '22 23:03 seladb

Check this out https://github.com/tls-attacker/TLS-Attacker
https://github.com/tls-attacker

mikeybro avatar Mar 20 '22 05:03 mikeybro

FYI I got decryption to work with openssl (SSL_get_client_random, SSL_SESSION_get_master_key) and wireshark

niclar avatar Mar 21 '22 10:03 niclar

Nice!! Just curious: are you using it inside of PcapPlusPlus (by changing the code) or as a separate tool?

seladb avatar Mar 21 '22 15:03 seladb

@seladb I'm running the capture & decryption from wireshark, key logging in the client code. -So separate at the moment. If the pcapplusplus capture files are interchangeable, I can run the capture phase via pcapplusplus of cause.

niclar avatar Mar 22 '22 13:03 niclar

ok got it, thanks!

Should we close this issue?

seladb avatar Mar 23 '22 06:03 seladb

Would be nice to have this feature(s) in pcapplusplus. -Maybe keep the ticket as a feature request, open for sponsoring ?

niclar avatar Mar 23 '22 13:03 niclar

Sure, we can keep it open for some time. If we see more demand for this feature we will consider implementing it

seladb avatar Mar 24 '22 05:03 seladb

demand +1

WHOLETTHEDOG-OUT avatar Aug 14 '23 10:08 WHOLETTHEDOG-OUT

@WHOLETTHEDOG-OUT would you consider adding this functionality to PcapPlusPlus?

seladb avatar Aug 14 '23 16:08 seladb