From bb014ac09ff3bd8d0d48bd6e1225bfedf4bedbc9 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Fri, 9 Jun 2023 10:43:33 -0400 Subject: [PATCH] detect/byte-jump: Document var usage for nbytes Issue: 6105 --- doc/userguide/rules/differences-from-snort.rst | 12 +++++++++++- doc/userguide/rules/payload-keywords.rst | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/userguide/rules/differences-from-snort.rst b/doc/userguide/rules/differences-from-snort.rst index db5691256856..1fd2d118e747 100644 --- a/doc/userguide/rules/differences-from-snort.rst +++ b/doc/userguide/rules/differences-from-snort.rst @@ -263,6 +263,16 @@ See :doc:`http-keywords` for all HTTP keywords. use ``byte_extract`` and ``byte_test`` to verify that they work as expected. + +``byte_jump`` Keyword +--------------------- + +- Suricata allows a variable name from ``byte_extract`` or + ``byte_math`` to be specified for the ``nbytes`` value. The + value of ``nbytes`` must adhere to the same constraints + as if it were supplied directly in the rule. + + ``byte_math`` Keyword --------------------- @@ -276,7 +286,7 @@ See :doc:`http-keywords` for all HTTP keywords. uint32 value. Snort rejects ``rvalue`` values of ``0`` and requires values to be between ``[1..max-uint32 value]``. -- Suricata will never match if there's a zero divisor. Division by 0 is undefined. +- Suricata will never match if there's a zero divisor. Division by 0 is undefined. ``isdataat`` Keyword diff --git a/doc/userguide/rules/payload-keywords.rst b/doc/userguide/rules/payload-keywords.rst index f55d9958a660..41232490cb2b 100644 --- a/doc/userguide/rules/payload-keywords.rst +++ b/doc/userguide/rules/payload-keywords.rst @@ -516,7 +516,7 @@ The ``byte_jump`` keyword allows for the ability to select a ```` Format:: - byte_jump:, [, relative][, multiplier ] \ + byte_jump: | , [, relative][, multiplier ] \ [, ][, string, ][, align][, from_beginning][, from_end] \ [, post_offset ][, dce][, bitmask ]; @@ -524,6 +524,7 @@ Format:: +-----------------------+-----------------------------------------------------------------------+ | | The number of bytes selected from the packet to be converted | +| | or the name of a byte_extract/byte_math variable. | +-----------------------+-----------------------------------------------------------------------+ | | Number of bytes into the payload | +-----------------------+-----------------------------------------------------------------------+