RegEx looking for a specific UserAgent.

L4 Transporter

RegEx looking for a specific UserAgent.

I tried to migrate over my Cisco IPS regex to Palo Alto but it failed to load. Below is my Cisco Regex.

[Uu][Ss][Ee][Rr][-][Aa][Gg][Ee][Nn][Tt][:][\x20][^\x0d\x0a]*([Ss][Yy][Nn][Aa][Pp][Ss][Ee])

I tried creating a new pattern but it is to specific and not working.

I am looking to search the http header for User-Agent and if the value contains the word Synapse then alert.


Can someone help me to better understand what I am doing wrong?


Can someone educate me AND help generate the RegEx example for me.. (that is my real question)


Thanks


Steve

L4 Transporter

Re: RegEx looking for a specific UserAgent.

Steve,

The following works for XP detection:

Capture-xp user agent.PNG

So I would guess the pattern could be: User-Agent:.Synapse

One way to perfect it is to get a packet capture.  You may want to start with a pattern of just Synapse  and once you get a packet capture you can tune it up.

Phil

L2 Linker

Re: RegEx looking for a specific UserAgent.

Thank You Phil,

Using your string and manipulating it a little bit, I was able to adapt it to my needs.

Much appreciated.

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!