- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
03-07-2016 12:37 AM
Someone can help me for this pattern?
PATTERN:
+-----------------------------------------------------------------------+
PATTERN in Hex:
2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b
QUESTION : the following RegEx not work, why?
\x2b(\x2d)*\x2b
03-07-2016 04:44 AM - edited 03-07-2016 04:57 AM
Good morning, Passepartout.
I'll do my best to provide some opinion on the above:
\x begins a hex pattern match instead of literal string matching, and \x ends a hex pattern match, returning to literal string matching. (REF: Page 11, Custom Sig creation document in our sticky).
My interpretation of what you want your signature to look for is "2b(any number of 2d)2b" which would look like:
\x2b\x(\x2d\x)*\x2b\x
However, this is not a valid pattern match for PAN-OS due to limitations described in the custom signature creation document on page 39; there is no static seven byte pattern, and two DFAs are juxtapositioned with one another.
To illustrate what is required, I embedded your pattern in a default Apache configuration index.html, and generated a signature to look for it, with the pattern: \x2b 2d 2d 2d 2d 2d 2d 2d\x(\x2d\x)*\x2b\x matching against the context "File-html-body"
This won't match anything with less than seven "2d" consecutively, but we need a static seven byte anchor to match on PAN-OS.
See attached. I've validated the signature resets on detection. Please note this is just to illustrate what is possible, not for use. 🙂
03-07-2016 04:44 AM - edited 03-07-2016 04:57 AM
Good morning, Passepartout.
I'll do my best to provide some opinion on the above:
\x begins a hex pattern match instead of literal string matching, and \x ends a hex pattern match, returning to literal string matching. (REF: Page 11, Custom Sig creation document in our sticky).
My interpretation of what you want your signature to look for is "2b(any number of 2d)2b" which would look like:
\x2b\x(\x2d\x)*\x2b\x
However, this is not a valid pattern match for PAN-OS due to limitations described in the custom signature creation document on page 39; there is no static seven byte pattern, and two DFAs are juxtapositioned with one another.
To illustrate what is required, I embedded your pattern in a default Apache configuration index.html, and generated a signature to look for it, with the pattern: \x2b 2d 2d 2d 2d 2d 2d 2d\x(\x2d\x)*\x2b\x matching against the context "File-html-body"
This won't match anything with less than seven "2d" consecutively, but we need a static seven byte anchor to match on PAN-OS.
See attached. I've validated the signature resets on detection. Please note this is just to illustrate what is possible, not for use. 🙂
03-15-2016 07:11 AM
I don't know if we talk of the same things, but my string in ASCII char is:
+-----------------------------------------------------------------------+
and the same string in Hex char is:
2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!