The byte_jump Keyword
The byte_jump
keyword calculates the number of bytes defined in a
specified byte segment, and then skips that number of bytes within the packet,
either forward from the end of the specified byte segment, or from the beginning or end of the packet payload, or from a
point relative to the last content match, depending on the options you specify. This
is useful in packets where a specific segment of bytes describe the number of bytes
included in variable data within the packet.
The following table describes the arguments required by the
byte_jump
keyword.
Argument |
Description |
---|---|
Bytes |
The number of bytes to pick up from the packet. If used without DCE/RPC, the allowed values are 0 to 10, with the following restrictions:
If used with DCE/RPC, allowed values are 1, 2, and 4. |
Offset |
The number of bytes into the payload to start processing. The
You can specify -65535 to 65535 bytes. You can also use an
existing |
The following table describes options you can use to define how the system interprets the values you specified for the required arguments.
Argument |
Description |
---|---|
Relative |
Makes the offset relative to the last pattern found in the last successful content match. |
Align |
Rounds the number of converted bytes up to the next 32-bit boundary. |
Multiplier |
Indicates the value by which the rules engine should multiply
the
That is, instead of skipping the number of bytes defined in a specified byte segment, the rules engine skips that number of bytes multiplied by an integer you specify with the Multiplier argument. |
Post Jump Offset |
The number of bytes
-65535 through 65535 to skip forward or backward after applying
other Note that some
|
From Beginning |
Indicates that the rules engine should skip the specified number of bytes in the payload starting from the beginning of the packet payload, instead of from the current position in the packet. |
From End |
The jump will originate from the byte that follows the last byte of the buffer. |
Bitmask |
Applies the specified hexadecimal bitmask using the AND operator to the bytes extracted from the Bytes argument. A bitmask can be 1 to 4 bytes. The result will be right-shifted by the number of bits equal to the number of trailing zeros in the mask. |
You can specify only one of DCE/RPC, Endian, or Number Type.
If you want to define
how the byte_jump
keyword calculates the bytes, you can choose
from the arguments described in the following table. If you do not select a
byte-ordering argument, the rules engine uses big endian byte order.
Argument |
Description |
---|---|
Big Endian |
Processes data in big endian byte order, which is the default network byte order. |
Little Endian |
Processes data in little endian byte order. |
DCE/RPC |
Specifies a
The DCE/RPC preprocessor determines big endian or little endian byte order, and the Number Type and Endian arguments do not apply. When you enable this argument, you can also use |
Define how the system views string data in a packet by using one of the arguments in the following table.
Argument |
Description |
---|---|
Hexadecimal String |
Represents converted string data in hexadecimal format. |
Decimal String |
Represents converted string data in decimal format. |
Octal String |
Represents converted string data in octal format. |
For example, if the values you set for
byte_jump
are as follows:
-
Bytes = 4
-
Offset = 12
-
Relative enabled
-
Align enabled
the rules engine calculates the number described in the four
bytes that appear 13 bytes after the last successful content match, and skips
ahead that number of bytes in the packet. For instance, if the four calculated
bytes in a specific packet were
00 00 00 1F
, the rules engine would convert this to 31.
Because
align
is specified (which instructs the engine to move
to the next 32-bit boundary), the rules engine skips ahead 32 bytes in the
packet.
Alternately, if the values you set for
byte_jump
are as follows:
-
Bytes = 4
-
Offset = 12
-
From Beginning enabled
-
Multiplier = 2
the rules engine calculates the number described in the four
bytes that appear 13 bytes after the beginning of the packet. Then, the engine
multiplies that number by two to obtain the total number of bytes to skip. For
instance, if the four calculated bytes in a specific packet were
00 00 00 1F
, the rules engine would convert this to 31,
then multiply it by two to get 62. Because From Beginning is enabled, the rules
engine skips the first 63 bytes in the packet.