-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Detect integers 6644 v12 #10234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Detect integers 6644 v12 #10234
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6c6fbbd
detect: integer keywords now support hexadecimal
catenacyber 2adbd03
detect: integer keywords now accept negated ranges
catenacyber 08dc21e
detect/integer: rust derive for enumerations
catenacyber f27ea82
detect: integer keywords now accept bitmasks
catenacyber 67bd213
doc: integer keywords
catenacyber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| .. _rules-integer-keywords: | ||
|
|
||
| Integer Keywords | ||
| ================ | ||
|
|
||
| Many keywords will match on an integer value on the network traffic. | ||
| These are unsigned integers that can be 8, 16, 32 or 64 bits. | ||
|
|
||
| Simple example:: | ||
|
|
||
| bsize:integer value; | ||
|
|
||
| The integer value can be written as base-10 like ``100`` or as | ||
| an hexadecimal value like ``0x64``. | ||
|
|
||
| The most direct example is to match for equality, but there are | ||
| different modes. | ||
|
|
||
| Comparison modes | ||
| ---------------- | ||
|
|
||
| Integers can be matched for | ||
| * Equality | ||
| * Inequality | ||
| * Greater than | ||
| * Less than | ||
| * Range | ||
| * Negated range | ||
| * Bitmask | ||
| * Negated Bitmask | ||
|
|
||
| .. note:: | ||
|
|
||
| Comparisons are strict by default. Ranges are thus exclusive. | ||
| That means a range between 1 and 4 will match 2 and 3, but neither 1 nor 4. | ||
| Negated range !1-4 will match for 1 or below and for 4 or above. | ||
|
|
||
| Examples:: | ||
|
|
||
| bsize:19; # equality | ||
| bsize:=0x13; # equality | ||
| bsize:!0x14; # inequality | ||
| bsize:!=20; # inequality | ||
| bsize:>21; # greater than | ||
| bsize:>=21; # greater than or equal | ||
| bsize:<22; # lesser than | ||
| bsize:<=22; # lesser than or equal | ||
| bsize:19-22; # range between value1 and value2 | ||
| bsize:!19-22; # negated range between value1 and value2 | ||
| bsize:&0xc0=0x80; # bitmask mask is compared to value for equality | ||
| bsize:&0xc0!=0; # bitmask mask is compared to value for inequality | ||
|
|
||
| Enumerations | ||
| ------------ | ||
|
|
||
| Some integers on the wire represent an enumeration, that is, some values | ||
| have a string/meaning associated to it. | ||
| Rules can be written using one of these strings to check for equality. | ||
| This is meant to make rules more human-readable and equivalent for matching. | ||
|
|
||
| Examples:: | ||
|
|
||
| websocket.opcode:text; | ||
| websocket.opcode:1; # behaves the same | ||
|
|
||
| Bitmasks | ||
| -------- | ||
|
|
||
| Some integers on the wire represent multiple bits. | ||
| Some of these bits have a string/meaning associated to it. | ||
| Rules can be written using a list (comma-separated) of these strings, | ||
| where each item can be negated. | ||
|
|
||
| Examples:: | ||
|
|
||
| websocket.flags:fin,!comp; | ||
| websocket.flags:&0xc0=0x80; # behaves the same |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
64-bitsor64-bit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without an s if I believe
Fixing that