AnsweredAssumed Answered

Regex to filter out specific OS types

Question asked by Michael Fennell on Feb 21, 2018
Latest reply on Feb 23, 2018 by Michael Fennell

HI Forum

I am wondering if anyone can help me here I have been trying to get specific with OS detection so I can tag them accordingly but I am running into issues with non-authenticated assets like network devices.

So for instance I am trying to find Linux assets with the following regex

-  ^(?=Linux).*$

So this works fine but the problem is it also returns assets which have a Linux type OS for instance a load balancer and an example of what is returned is as follows

-  Linux 2.4-2.6 / Embedded Device / F5 Networks Big-IP / Linux 2.6

The problem with the above is it gets returned because it has Linux in the string so what I am trying to do is write a regex to say return all Linux but if it has F5 Networks Big-IP in the title ignore this asset, am having no luck here and I seem to be just getting even worse, the regex I have tried on an online checker works with a string but I am thinking that what qualys uses under OS type regex is not just a string, this is what I have tried.

-  ^(?=.*Linux)(?!=.*F5 Networks Big-IP)(?!=.*Embedded Device).*

So as you can see I am again looking for Linux but not the other two, again I have got this to work using the online regex check but not within Qualys.

Anyone here able to give me any advice or pointers on this ?

Regards
Mike.

Outcomes