Hi Micha,

> My problem is that the "req.payload(0,10)" fetch, which I am using for
> that purpose, does not seem to reliably have access to the payload at
> all times.

The problem is not the fetch per se, it is the timing of the evaluation
of the rule: tcp-request content rules are evaluated very early - there's
a high probability the payload buffer is empty at this moment.

if you add a condition to check if there is already any content present, 
it will always match (checked using your config, thanks!):

tcp-request content set-var(txn.rawPayload) req.payload(0,2),hex if { req_len 
gt 0 }

As a side note: In case you want to match the payload in a binary (non-HTTP) 
make sure you convert the payload to hex first, see section 7.1.3 in the
newest configuration docs, here's the excerpt:

Do not use string matches for binary fetches which might contain null bytes
(0x00), as the comparison stops at the occurrence of the first null byte.
Instead, convert the binary fetch to a hex string with the hex converter first.


# matches if the string <tag> is present in the binary sample
acl tag_found req.payload(0,0),hex -m sub 3C7461673E

Best regards


Reply via email to