Sample captures, HTTP

HTTP response, chunked and gzip-compressed

A web page sent gzip-compressed in chunks, with a script that's only visible after decompression.

Packets
11
Duration
0.120 s
Size
1.3 KB
Protocols
TCP, HTTP
License
CC0

What it shows

The server sends an HTML page with Content-Encoding: gzip and Transfer-Encoding: chunked, so the bytes on the wire are compressed and split into chunks. The page contains <script>eval(atob("...")).

A rule on the decoded body (file.data in Suricata, file_data in Snort 3) finds the script. In Suricata, the same content with no buffer looks at the TCP stream as sent, which is compressed, and stays silent. Snort 3 differs: once it recognizes HTTP, content with no buffer matches the decoded body too, so both its rules fire.

Rules for this capture

Suricata 8 and 7

Try these rules
alert http any any -> any any (msg:"eval(atob( in a decoded response body"; flow:established,to_client; file.data; content:"eval(atob("; sid:1000001; rev:1;)
alert tcp any 80 -> any any (msg:"eval(atob( with no buffer"; flow:established,to_client; content:"eval(atob("; sid:1000002; rev:1;)

Rule 1000002 stays silent on purpose. Run the rules to see the tester's note on why.

alert http any any -> any any (msg:"eval(atob( in a decoded response body"; flow:established,to_client; file_data; content:"eval(atob("; sid:1000001; rev:1;)
alert tcp any 80 -> any any (msg:"eval(atob( with no buffer"; flow:established,to_client; content:"eval(atob("; sid:1000002; rev:1;)

Packets

No.TimeSourceDestinationProtocolInfo
10.000192.0.2.10:53120198.51.100.20:80TCPSYN
20.012198.51.100.20:80192.0.2.10:53120TCPSYN ACK
30.024192.0.2.10:53120198.51.100.20:80TCPACK
40.036192.0.2.10:53120198.51.100.20:80TCPPSH ACK, GET /reports/q3.html HTTP/1.1
50.048198.51.100.20:80192.0.2.10:53120TCPACK
60.060198.51.100.20:80192.0.2.10:53120TCPPSH ACK, HTTP/1.1 200 OK
70.072198.51.100.20:80192.0.2.10:53120TCPPSH ACK, 125 bytes
80.084192.0.2.10:53120198.51.100.20:80TCPACK
90.096192.0.2.10:53120198.51.100.20:80TCPFIN ACK
100.108198.51.100.20:80192.0.2.10:53120TCPFIN ACK
110.120192.0.2.10:53120198.51.100.20:80TCPACK

More HTTP samples