packet data(hex):01 02 03 04 05 06 07 aa ff 0a
alert udp any any -> any any (msg:"sig01"; sid:20; rev:3; byte_test:1,=,0x0a,9, bitmask 0x0a;)
alert udp any any -> any any (msg:"sig01"; sid:20; rev:3; byte_test:1,=,0x0a,9, bitmask 0x0f;)
The first rule isn’t detected, but the second is. I don’t know why.
I’d appreciate any advice.
The bitmask semantics derived from Snort’s behavior. We are consistent with that.
I noticed we didn’t document it for byte_test – we will correct that in the near future.
In the meantime, here’s what the documentation should’ve said for bitmask
The AND operator will be applied to the extracted value The result will be right shifted by the number of bits equal to the number of trailing zeros in the mask