Regex Not matching when ? is in the URL.

Announcements

ATTENTION Customers, All Partners and Employees: The Customer Support Portal (CSP) will be undergoing maintenance and unavailable on Saturday, November 7, 2020, from 11 am to 11 pm PST. Please read our blog for more information.

Reply
Highlighted
L3 Networker

Regex Not matching when ? is in the URL.

I am trying to setup a custom application to match based on URL request which contains:

 

search=

 

This is the only consistent 7 byte string in the URL. This works fine unless the request contains a preceeding '?' in the URL. 

 

For example the following URL would not match

/some.php?af=352485245&search=blahblah

 

While this URL would match:

/some.php&af=352485245&search=blahblah

 

I am assuming this is because we are hitting the ? and stopping there. How would I write this pattern so that if there is a preceeding ? anywhere in the URL, it is ignored or treated as a literal '?'.


Accepted Solutions
Highlighted
L4 Transporter

Which context are you using. Please try using the http-req-params

View solution in original post


All Replies
Highlighted
L4 Transporter

Which context are you using. Please try using the http-req-params

View solution in original post

L4 Transporter

Good morning, jpeters.

 

As abjain stated, http-req-uri-path and http-req-params contain some distinctions that will help you match in this case.

 

See page 24 on this document: https://live.paloaltonetworks.com/t5/Documentation-Articles/Creating-Custom-Threat-Signatures/ta-p/5...

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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 Live Community as a whole!

The Live Community thanks you for your participation!