[Snort-sigs] byte_test and buffer cursor

Alex McDonnell amcdonnell at ...435...
Thu Feb 9 16:34:23 EST 2017

I'm pretty sure that's in the Snort Manual, byte_test does not move the
cursor, byte_extract does. You could also test for the value you expect in
your second test to verify ;)

Alex McDonnell

On Thu, Feb 9, 2017 at 4:30 PM, Y M <snort at ...3751...> wrote:

> Does a byte_test move the cursor into a buffer the number of bytes it
> tests? Does is depend on the buffer against which the byte_test is
> operating?
> In essence, I am trying to use byte_test to validate that the decimal
> value of X number of bytes fall within a decimal range. Something similar
> to:
> http_raw_header; byte_test:3,>,160,0,relative;
> byte_test:3,<,170,0,relative;
> If the first byte_test above moves the cursor 3 bytes into the buffer, how
> can I reset the cursor back to the beginning of the buffer of the
> last/relative content match (http_raw_header)? Or am I just doing it all
> wrong?
> YM
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Snort-sigs mailing list
> Snort-sigs at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/snort-sigs
> http://www.snort.org
> Please visit http://blog.snort.org for the latest news about Snort!
> Visit the Snort.org to subscribe to the official Snort ruleset, make sure
> to stay up to date to catch the most <a href="
> https://snort.org/downloads/#rule-downloads">emerging threats</a>!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-sigs/attachments/20170209/9bad0074/attachment.html>

More information about the Snort-sigs mailing list