Skip to content

Commit

Permalink
http1: adds test with invalid status
Browse files Browse the repository at this point in the history
Ticket: 7311
  • Loading branch information
catenacyber committed Dec 2, 2024
1 parent 34ae98c commit 6b415db
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/http1-noint-status/README.md
Original file line number Diff line number Diff line change
@@ -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
Binary file added tests/http1-noint-status/input.pcap
Binary file not shown.
18 changes: 18 additions & 0 deletions tests/http1-noint-status/server.py
Original file line number Diff line number Diff line change
@@ -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()
13 changes: 13 additions & 0 deletions tests/http1-noint-status/test.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6b415db

Please sign in to comment.