CAPEv2 icon indicating copy to clipboard operation
CAPEv2 copied to clipboard

Replace httpreplay with something faster

Open josh-feather opened this issue 1 year ago • 5 comments

Replace httpreplay with something faster

Summary

Httpreplay is used inside of CAPE to decrypt TLS traffic so that it can be processed by Suricata. Due to its pure-python implementation, it is extremely slow.

Context

On my local instance, CAPE took ~960 seconds to process a ~250MB PCAP with httpreplay. When the same PCAP with httpreplay disabled, it only took 16 seconds.

Replacement considerations

  • A golang-based tool leveraging https://github.com/google/gopacket

josh-feather avatar Sep 10 '24 13:09 josh-feather

How about using a TLS inspection proxy instead of dumping TLS secrets that have to be post-processed with httpreplay? Some TLS proxies can generate PCAP files with decrypted TLS traffic on the fly.

erik4711 avatar Sep 18 '24 12:09 erik4711

yes in past i was using mitmproxy for that, but i don't remembe why i dropped it

doomedraven avatar Sep 18 '24 13:09 doomedraven

yes in past i was using mitmproxy for that, but i don't remembe why i dropped it

Maybe mitmproxy didn't provide much value over the current implementation? The TLS traffic and sslkeylogfile.txt from mitmproxy probably still had to be post-processed (decrypted) in order for Suricata to inspect it, right?

erik4711 avatar Sep 18 '24 13:09 erik4711

as far as i remember, i might be wrong rigth now, mitmdump was dumping decrypted already pcap https://docs.mitmproxy.org/stable/#mitmdump

doomedraven avatar Sep 18 '24 13:09 doomedraven

The one disadvantage with using an inline proxy is some malware could detect on the naming/properties used by the CA.

seanthegeek avatar Dec 20 '24 14:12 seanthegeek

130MB的pcap文件,会导致处理超时,processor提示timeout 900,这个时间也不知道在哪里修改

yundmb avatar Sep 20 '25 01:09 yundmb