I'm new to YARA rules and I wanted to build something really simple, a regex to match a hostname naming convention in my company.
Something like:
/AX[BCD][EFG](?=.*\d)[A-Z0-9]{5}/
where the last five characters HAVE TO have at least one digit.
Is there a way to "translate" this to YARA? Keeping in mind that only basic constructs are supported:
- Alternation (|)
- Concatenation
- Repetition (, ?, +, +?, ?, ??, {digit,digit}, {digit*,digit*}?, {digit+})
- Boundaries (\b, \B, ^, $)
- Grouping ((, ))
- Character classes (., \w, \W, \s, \S, \d, \D, [...], [^...])
- Hex escapes (\xHH)
- Normal escapes (\ + any special character)
- Anything else is a literal or illegal
Thanks!