MCPcopy Index your code
hub / github.com/0xrawsec/gene

github.com/0xrawsec/gene @v2.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.3.0 ↗ · + Follow
260 symbols 901 edges 28 files 119 documented · 46%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

coverage

GENE: Go Evtx sigNature Engine

The idea behind this project is to provide an efficient and standard way to look into Windows Event Logs (a.k.a EVTX files). For those who are familiar with Yara, it can be seen as a Yara engine but to look for information into Windows Events.

Here are some of our motivations: 1. By doing IR frequently we quickly notice the importance of the information we can find inside EVTX files (when they don't get cleared :)). 2. Some particular events can be considered as IOCs and are sometimes the only ones left on the system. 3. To the best of my knowledge, there is no easy way to query the logs and extract directly the interesting events. * because we (at least I) never remember all the interesting events * we cannot benefit of the other's knowledge 4. You might tell me, "Yeah! But I push all the interesting events to the SIEM and can query them very easily". To what I would reply that it is not that easy. * there are events you do not know they exist before you find it in an incident so it is very unlikely you push it into your SIEM * considering the example of Sysmon logs, it would be quite challenging to push everything interesting into your SIEM. Either you have few machines on your infra or you are very rich (or at least the company you are working for :)). 5. Before writing that tool I was always ending up implementing a custom piece of software in order to extract the information I needed, which in the end is not scalable at all and very time consuming. 6. I wanted a cross platform tool

Use Cases

  1. Gene can be used to quickly grab interesting information from EVTX at whatever stage of analysis.
  2. Early compromise information collection
  3. Infected host analysis
  4. IOC scan on all your machines
  5. If you are forwarding the Windows Event somewhere, you can use it as a scheduled task to extract relevant piece of information from those logs.
  6. It can be used to retro search into your EVTX backup
  7. It can be combined with Sysmon in order to build up use cases in a minute (the time to write the rule) and it is much more flexible than the Sysmon configuration file.
  8. Suspicious process spawned by another one
  9. Suspicious Driver load events
  10. Unusual DLL loaded by a given process
  11. ...

Documentation

In order to learn how to write rules please visit: https://rawsec.lu/doc/gene/2.0/

Additional resources: * To convert old rules (prior to 2.0.0 schema) to the new format, use migraterule.py * Where to find rules ?

Changelog

v2.0.0

  • Code refactoring:
    • Changes in package organisation
    • Changes in API definitions
    • Implementation of an Event interface making APIs more generic
    • Default actions to apply on detections
  • Changes in the rule format:
    • New way define events to apply rule on
    • Schema field to enforce rule format compatibility with engine
    • Removed trace support (not up to date and not used)
  • Regex templates defined in TOML format

v1.6.0

  • Indirect Match Support (we can now compare two fields of the same event)
  • Containers are now case insensitive
  • New -test command line switch to create easy Gene unit testing

v1.5.0

  • Support for Mitre ATT&CK framework
  • Changes in the reducer function

Extension points exported contracts — how you extend this code

Matcher (Interface)
Matcher interface [2 implementers]
engine/matches.go
OperandReader (Interface)
OperandReader interface [2 implementers]
engine/conditions.go
Event (Interface)
(no doc)
engine/event.go

Core symbols most depended-on inside this repo

NewEngine
called by 22
engine/engine.go
Count
called by 19
engine/engine.go
Error
called by 17
engine/engine.go
MatchOrFilter
called by 16
engine/engine.go
Len
called by 16
engine/path.go
LoadString
called by 15
engine/engine.go
Path
called by 15
engine/path.go
Get
called by 13
engine/event.go

Shape

Method 136
Function 97
Struct 20
TypeAlias 4
Interface 3

Languages

Go97%
Python3%

Modules by API surface

engine/engine.go34 symbols
engine/conditions.go26 symbols
reducer/reducer.go23 symbols
engine/matches.go23 symbols
engine/engine_test.go22 symbols
engine/rules.go19 symbols
engine/event.go19 symbols
engine/containers.go12 symbols
engine/parser_test.go10 symbols
scripts/sigma2gene.py9 symbols
engine/version.go9 symbols
engine/path.go9 symbols

For agents

$ claude mcp add gene \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page