From a22f69f8f48ef623fd5312244df24515828b4cbb 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 zcmca|c+)~A1{MYcfUw1ESkqtrWM^;zN`NpE5W6xkIDn7?8v{c<0|O%n|Gq2l_$J*p z3MkF6f$9JMe|-@-}Gznj5`A z2-D2%@$ZE|=EBT$0Geq5v;%~p?gY95t2?8C<~BA6NWA{10dzdneIWBdZgVHX9H`qG zL2g4f2j(V_IhjCnx`1v0VW@lB@VZ9==$8|oSIa(Uzz zmslwn8ky@E0HL9kg@FN3G_*LiNY^nvH4iA4Tw0W)Z?0!*p=ZF$<(QnDS^yN((%0hU z;^hLltd2Avt_Aw=6)dEXeYg*3P8QI2APn_k8oCdWLTYV;1kfB{8Uckk%p9n{3>1ta zA{6|+xq?%R%2JE06axI6xt#O!N`M~H^-0Z3FUhbn;o>UEFUbe_;0*CT*bI!LwGD#U zeQ=ftbD(K^Eilb&Mh*#3+JmK;YowX81(!L@zll!6AopxR_7}2yWQZ^a8Z%pf;j<3e IJ+PPo00b2T!~g&Q literal 0 HcmV?d00001 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..b3691ed06 --- /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_str: 2XX