Automatic YARA rule generation using biclustering for component/version identification from reference binaries (https://arxiv.org/abs/2009.03779)
Python
1
1 commits
updated Nov 4, 2025
This tool implements the methodology described in Automatic Yara Rule Generation Using Biclustering, adapting the research for modern component/version identification workflows. It automates signature generation by mining high-entropy n-grams from reference binaries or class files, grouping them into rules, and measuring the impact against explicit negative corpora. By combining approximate counting (for scalability), counting bloom filters, and biclustering-inspired selection heuristics, the system assembles YARA-compatible rules tailored to your training dataset.
NGramExtractor streams each positive sample, sketches the most frequent byte n-grams, and refines exact counts on promising candidates.--neg-dir during rule generation; the tool reports FP rates against them.bytes-to-bloom to pre-build counting bloom filters per component family. Supply datasets containing broader benign/mismatched samples so FP signals are meaningful.
Ensure all inputs are accessible on disk; compressed archives should be decompressed ahead of time.cd auto-yara-py
uv sync --extra dev
This creates a local environment with runtime and development dependencies. Use uv run to execute the commands below.
Generate a YARA rule from component samples.
uv run python -m auto_yara.cli.auto_yara build \
path/to/positive_dir \
--neg-dir path/to/negative_dir \
--output component_rule.yara \
--gram-size 4 \
--top-k 100 \
--target-cover 2 \
--min-group 2 \
--max-fp 0.1
--neg-dir may be repeated to include multiple negative directories; omit to skip FP evaluation.--gram-size and --top-k tune the n-gram search space; larger values increase recall but cost more time.Build a counting bloom filter from a corpus (useful for precomputed FP estimates).
uv run python -m auto_yara.cli.bytes_to_bloom \
path/to/corpus \
output/component.bloom \
--gram-size 3 \
--top-k 500 \
--filter-size 32768 \
--hash-functions 6
--filter-size controls bloom slots; larger sizes reduce collisions at the cost of memory.--hash-functions defines the number of hash streams..bloom files can be versioned and reused across experiments.Inspect metadata about an existing bloom filter.
uv run python -m auto_yara.cli.bloom_info show output/component.bloom
Outputs entry counts, divisor (source file count), slot size, and estimated minimum counts to help assess bloom health.
Run the full test and quality suite to ensure reproducibility:
uv run ruff check src tests
uv run mypy src tests
uv run pytest
The project ships with unit tests covering bloom filters, n-gram discovery, signature selection, rule formatting, evaluation, and CLI integration so you can extend functionality confidently.
1 commits
Python
100.0%
Automatic YARA rule generation using biclustering for component/version identification from reference binaries (https://arxiv.org/abs/2009.03779)
Python
1
1 commits
updated Nov 4, 2025
This tool implements the methodology described in Automatic Yara Rule Generation Using Biclustering, adapting the research for modern component/version identification workflows. It automates signature generation by mining high-entropy n-grams from reference binaries or class files, grouping them into rules, and measuring the impact against explicit negative corpora. By combining approximate counting (for scalability), counting bloom filters, and biclustering-inspired selection heuristics, the system assembles YARA-compatible rules tailored to your training dataset.
NGramExtractor streams each positive sample, sketches the most frequent byte n-grams, and refines exact counts on promising candidates.--neg-dir during rule generation; the tool reports FP rates against them.bytes-to-bloom to pre-build counting bloom filters per component family. Supply datasets containing broader benign/mismatched samples so FP signals are meaningful.
Ensure all inputs are accessible on disk; compressed archives should be decompressed ahead of time.cd auto-yara-py
uv sync --extra dev
This creates a local environment with runtime and development dependencies. Use uv run to execute the commands below.
Generate a YARA rule from component samples.
uv run python -m auto_yara.cli.auto_yara build \
path/to/positive_dir \
--neg-dir path/to/negative_dir \
--output component_rule.yara \
--gram-size 4 \
--top-k 100 \
--target-cover 2 \
--min-group 2 \
--max-fp 0.1
--neg-dir may be repeated to include multiple negative directories; omit to skip FP evaluation.--gram-size and --top-k tune the n-gram search space; larger values increase recall but cost more time.Build a counting bloom filter from a corpus (useful for precomputed FP estimates).
uv run python -m auto_yara.cli.bytes_to_bloom \
path/to/corpus \
output/component.bloom \
--gram-size 3 \
--top-k 500 \
--filter-size 32768 \
--hash-functions 6
--filter-size controls bloom slots; larger sizes reduce collisions at the cost of memory.--hash-functions defines the number of hash streams..bloom files can be versioned and reused across experiments.Inspect metadata about an existing bloom filter.
uv run python -m auto_yara.cli.bloom_info show output/component.bloom
Outputs entry counts, divisor (source file count), slot size, and estimated minimum counts to help assess bloom health.
Run the full test and quality suite to ensure reproducibility:
uv run ruff check src tests
uv run mypy src tests
uv run pytest
The project ships with unit tests covering bloom filters, n-gram discovery, signature selection, rule formatting, evaluation, and CLI integration so you can extend functionality confidently.
1 commits
Python
100.0%