Http sniffer ios12/31/2023 Int ssl_log_secret ( const SSL * ssl, const char * label, const uint8_t * secret, size_t secret_len ) ) ĬALLBACK_OFFSET was determined by disassembling libboringssl.dylib, and like all magic numbers is fragile as it may change if the struct changes in future versions, or on different CPU architectures. Searching the code for the labels that are defined in key log format finds examples like this one in where the CLIENT_RANDOM values are being logged: ![]() In iOS11, Apple migrated from OpenSSL to Google’s BoringSSL so Tom and Marat’s code stopped working but the ideas it introduced remained valid and compared to OpenSSL the BoringSSL code easier to understand.Īnd as Chrome supports TLS key logging so BoringSSL already contains code to log TLS keys. Tom and Marat used Frida to hook the CoreTLS function ( tls_handshake_internal_prf) that generated key material and dump the relevant TLS keys.Īlthough I got a modified version of their code working well enough to inspect some apps, and talk about it at JSOxford I never quite managed to address extracting keys for resumed TLS sessions and some other cases where it didn’t work. I first came across Frida a few years when someone shared Tom Curran and Marat Nigmatullin's paper on TLS Session Key Extraction from Memory on iOS Devices. I’ve filtered the capture to just display HTTP and HTTPS traffic and highlighted the start of one of the decrypted HTTP/2 connections. You can also launch Wireshark, open the packet capture, and then specify the keylog in Preferences > Protocols > TLS > (Pre)-Master-Secret log filename Wireshark -r bbc-news.pcap -o tls:keylog_file:bbc-news.keylog Check Frida is installed and working by listing the currently running apps.Follow the Frida installation instructions for MacOS and iOS.It's possible to use a non-jailbroken device if you can include Frida’s libraries in the app - either via debugging an app you own, or repackaging someone else’s app and injecting the dylib.Īs I want to decrypt Safari’s traffic I’m sticking with the Jailbroken phone. I’m testing with a Jailbroken iPhone 5S running iOS12.4.3, with Frida installed from Cydia. Extracting TLS Keys and Decrypting iOS Trafficįrida describes itself as a “dynamic instrumentation toolkit”, it injects a JavaScript VM into applications and we can write JS code that runs in that VM and can inspect memory and processes, intercept functions, create our own native functions etc. To decrypt the packets we need the matching TLS keys, Chrome and Firefox will provide these when the SSLKEYLOGFILE environment variable is set but unfortunately there seems to be no equivalent for Safari.įortunately thanks to tools like Frida, we have the ability to implement it ourselves. I’ve filtered the capture to just display the traffic to and from But as the traffic is encrypted using TLS 1.2 we can’t see the contents of the packets. ![]() You should see a screen something like this:
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |