From f33e953453587f4d5a9369bbf2d10903aa9bd8fd Mon Sep 17 00:00:00 2001 From: develop Date: Sun, 23 Oct 2022 20:44:43 +0200 Subject: [PATCH 1/2] Fix - IndexError: list index out of range --- httpreplay/smegma.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpreplay/smegma.py b/httpreplay/smegma.py index 600cae3..3036a83 100644 --- a/httpreplay/smegma.py +++ b/httpreplay/smegma.py @@ -598,9 +598,9 @@ def state_stream(self, s, ts): ts, ) - if not isinstance(sent[0], bytes): + if sent and not isinstance(sent[0], bytes): sent = [ord(c) if len(c) != 0 else b"" for c in sent] - if not isinstance(recv[0], bytes): + if recv and not isinstance(recv[0], bytes): recv = [ord(c) if len(c) != 0 else b"" for c in recv] ja3, ja3s, ja3_p, ja3s_p = None, None, None, None try: From 48f2328e1d32643b9d3f64e2c0d70d209c16b1fa Mon Sep 17 00:00:00 2001 From: develop Date: Fri, 16 Dec 2022 15:38:31 +0100 Subject: [PATCH 2/2] Fix - AttributeError: 'TLSAppData' object has no attribute 'data' --- httpreplay/smegma.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpreplay/smegma.py b/httpreplay/smegma.py index 3036a83..cf06963 100644 --- a/httpreplay/smegma.py +++ b/httpreplay/smegma.py @@ -487,7 +487,7 @@ def state_init(self, s, ts): self.client_hello = self.parse_record(self.sent.pop(0)) self.server_hello = self.parse_record(self.recv.pop(0)) - if not isinstance(self.client_hello.data, dpkt.ssl.TLSClientHello): + if not hasattr(self.client_hello, "data") or not isinstance(self.client_hello.data, dpkt.ssl.TLSClientHello): log.info( "Stream %s:%d -> %s:%d doesn't appear to be a proper TLS " "stream (perhaps the client is outdated), skipping it.", *s @@ -495,7 +495,7 @@ def state_init(self, s, ts): self.state = "done" return - if not isinstance(self.server_hello.data, dpkt.ssl.TLSServerHello): + if not hasattr(self.server_hello, "data") or not isinstance(self.server_hello.data, dpkt.ssl.TLSServerHello): log.info( "Stream %s:%d -> %s:%d doesn't appear to be a proper TLS " "stream (perhaps the server is outdated), skipping it.", *s