Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong handling of patterns #303

Closed
Cyberspacecow opened this issue Oct 28, 2019 · 2 comments
Closed

Wrong handling of patterns #303

Cyberspacecow opened this issue Oct 28, 2019 · 2 comments
Milestone

Comments

@Cyberspacecow
Copy link

Indicators with pattern values that end with a single quote result in wrong parsing. For example to create the pattern with file name "weirdname'"

create_pattern_object(pattern="[ file:name = 'weirdname\\'' ]")

results in

[file:name = 'weird_name\']

Instead of expected:

[file:name = 'weird_name\'']

It also seems strange that the input has to have a double backslash.

Additionally creating registry values seems strange. Registry values seem to require four backslashes, otherwise throwing an InvalidValueError. For example to create an indicator of value "HKCU\test", the following code fails:

Indicator(labels=["test"], pattern="[windows-registry-key:key = 'HKCU\\test']")

and only:

Indicator(labels=["test"], pattern="[windows-registry-key:key = 'HKCU\\\\test']")

works, but the resulting pattern no longer represents the true indicator value (now it is json encoded "HKCU\test").

@clenk
Copy link
Contributor

clenk commented Nov 21, 2019

Thank you for the issue; we will look into it.

@clenk clenk closed this as completed in 5b07887 Jan 28, 2020
@emmanvg emmanvg added this to the 1.3.1 milestone Jan 28, 2020
@clenk
Copy link
Contributor

clenk commented Jan 28, 2020

@Cyberspacecow this fix will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants