From 2319b9b8e4d41902a9570d34b096962ed6b0858d Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 8 Oct 2024 16:10:04 +0200 Subject: [PATCH] http1: adds test with invalid status Ticket: 7311 --- tests/http1-noint-status/README.md | 11 +++++++++++ tests/http1-noint-status/input.pcap | Bin 0 -> 1044 bytes tests/http1-noint-status/server.py | 18 ++++++++++++++++++ tests/http1-noint-status/test.yaml | 13 +++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 tests/http1-noint-status/README.md create mode 100644 tests/http1-noint-status/input.pcap create mode 100644 tests/http1-noint-status/server.py create mode 100644 tests/http1-noint-status/test.yaml diff --git a/tests/http1-noint-status/README.md b/tests/http1-noint-status/README.md new file mode 100644 index 000000000..42f8da150 --- /dev/null +++ b/tests/http1-noint-status/README.md @@ -0,0 +1,11 @@ +# Description + +Test HTTP1 log of invalid status + +https://redmine.openinfosecfoundation.org/issues/7311 + +# PCAP + +The pcap is crafted with +`curl http://127.0.0.1:8001/test` as client +and custom server.py as server diff --git a/tests/http1-noint-status/input.pcap b/tests/http1-noint-status/input.pcap new file mode 100644 index 0000000000000000000000000000000000000000..fdd5f5f36f2ceeffab82546fcd73e7532d4e2c5c GIT binary patch literal 1044 zc-p&ic+)~A1{MYcfUw1ESkqtrWM^;zvO$;$h+P>N96-o{je((_fq@Z(f8UjNe3Nb) z1=6#D>Hq(KCP1|;_BR-rnb{Z_Ik?)c9KQlKl?h^|@h`$=$~*qP>*Q_H05msxgAk^f z+vDF0fy{-O=>Rm-0%(>6!b}q!?u-VS+t?r=@%ob6FZS;*$V z+ypWw6KGBsP=6P~oHo4fkpP-gh3X!6*ANB$lGNf71&@%B0DVI}LtZYA{NfTT1w$iq zJp&*#w6ZWT0E&hdrxxitrl;ls<&sN_a`eshOfB>bc)1*tlT!AHKro!+k(=vVi)t5ay)eHAezyP86y+P=6UH7)3-V_0T@jloLwpkFn56%*wX4ZntLJkS!G;@tKbGG0z Zhxs>&<_KapN9H%t;j;y3);er43;+Zb1jGOU literal 0 Hc-jL100001 diff --git a/tests/http1-noint-status/server.py b/tests/http1-noint-status/server.py new file mode 100644 index 000000000..32e12cdc5 --- /dev/null +++ b/tests/http1-noint-status/server.py @@ -0,0 +1,18 @@ +#! /usr/bin/env python + +# @author: Philippe Antoine + +import sys +import binascii +from threading import Thread +import time +import socket + +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.bind(("127.0.0.1", 8001)) +s.listen(1) +conn, addr = s.accept() +data = conn.recv(1024) +conn.send(b"HTTP/1.0 2XX OK\nServer: POC\nContent-Length:4\n\ntoto") +conn.close() +s.close() diff --git a/tests/http1-noint-status/test.yaml b/tests/http1-noint-status/test.yaml new file mode 100644 index 000000000..b60dea507 --- /dev/null +++ b/tests/http1-noint-status/test.yaml @@ -0,0 +1,13 @@ +requires: + min-version: 8 + +# disables checksum verification +args: + - -k none + +checks: + - filter: + count: 1 + match: + event_type: http + http.status_string: 2XX -- 2.47.2