-
Notifications
You must be signed in to change notification settings - Fork 7
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
Unable to decrypt QUIC traffic #2
Comments
Can you share pcap and log file with keys? |
Also please note that I've never checked if my module's variables can be used to write log files in format that Wireshark expects (https://wiki.wireshark.org/TLS#using-the-pre-master-secret), so may be you'll have to convert log records first. |
sure curl_with_quic_ssl_key.log |
if i need to decrypt my pcap,now i have to convert ssl key log which is got from your module to wireshark format right |
any idea how to convert your module created nginx ssl key log file to wireshark expected form |
would it be possible to add something like this to your module |
Looks like current variables can be used to decrypt only non-rsa traffic using log format |
Thank you for replying back @tiandrey It will be a great help if you are able to add this feature(decrypt rsa traffic feature) to your module. |
Sorry, but it seems that since version 1.1.0 of OpenSSL direct access to those variables is impossible, and there are no functions like |
No, because The Bouncy Castle Cryptography library is an implementation of cryptographic algorithms and protocols, and they can access anything they want in internal code because it's their implementation, while I'm limited to use of API provided by libssl. |
i tried https://security.stackexchange.com/questions/216065/extracting-openssl-pre-master-secret-from-nginx this but it didnt worked |
yeah,okay |
As mentioned in the above comment #2 (comment), attempts to generate SSLKEYLOGFILE with the libsslkeylog.so ld_preload method for nginx as described at https://security.stackexchange.com/questions/216065/extracting-openssl-pre-master-secret-from-nginx with https://git.lekensteyn.nl/peter/wireshark-notes appear to fail (create empty SSLKEYLOGFILE), but https://github.com/drivenet/sslkeylog appears to still work. Nginx closed the feature request to implement SSLKEYLOGFILE https://trac.nginx.org/nginx/ticket/2498 with the comment
On the other hand, SSLKEYLOGFILE feature is present in apache apache/httpd#74.
Could you comment on the differences in the implementation? |
I tried to build this but building itself failed https://github.com/drivenet/sslkeylog
This ticket was also raised by me and nginx said they wont support to capture SSL keys I didnt got you,what do you mean by differences? |
In order to complile libssl is needed The question about implementation differrences is for @tiandrey: apache mod_ssl uses |
okay,Thank you below is nginx conf
Below nginx.service file
Below is curl command i am trying
any idea what am i missing |
@marcindulak, thanks for the link, I'll look into details of apache's implementation. |
Well, it seems that my module alone can't do the trick - I guess I'll have to patch ngx_ssl_module to add keylogging callback before actual handshaking happens, otherwise there will be no key data to log :( |
My nginx systemd uses the override.conf as shown in https://security.stackexchange.com/questions/216065/extracting-openssl-pre-master-secret-from-nginx, but other than this it's similar to your. To make sure: your nginx is started after a I'm still thinking about the closed issue https://trac.nginx.org/nginx/ticket/2498. Apache implements SSLKEYLOGFILE, and newer servers like envoyproxy/envoy#10377 also do it, so maybe it's possible to at least ask nginx for clarification for the reasons why SSLKEYLOGFILE is not implemented. |
That would be a great idea to ask them why they didnt provide when apache(compitetor) provided |
I'm working on it, now I'm getting keylog callbacks and can parse those lines and store them in connection context (unfortunately, main portion of code is inside nginx, not inside module). |
Well, it looks like it works. I'll add some finishing touches and push soon. |
Okay, Thank you so much @tiandrey |
@Karthikdasari0423 , please check out the latest commit. |
@tiandrey does this support 1.25.x versions ? |
The patch must apply fine, maybe with different offset. Just try it. |
@tiandrey will try 1.24.0.patch on 1.25.3 version |
@tiandrey able to build with nginx 1.25.3 and able to generate keylog file also below are the keys file and pcap file am i missing anything here |
Please describe your setup, ways to reproduce, etc. |
I was able to decode my test capture with http2 requests encoded with tls1.2 and tls1.3 just fine. |
@tiandrey i was trying to decode http3 traffic and this traffic uses only tls1.3 steps
nginx conf file is below
use below curl command
|
Please also show output of And what version of curl are you using? Mine does not support QUIC, and I don't see any quick ways to install a cli QUIC client. |
I've built curl version 8.4.0 according to this instruction: https://curl.se/docs/http3.html
I use the following server config: ... and sorry, looks like it works for me, I'm unable to reproduce the problem - I see decrypted HTTP3 frames in Wireshark. |
Try the following:
Apply patch, recompile nginx, add |
seems to me some issue
|
and below is my nginx -V
and i believe if traffic is going via localhost then we dont need any keys to decrypt traffic my setup is like below
|
Just apply this patch (to clean sources, not to already patched): nginx-with-debug-1.25.3.txt
Wrong, if you are decrypting traffic dump - it does not matter whether it is from localhost or not, because encryption keys are never transmitted over network. |
applied nginx patch on a new clean sources and still not able to decrpypt Hope i am loading keys correctly, |
Hi @tiandrey
Thank you writing such a wonderful project.
root@ubuntu:/var/log/nginx# ls -l
total 28
-rw-r----- 1 www-data adm 412 Jan 6 20:03 access.log
-rw-r----- 1 www-data adm 1230 Dec 31 20:05 access.log.1
-rw-r----- 1 www-data adm 198 Dec 30 13:02 access.log.2.gz
-rw-r----- 1 www-data adm 429 Dec 25 15:15 access.log.3.gz
-rw-r----- 1 www-data adm 0 Dec 31 00:00 error.log
-rw-r----- 1 www-data adm 752 Dec 30 13:02 error.log.1
-rw-r----- 1 www-data adm 343 Dec 25 10:07 error.log.2.gz
-rw-r--r-- 1 root root 483 Jan 6 20:03 sslkeys.log
I am able to see the ssl key log file but only a small issue is even after loding the ssl key log file into wirshark,
i am seeing this issue
am i missing something here or Could you please help me
Thank you,
The text was updated successfully, but these errors were encountered: