I would like to extract files from TLS encrypted traffic, but I failed.
Are you attempting this with a pcap or from live traffic?
while the file_sniff event is not able to read the decrypted traffic.
Instead of implementing the file_sniff event you could try @load frameworks/files/extract-all-files and see if this gives you other results. Outside of file extraction, is a files.log with the expected entries created?
And just to add a bit to this - after TLS decryption, traffic is run through the Zeek analyzers like normal. This means that if there is HTTP traffic inside the TLS connection, you should indeed be able to extract files.
But - please note that today many TLS connections use HTTP/2. Zeek does not, by default, ship with an analyzer for HTTP/2 - and thus you won’t be able to extract any data from that without additional packages.