Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Yara规则-Regex-语法错误:意外“')”_Regex_Yara - Fatal编程技术网

Yara规则-Regex-语法错误:意外“')”

Yara规则-Regex-语法错误:意外“')”,regex,yara,Regex,Yara,这里的答案——为了理解yara表面上的正则表达式规则,绝对值得一读——似乎适用于我正在寻找的给定二进制文件中的20个,例如: cuckoo.filesystem.file_access(/^C:\\(.*\\)?dnx\.exe$/i) or cuckoo.filesystem.file_access(/C\:\\WINDOWS\\system32\\Dxcap.exe/) or cuckoo.filesystem.file_access(/C\:\\WINDOWS\\system32\\dxc

这里的答案——为了理解yara表面上的正则表达式规则,绝对值得一读——似乎适用于我正在寻找的给定二进制文件中的20个,例如:

cuckoo.filesystem.file_access(/^C:\\(.*\\)?dnx\.exe$/i) or
cuckoo.filesystem.file_access(/C\:\\WINDOWS\\system32\\Dxcap.exe/) or
cuckoo.filesystem.file_access(/C\:\\WINDOWS\\system32\\dxcap.exe/) or
cuckoo.filesystem.file_access(/^C:\\Program Files\\(Microsoft Office\\)?(.*\\)?Excel\.exe$/i) or
cuckoo.filesystem.file_access(/^C:\\Program Files\\(Microsoft Office\\)?(.*\\)?EXCEL\.exe$/i) or
cuckoo.filesystem.file_access(/^C:\\Program Files\\(Microsoft Office\\)?(.*\\)?excel\.exe$/i) or
cuckoo.filesystem.file_access(/^C:\\Program Files (x86)\\(Microsoft Office\\)?(.*\\)?Excel\.exe$/i) or
cuckoo.filesystem.file_access(/^C:\\Program Files (x86)\\(Microsoft Office\\)?(.*\\)?EXCEL\.exe$/i) or
cuckoo.filesystem.file_access(/^C:\\Program Files (x86)\\(Microsoft Office\\)?(.*\\)?excel\.exe$/i) or
但是,以下行出现错误:

cuckoo.filesystem.file_access(/^C:\\Program Files (x86)\\)?(.*\\)?mftrace\.exe$/i) or
该错误为,第28行语法错误:意外

第27、28和29行为:

cuckoo.filesystem.file_access(/^C:\\Program Files (x86)\\(Microsoft Office\\)?(.*\\)?excel\.exe$/i) or
cuckoo.filesystem.file_access(/^C:\\Program Files (x86)\\)?(.*\\)?mftrace\.exe$/i) or
cuckoo.filesystem.file_access(/^C:\\Program Files\\)?(.*\\)?mftrace\.exe$/i) or
我的雅拉规则犯了什么错误

要匹配以下目录:

C:\Program Files (x86)\ * \ mftrace.exe

其中星号表示程序文件x86和mftrace.exe之间的任何中间路径,看起来第28行有一个额外的右括号:

cuckoo.filesystem.file_access(/^C:\\Program Files (x86)\\)?(.*\\)?mftrace\.exe$/i)
                                                         ^
在下一行几乎相同的位置还有一个


此外,您可能希望对模式中的其他括号进行转义,这些括号应该像x86一样被视为文本。

这不是问题,但您应该在x86中转义and