Regex has always been somewhat of a black box for me.
I believe I need to use some regex to write some of the following yara rules. Yara rules use regex in order to match execution of particular binaries within malware. Knowledge of this is not necessary to answer the question, simply that they use regex.
I've got some basic rules down such as detection of the following programs:
C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe
C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe
With the following rules
cuckoo.filesystem.file_access(/C\:\\Program\ Files\ \(x86\)\\Windows\ Kits\\10\\Debuggers\\x64\\cdb.exe/) or
cuckoo.filesystem.file_access(/C\:\\Program\ Files\ \(x86\)\\Windows\ Kits\\10\\Debuggers\\x86\\cdb.exe/) or
But if i'm trying to detect execution of the following binaries, that being any file that matches the pattern of beginning with the C:\Program Files\ or C:\Program Files\Microsoft Office and ends with excel.exe
Something like the following?
cuckoo.filesystem.file_access(/C\:\\*\\Excel.exe/) or
What else needs detection is dnx.exe, perhaps something like this would work:
cuckoo.filesystem.file_access(/C\:\\*\\dnx.exe/) or
Also need to detect stuff like:
C:\Program Files\Microsoft Office\root\client\appvlp.exe
Where the root user may be any specific user and would ideally be replaced with a wildcard.