Skip to content

Commit

Permalink
detect/byte-jump: Document var usage for nbytes
Browse files Browse the repository at this point in the history
Issue: 6105
  • Loading branch information
jlucovsky committed Jul 5, 2023
1 parent acc7e71 commit bb014ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion doc/userguide/rules/differences-from-snort.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------

Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion doc/userguide/rules/payload-keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -516,14 +516,15 @@ The ``byte_jump`` keyword allows for the ability to select a ``<num of bytes>``

Format::

byte_jump:<num of bytes>, <offset> [, relative][, multiplier <mult_value>] \
byte_jump:<num of bytes> | <variable-name>, <offset> [, relative][, multiplier <mult_value>] \
[, <endian>][, string, <num_type>][, align][, from_beginning][, from_end] \
[, post_offset <value>][, dce][, bitmask <value>];



+-----------------------+-----------------------------------------------------------------------+
| <num of bytes> | The number of bytes selected from the packet to be converted |
| | or the name of a byte_extract/byte_math variable. |
+-----------------------+-----------------------------------------------------------------------+
| <offset> | Number of bytes into the payload |
+-----------------------+-----------------------------------------------------------------------+
Expand Down

0 comments on commit bb014ac

Please sign in to comment.