-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot dump quic keys on Android #38
Comments
Hi @Diniboy1123 , Thank you for reaching out and for the detailed problem description. Regarding the issue, I wanted to clarify: is the OpenSSL library statically linked inside the To expedite the troubleshooting process, you might want to run BoringSecretHunter against Thanks again for your detailed insights and for your patience while we investigate this further. All the best, Daniel |
Hey, Thanks for the quick and really helpful response! I couldn't respond earlier, because my PSU died. Good catch on But I have tried running the mentioned tool before writing the issue, just forgot to paste the result in. Now re-ran it on my server (no new lines, because of my terminal emulator on phone):
Even though it definitely contains some openssl symbols:
I am not actually sure whether its openssl or rustls used for the connection though. But if we could hook openssl manually, that would already be huge. Once my new PSU arrives, I will try to figure out the addresses using Ghidra and try to feed it to friTap manually. |
Hi @Diniboy1123, Thank you for the detailed feedback and insights! I had some time to explore the app and the Findings
Example invocation: frida -U -p $(frida-ps -Uai | grep -i "1.1.1" | awk '{print $1}') -l warp_hook.js Output:
// Hook the libnativetunnel.so library
function hookQuicheFunctions() {
var moduleName = "libnativetunnel.so";
var module = Process.getModuleByName(moduleName);
if (!module) {
console.log(moduleName + " not found in memory.");
return;
}
console.log(moduleName + " loaded at base address: " + module.base);
// Enumerate symbols in the module
var symbols = module.enumerateSymbols();
//var symbols = module.enumerateExports();
symbols.forEach(function (symbol) {
try {
if (symbol.name.includes("bssl") || symbol.name.includes("quiche")) {
// Check if symbol.address is not zero
console.log("Hooking: " + symbol.name + " at " + symbol.address);
// Hook the function
Interceptor.attach(symbol.address, {
onEnter: function (args) {
console.log("[quiche function] Called: " + symbol.name);
},
onLeave: function (retval) {
console.log("[quiche function] Returned: " + retval);
}
});
}
} catch (e) {
console.log('[!] Error in onLeave: ' + e.message);
}
});
} Unfortunately, I don’t have time to investigate this any further at the moment. If you manage to get more insights or progress on hooking quiche functions, feel free to share your findings. I hope the updates to BoringSecretHunter and the Frida script provide a good starting point for further exploration. Let me know if you make any progress or have additional questions. I’d be happy to help where I can :-) All the best, Daniel |
Hi,
First of all this is probably one of the most precisely written frida tools out there, I found a gem just now with it. Thanks a lot for developing such a useful tool.
However I can't seem to get it working with Cloudflare warp. It's a free app, you download it, launch it and in the Settings -> Advanced -> Connection options -> Tunnel protocol I picked MASQUE.
In MASQUE mode they are essentially using
connect-ip
from this RFC which runs through quic so there is definitely TLS 1.3 involved. I can confirm that by using wireshark and inspecting the encrypted packets.If I run the tool using
friTap -m -k keys.log -v -s com.cloudflare.onedotonedotonedotone -do -p test.pcap --full_capture
I can see a bunch of keys captured:So I seemingly end up with some keys, but I assume these are for some other connection, like maybe DNS over HTTPS that happens already in the tunnel or during some API calls, as I cannot seem to decrypt packets using any of these keys in wireshark...
I wrote a go implementation of a similar quic based project where I defined a
KeyLogWriter
and that dumped these keys:And that's enough for wireshark to properly decrypt all data. Therefore I am guessing that the quic crypto either isn't done by the statically linked OpenSSL inside the
libnativetunnel.so
, but maybe it's rust's own thing OR we are actually missing something in friTap to handle quic and openssl properly.The binary also has some string:
Which is really unfortunate. :(
Any help would be very much appreciated!
The text was updated successfully, but these errors were encountered: