You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 16, 2025. It is now read-only.
After parsing a Yara Ruleset into a ast.RuleSet is there a way to manipulate a rule's condition?
Take this sample ruleset
rule rule_1 {
strings:
$header_v2 = {50 02}
$header_v3 = {50 03}
$header_v4 = {50 04}
$header_v5 = {50 05}
condition: (
for any of them: ($ at 0)
)
}
rule rule_2 {
strings:
$pattern_v4_4 = {8c 05 65 23 61 6c [0-32] 90}
$pattern_v4_5 = {8c 06 65 52 65 63 [0-32] 90}
condition:
any of them
}
I would like to make rule_2's condition rule_1 and any of them however I can't find an ast.Condition or any similar struct to do this. Here is the code I have so far for getting the rules condition. Now that I have it is there a way to modify it?
r2 := r.Rules[1]
for _, cond := range r2.Condition.Children() {
fmt.Println("Condition", cond)
}