Regex Not matching when ? is in the URL.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Regex Not matching when ? is in the URL.

L3 Networker

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 '?'.

1 accepted solution

Accepted Solutions

L4 Transporter

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

View solution in original post

2 REPLIES 2

L4 Transporter

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

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...

  • 1 accepted solution
  • 4917 Views
  • 2 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!