Extraindo chaves de sessão TLS do lighttpd

1

É possível extrair as chaves de sessão TLS do Lighttpd para que possamos descriptografar o tráfego capturado pelo tcpdump?

Alternativamente, poderíamos desativar o PFS, mas preferimos não fazer isso.

    
por Georg Schölly 27.09.2017 / 11:10

2 respostas

0

O Lighttpd não suporta isso imediatamente.

Stefan , um desenvolvedor do lighttpd, sugeriu verificar a seguinte resposta:

Extraia as chaves pré-master de um aplicativo openssl

    
por 05.10.2017 / 17:02
0

você pode encontrar uma chave privada no arquivo referenciado pela entrada ssl.pemfile no arquivo /etc/lighttpd/lighttpd.conf

A chave está no começo antes do certificado.

a pergunta de decodificação já foi respondida aqui:

how-to-decrypt-ssl-traffic-com-um-pacote-sniffer-quando-eu-tenho-a-chave-privada

Ssldump is supposed to be able to do that, but it appears to be unmaintained (in the source archive of the latest version, the date of last modification of all files are in 2002 or before) so it is quite possible that it won't support newer SSL/TLS; actually, it is highly implausible that a software from 2002 could process the new encryption formats defined in TLS 1.2 (AES/GCM). TLS 1.1 was published in 2006, and TLS 1.2 in 2008.

OpenSSL is a library that implements the protocol, but is not meant for analysing a recorded session.

You may have better chance with Wireshark, which has ample documentation on how to use it to decrypt recorded sessions.

There is an important parameter to mind: decryption of a passively recorded session (with a copy of the server private key) works only if the key exchange was of type RSA or static DH; with "DHE" and "ECDHE" cipher suites, you won't be able to decrypt such a session, even with knowledge of the server private key. In that case, you will need either the negotiated "master secret", or to use the server private key to actively intercept the connection (in a Man-in-the-Middle setup).

    
por 27.09.2017 / 13:25