--- /dev/null
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; content:"malicious"; nocase; sid:1000001; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; http.uri; content:"malicious"; nocase; sid:1000002; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; frame:http1.request; content:"malicious"; nocase; sid:1000003; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=oob
+
+checks:
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
--- /dev/null
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; content:"malicious"; nocase; sid:1000001; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; http.uri; content:"malicious"; nocase; sid:1000002; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; frame:http1.request; content:"malicious"; nocase; sid:1000003; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=drop
+
+checks:
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
+ - filter:
+ count: 1
+ match:
+ event_type: stats
+ stats.ips.accepted: 6
+ stats.ips.blocked: 10
+ stats.ips.drop_reason.flow_drop: 8
+ stats.ips.drop_reason.rules: 1
+ stats.ips.drop_reason.stream_urgent: 1
+ stats.tcp.urg: 1
+ stats.tcp.reassembly_gap: 1
+ stats.detect.alert: 1
--- /dev/null
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; content:"malicious"; nocase; sid:1000001; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; http.uri; content:"malicious"; nocase; sid:1000002; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; frame:http1.request; content:"malicious"; nocase; sid:1000003; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=oob
+
+checks:
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
--- /dev/null
+Test
+====
+
+Test to show last urg byte is treated as OOB.
+```
+$ python3 proof_of_concept_2bytes_unique_XY.py
+HTTP/1.1 200 OK
+Server: Werkzeug/3.0.1 Python/3.12.3
+Date: Sun, 08 Dec 2024 08:57:56 GMT
+Content-Type: text/html; charset=utf-8
+Content-Length: 37
+Connection: close
+
+You've accessed the path: /malicXious
+```
--- /dev/null
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicXious'"; content:"malicXious"; nocase; sid:1000001; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicXious'"; http.uri; content:"malicXious"; nocase; sid:1000002; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicXious'"; frame:http1.request; content:"malicXious"; nocase; sid:1000003; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=oob
+
+checks:
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
--- /dev/null
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; content:"malicious"; nocase; sid:1000001; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; http.uri; content:"malicious"; nocase; sid:1000002; rev:1;)
+drop tcp any any -> any 9090 (msg:"Block traffic containing the word 'malicious'"; frame:http1.request; content:"malicious"; nocase; sid:1000003; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=oob
+
+checks:
+ - filter:
+ count: 0 # TODO find out why
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
+ - filter:
+ count: 1
+ match:
+ event_type: stats
+ stats.tcp.urg: 64000
+ stats.tcp.reassembly_gap: 0
--- /dev/null
+alert tcp any any -> any 9090 (content:"malicious"; nocase; sid:1000001; rev:1;)
+alert tcp any any -> any 9090 (http.uri; content:"malicious"; nocase; sid:1000002; rev:1;)
+alert tcp any any -> any 9090 (frame:http1.request; content:"malicious"; nocase; sid:1000003; rev:1;)
+alert tcp any any -> any any (msg:"SURICATA STREAM urgent OOB limit reached"; stream-event:reassembly_urgent_oob_limit_reached; classtype:protocol-command-decode; sid:2210066; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=oob
+- --set stream.reassembly.urgent.oob-limit-policy=drop
+- --simulate-ips
+
+checks:
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 2210066
+ - filter:
+ count: 1
+ match:
+ event_type: http
+ http.url: "/malicious"
+ - filter:
+ count: 1
+ match:
+ event_type: stats
+ stats.ips.accepted: 131549
+ stats.ips.blocked: 465
+ stats.ips.drop_reason.stream_urgent: 465
+ stats.tcp.urg: 66000
+ stats.tcp.reassembly_gap: 1
--- /dev/null
+alert tcp any any -> any 9090 (content:"malicious"; nocase; sid:1000001; rev:1;)
+alert tcp any any -> any 9090 (http.uri; content:"malicious"; nocase; sid:1000002; rev:1;)
+alert tcp any any -> any 9090 (frame:http1.request; content:"malicious"; nocase; sid:1000003; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=oob
+- --set stream.reassembly.urgent.oob-limit-policy=gap
+- --simulate-ips
+
+checks:
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
+ - filter:
+ count: 1
+ match:
+ event_type: http
+ http.url: "/malicious"
+ - filter:
+ count: 1
+ match:
+ event_type: stats
+ stats.ips.accepted: 132014
+ stats.ips.blocked: 0
+ stats.ips.drop_reason.stream_reassembly: 0
+ stats.tcp.urg: 66000
+ stats.tcp.reassembly_gap: 1
--- /dev/null
+alert tcp any any -> any 9090 (content:"malicious"; nocase; sid:1000001; rev:1;)
+alert tcp any any -> any 9090 (http.uri; content:"malicious"; nocase; sid:1000002; rev:1;)
+alert tcp any any -> any 9090 (frame:http1.request; content:"malicious"; nocase; sid:1000003; rev:1;)
--- /dev/null
+requires:
+ min-version: 8
+
+args:
+- --set stream.reassembly.urgent.policy=oob
+- --set stream.reassembly.urgent.oob-limit-policy=inline
+- --simulate-ips
+
+checks:
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000001
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000002
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 1000003
+ - filter:
+ count: 1
+ match:
+ event_type: http
+ http.url: "/malicXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXious"
+ - filter:
+ count: 1
+ match:
+ event_type: stats
+ stats.ips.accepted: 132014
+ stats.ips.blocked: 0
+ stats.ips.drop_reason.stream_reassembly: 0
+ stats.tcp.urg: 66000
+ stats.tcp.reassembly_gap: 0