Closed canilc closed 1 year ago
cc @thomaspatzke
I think the following escapes are unnecessary. This is because the following characters are not regex metacharacters:
\/c
\/r
\"
\-
I fixed a similar escaping issue yesterday. Can you solve it with the same fix as here? https://github.com/SigmaHQ/sigma/pull/3744
Tranferred to project where issue is contained.
Hi!
Can you explain to me the idea behind the escaping in |re
block?
e.g. if I want to match exact ip and some 4 digits port for example:
127.0.0.1:8000
the block should be:
ip|re: 127\.0\.0\.1:[1-9]\d{3}
The expecting result (with elasticsearch backend) should be:
ip:/127\.0\.0\.1:[1-9]\d{3}/
but the result is:
ip:/127\\.0\\.0\\.1:[1-9]\\d{3}/
.
clearly I don't want the \.
and the \d
to be escaped as they part of the pattern.
I guess there are 2 different issues.
Thanks to you all - we have a new test-case and could do things better.
@andurin Thanks for the quick fix :)
FYI:
I recently fixed the following Sigma |re
rules.
I checked how to escape in multiple programming languages for the fix as follows.
I would appreciate it if you could refer to it.
Hello,
I think conversion of the following rule produces incorrectly escaped elasticsearch equivalent:
/rules/windows/process_creation/proc_creation_win_invoke_obfuscation_clip.yml
The rule was updated recently, but I was working on a previous version which is:
(Escaped the new lines to reproduce the bug)
So the conversion of
outputs:
(?:\\/c|\\/r)
part is incorrectly escaped which should've been(?:\/c|\/r)
(because it already escapes another character in the regex there).The command used to produce the output above is: