I use scapy to sniff some packets and I get some HTTP response packets that are bytes I cannot parse.For example:
b'HTTP/1.1 200 OK\r\nDate: Thu, 07 Dec 2017 02:44:18 GMT\r\nServer:Apache/2.4.18 (Ubuntu)\r\nLast-Modified: Tue, 14 Nov 2017 05:51:36 GMT\r\nETag: "2c39-55deafadf0ac0-gzip"\r\nAccept-Ranges: bytes\r\nVary: Accept-Encoding\r\nContent-Encoding: gzip\r\nContent-Length: 3186\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n\x1f\x8b'
Is there a way to get the content part of this byte array so I can use gzip library to decode? I don't want to use request
to get the HTTP response because I merely want to process the raw packet I had.