Skip to content
New issue

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

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

Already on GitHub? # to your account

Superrule generation logic #22

Open
kryponix opened this issue Jul 17, 2019 · 3 comments
Open

Superrule generation logic #22

kryponix opened this issue Jul 17, 2019 · 3 comments

Comments

@kryponix
Copy link

Hi,
Is it possible that the super-rule generation condition is inverted?
Inspecting the code, there's a condition that practically (unless there're at least 20 rules by default) stops the code from generating a super-rule (...if len(combinations[combi]["strings"]) >= int(args.rc):..).
Inverting the condition, allows the script to generate super-rules. It seems to me that args.rc, as described by the documentation shouldn't be playing that role in that condition.
I do agree that simply inverting the condition, might be a simplistic approach and that, of course, I just landed in the code and did not try it throughly, and will be more likely missing sth.
But reality is that the script does not generate super-rules even in cases where it should (I don't expect a super-rule covering dozens of (similar) samples to have more than 20 rules).
And as I stated before, it seems args.rc is being used with two different meanings (maximum number of strings for simple rules, (sort of a) minimum for super-rules.
Pls, forget me if I made a basic mistake (I'm not proficient in Python).
Thanks in advance for your help.

@Neo23x0
Copy link
Owner

Neo23x0 commented Jul 17, 2019

No. Everything works as expected.
As super rule is only generated if a minimum number of strings can be found in all samples.
That minimum number of strings is the "-rc" parameter.
So, if yarGen is ordered to extract 40 strings from a file and include them in a rule with "-rc 40", it requires 40 strings that can be found in all samples to create a rule for these samples.

@kryponix
Copy link
Author

kryponix commented Jul 24, 2019 via email

@Neo23x0
Copy link
Owner

Neo23x0 commented Jul 26, 2019

I've changed that behaviour in the latest commit.
Use -w to set a number of overlapping strings. (default is 5)

We have to test that behaviour now. I am not sure that this doesn't have any side effects.

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

No branches or pull requests

2 participants