No description
Find a file
xb-anssi c8103dd963
Test how the signature framework matches HTTP body
This adds a signatures/http-body-match btest to verify how the signature
framework matches HTTP body in requests and responses.

It currently fails because the 'http-request-body' and 'http-reply-body'
clauses never match anything when there is a '$' in their regular
expressions.

The other pattern clauses such as the 'payload' clause do not suffer
from that restriction and it is not documented as a limitation of HTTP
body pattern clauses either, so it is probably a bug.

The "http-body-match" btest shows that without a fix any signatures
which ends with a '$' in a http-request-body or http-reply-body rule
will never raise a signature_match() event, and that signatures which do
not end with a '$' cannot distinguish an HTTP body prefixed by the
matching pattern (ex: ABCD) from an HTTP body consisting entirely of the
matching pattern (ex: AB).

Test cases by source port:
- 13579:
  - GET without body, plain res body (CD, only)
- 13578:
  - GET without body, plain res body (CDEF, prefix)
- 24680:
  - POST plain req body (AB, only), plain res body (CD, only)
- 24681:
  - POST plain req body (ABCD, prefix), plain res body (CDEF, prefix)
- 24682:
  - POST gzipped req body (AB, only), gzipped res body (CD, only)
  - POST plain req body (CD, only), plain res body (EF, only)
- 33210:
  - POST multipart plain req body (AB;CD;EF, prefix)
  - plain res body (CD, only)
- 33211:
  - POST multipart plain req body (ABCD;EF, prefix)
  - plain res body (CDEF, prefix)
- 34527:
  - POST chunked gzipped req body (AB, only)
  - chunked gzipped res body (CD, only)
- 34528:
  - POST chunked gzipped req body (ABCD, prefix)
  - chunked gzipped res body (CDEF, prefix)

The tests with source ports 24680, 24682 and 34527 should
match the signature http_request_body_AB_only and the signature
http_request_body_AB_prefix, but they only match the latter.

The tests with source ports 13579, 24680, 24682, 33210 and 34527 should
match the signature http_response_body_CD_only and the signature
http_response_body_CD_prefix, but they only match the latter.

The tests with source ports 24680, 24681, 33210 and 33211 show how the
http_request_body_AB_then_CD signature with two http-request-body
conditions match either on one or multiple requests (documented
behaviour).

The test cases with other source ports show where the
http_request_body_AB_only and http_response_body_CD_only signatures
should not match because their bodies include more than the searched
patterns.
2023-11-03 15:28:15 +01:00
.github/workflows generate-docs: Bump ccache from 500M to 2000M 2023-09-27 18:20:36 +02:00
auxil Reformat Zeek in Spicy style 2023-10-30 09:40:55 +01:00
ci Install libmaxminddb in macOS CI 2023-10-26 14:47:59 +02:00
cmake@f7b4fbe489 Reformat Zeek in Spicy style 2023-10-30 09:40:55 +01:00
cmake_templates zeek-config.h: Drop NEED_KRB5_H 2023-08-28 11:31:05 +02:00
doc@9671dc111f Update doc submodule [nomail] [skip ci] 2023-11-01 00:24:38 +00:00
docker CI: Add more logging during docker builds 2023-10-12 15:00:52 -07:00
man Use the same rules as cmake submodule to reformat Zeek 2023-05-09 08:31:43 -07:00
scripts SSL: Add new extension types and ECH test 2023-10-30 14:19:16 +00:00
src build_inner_connection: Use the outer packet's timestamp 2023-11-01 12:03:55 +01:00
testing Test how the signature framework matches HTTP body 2023-11-03 15:28:15 +01:00
.cirrus.yml CI: Pass -A flag to btest for cluster-testing builds 2023-10-24 15:42:21 -07:00
.clang-format Format JSON with clang-format 2023-10-30 09:41:13 +01:00
.clang-tidy Disable annoying bugprone-easily-swappable-parameters clang-tidy check [skip ci] 2022-10-07 16:15:47 -07:00
.cmake-format.json Format JSON with clang-format 2023-10-30 09:41:13 +01:00
.dockerignore Add .dockerignore to suppress btest artifacts 2021-09-24 17:04:26 -07:00
.git-blame-ignore-revs Update .git-blame-ignore-revs 2023-10-30 09:42:39 +01:00
.gitattributes GH-1497: Support CRLF line-endings in Zeek scripts and signature files 2021-04-08 20:32:30 -07:00
.gitignore Cirrus configuration for Windows builds 2022-11-09 18:16:13 +02:00
.gitmodules Move Spicy submodule a layer up. 2023-05-16 12:09:12 +02:00
.pre-commit-config.yaml Format JSON with clang-format 2023-10-30 09:41:13 +01:00
.style.yapf Format Python scripts with yapf. 2021-11-24 23:13:24 +01:00
.typos.toml Fix typos in spicy-ldap 2023-10-10 09:21:57 +02:00
.update-changes.cfg Add script to update external test repo commit pointers 2019-04-05 17:09:01 -07:00
CHANGES Merge remote-tracking branch 'origin/topic/awelzel/3379-shared-ptr-and-micro-optimizations' 2023-11-01 12:04:47 +01:00
CMakeLists.txt Enable ccache-backed Spicy JIT for users of developer scripts. 2023-10-02 13:57:56 +02:00
configure configure/CMakelists: Use Python_EXECUTABLE as hint for interpreter 2023-09-07 12:48:37 +02:00
COPYING Update COPYING to 2023 2023-01-03 12:10:03 -07:00
COPYING-3rdparty Rename COPYING.3rdparty to COPYING-3rdparty 2023-01-03 12:10:03 -07:00
INSTALL Update documentation to include "Book of Zeek" revisions 2021-02-01 15:54:36 -08:00
Makefile Fix usage of realpath on macOS, instead preferring grealpath 2023-06-13 15:51:47 -07:00
NEWS packet_analysis: Avoid shared_ptr copying for analyzer lookups 2023-11-01 12:03:02 +01:00
README Add tooling section to README 2023-01-27 13:03:52 -07:00
README.md Update link to slack in README.md 2023-06-01 14:21:44 +02:00
VERSION Merge remote-tracking branch 'origin/topic/awelzel/3379-shared-ptr-and-micro-optimizations' 2023-11-01 12:04:47 +01:00
zeek-path-dev.in Move CMake template files to separate directory 2023-06-26 13:39:59 -07:00

Zeek Logo

The Zeek Network Security Monitor

A powerful framework for network traffic analysis and security monitoring.

Key FeaturesDocumentationGetting StartedDevelopmentLicense

Follow us on Twitter at @zeekurity.

Coverage Status Build Status

Slack Discourse

Key Features

  • In-depth Analysis Zeek ships with analyzers for many protocols, enabling high-level semantic analysis at the application layer.

  • Adaptable and Flexible Zeek's domain-specific scripting language enables site-specific monitoring policies and means that it is not restricted to any particular detection approach.

  • Efficient Zeek targets high-performance networks and is used operationally at a variety of large sites.

  • Highly Stateful Zeek keeps extensive application-layer state about the network it monitors and provides a high-level archive of a network's activity.

Getting Started

The best place to find information about getting started with Zeek is our web site www.zeek.org, specifically the documentation section there. On the web site you can also find downloads for stable releases, tutorials on getting Zeek set up, and many other useful resources.

You can find release notes in NEWS, and a complete record of all changes in CHANGES.

To work with the most recent code from the development branch of Zeek, clone the master git repository:

git clone --recursive https://github.com/zeek/zeek

With all dependencies in place, build and install:

./configure && make && sudo make install

Write your first Zeek script:

# File "hello.zeek"

event zeek_init()
    {
    print "Hello World!";
    }

And run it:

zeek hello.zeek

For learning more about the Zeek scripting language, try.zeek.org is a great resource.

Development

Zeek is developed on GitHub by its community. We welcome contributions. Working on an open source project like Zeek can be an incredibly rewarding experience and, packet by packet, makes the Internet a little safer. Today, as a result of countless contributions, Zeek is used operationally around the world by major companies and educational and scientific institutions alike for securing their cyber infrastructure.

If you're interested in getting involved, we collect feature requests and issues on GitHub here and you might find these to be a good place to get started. More information on Zeek's development can be found here, and information about its community and mailing lists (which are fairly active) can be found here.

License

Zeek comes with a BSD license, allowing for free use with virtually no restrictions. You can find it here.

Tooling

We use the following tooling to help discover issues to fix, amongst a number of others.