Skip to main content

YARA generator inspired by yarGen

Project description

yarobot

License: GPL v3 Python Version Rust

yarobot is a high-performance YARA rule generator inspired by yarGen, designed to automatically create quality YARA rules from malware samples while minimizing false positives through intelligent goodware database comparison. screenshot

🚀 Features

  • Automated YARA Rule Generation: Create both simple and super rules from malware samples
  • Intelligent Scoring System: Advanced string scoring with goodware database comparison
  • High Performance: Core engine written in Rust for maximum speed

🛠 Installation

Install from PyPI

pip install yarobot

Build Prerequisites

  • Python 3.11 or higher
  • Rust toolchain (for building the native extension)

Install from Source

git clone https://github.com/ogre2007/yarobot
cd yarobot
pip install .

📖 Quick Start

Create Custom Goodware Database (if needed)

py -m yarobot.database create /path/to/goodware/files --recursive

Generate Rules from Malware Samples (cli)

py -m yarobot.generate /path/to/malware/samples --output-rule-file my_rules.yar

Start as web service

py -m yarobot.app [-g <goodware dbs path>]
app

then locate http://localhost:5000 or use api directly from anywhere:

curl -X POST -F "files=@tests\\data\\binary" http://localhost:5000/api/analyze -F "min_score=5" -F "get_opcodes=true"

Advanced Configuration

py -m yarobot.generate /malware/samples -g <goodware dbs path> \
  --opcodes \
  --recursive \
  --author "My Security Team" \
  --ref "Internal Investigation 2024" \
  --superrule-overlap 5 \
  --strings-per-rule 15

Database Management

# Update existing database with new goodware samples
(TODO) py -m yarobot.database update /path/to/new/goodware --identifier corporate 

# Create new database from scratch
py -m yarobot.database create /path/to/goodware --opcodes

🔧 Configuration Options

Rule Generation Options

  • --min-size, --max-size: String length boundaries
  • --min-score: Minimum string score threshold
  • --opcodes: Enable opcode feature for additional detection capabilities
  • --superrule-overlap: Minimum overlapping strings for super rule creation
  • --recursive: Scan directories recursively
  • --excludegood: Force exclusion of all goodware strings
  • --oe: only executable extensions

Database Options

  • --identifier: Database identifier for multi-environment support
  • --update: Update existing databases with new samples
  • --only-executable: Only process executable file extensions

🏗 Architecture

yarobot combines the performance of Rust with the flexibility of Python:

Core Components

  • Rust Engine (yarobot-rs): High-performance file processing and string analysis
  • Python Interface: CLI management, database operations, and rule formatting
  • Scoring Engine: Intelligent string scoring with goodware comparison
  • Rule Generator: YARA rule synthesis and optimization

Database Structure

  • good-strings.db: Common strings from goodware samples
  • good-opcodes.db: Opcode frequency database
  • good-imphashes.db: Import hash database
  • good-exports.db: Export function database

🤝 Contributing

We welcome contributions!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

TODO

  • http-service
  • web interface
  • fix/drop imphash/exports
  • default databases
  • rule generation rewriting
  • tokenizer code separated in different package
  • dex opcode extraction

📄 License

This project is licensed under the GPLv3 License - see the LICENSE file for details.

🙏 Acknowledgments

  • Based on yarGen by Florian Roth
  • Built with Pyo3 for Python-Rust integration
  • Uses goblin for binary parsing

📞 Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yarobot-0.3.1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

yarobot-0.3.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

yarobot-0.3.1-cp314-cp314-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.14Windows x86-64

yarobot-0.3.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

yarobot-0.3.1-cp314-cp314-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

yarobot-0.3.1-cp313-cp313-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.13Windows x86-64

yarobot-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

yarobot-0.3.1-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

yarobot-0.3.1-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

yarobot-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

yarobot-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

yarobot-0.3.1-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

yarobot-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

yarobot-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

yarobot-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

yarobot-0.3.1-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10Windows x86-64

yarobot-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file yarobot-0.3.1.tar.gz.

File metadata

  • Download URL: yarobot-0.3.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yarobot-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d131f17fcf2cdd939f3d9ade3dc77fe2bf0ce46300207896808e9ba124b66988
MD5 e14ec3e27571f63ba0ea102a0ac1e694
BLAKE2b-256 8947bee2cf3d2c120d08ad7229b1ca5ead98dfd451c486449d0e04f80e7e1e3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for yarobot-0.3.1.tar.gz:

Publisher: python-publish.yml on ogre2007/yarobot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yarobot-0.3.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e33345b440a15265a23456d5a3bf29430501e77090e813aa507a4f58a9ba3802
MD5 c9daad7982f3a44dc709acf5360bff3c
BLAKE2b-256 605b516a8d966c0395c28f3fb0066c652923e02b7428a88379415600ad2e74bb

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: yarobot-0.3.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for yarobot-0.3.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ab3661fb346ca69280f5cf0e5b1b048ae694e3b89f37d3995790067fda959f51
MD5 e862cba0b44d65a7d9d19e7a31790039
BLAKE2b-256 3eb318943236d12e1b6988e7df7488f4340625131c35e81e9f976d23af4dc497

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed5e949205ca3786086881f0752b6bd5c94750b2ee6f2240036df73f1b3a7b5a
MD5 8bb89206775ea1e461f4b6ef81359198
BLAKE2b-256 947073be1d895208cf07aa7fcf2e656bbd1a9e5fc2e72b8a63e360c5e2c9e431

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 265d1c3c46297cf028715f0ba66d3d5d80aaa922db14c983fc5ab81dc1a8f103
MD5 56d6be66b423e210ee2c9212d1a83543
BLAKE2b-256 6b48a19b69bc3086390ee56292502c90f23906cb68ea93265317570409a40d76

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: yarobot-0.3.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for yarobot-0.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 889040c2635cfa6ba6b1ed3bcc806d34a21678103c24db4d8a0a8951349c7445
MD5 c1633a02be8f7cd0bc288c1ca99fe4f9
BLAKE2b-256 acd8d0a7ae5b98f1203093e830663f4e44ddcee1c53f2a0b35e55701bd5d180c

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53ec73f2016914f336e4b6639f3cbab1fca820bd18e97b33ed17f301d3683152
MD5 bc88617b4664dc0b35933e6088ba5e19
BLAKE2b-256 96ba597ece295f98f966bf3b64291a16324ffa7a0ab0de0ecfb4fdd2ff49843a

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 52d01250b97c4d1ad93aba2d8a08c21ba88f5f61b3324268adbe2a223d605865
MD5 0cb5af51b24ea888ab1405e86fc56b10
BLAKE2b-256 308edb38f3aa3637795e03a927b03978fb5c59032e420ae73ed613e24ec78ac1

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: yarobot-0.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for yarobot-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8b6cff21487b5c6996b8e2062819e380ddb8f007436b82b7a4f33e650ec74a79
MD5 9cc79001314b05018deda8abe9c05b0d
BLAKE2b-256 1acd9a3fe224ee226db0184b3247dc0a8f544cd87f2e87034d757ff76a3fa0ae

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1ede68927729681f79a95f40f0b9b0bc70f49881a337e5d3b9dcba8b7878321
MD5 4affab62a714b82ad64ce7a029374c78
BLAKE2b-256 482284d205a9848a7398317462e2287c42b57c9a7e37adb6c5451808a88b02be

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3233cc9bb986f0d89258b3adc1d3e8855a392d0367171cc8d73107fa96b6cc8
MD5 ea08f261c514389c5d8e85ae8640813f
BLAKE2b-256 e61ff9d26bb158f7b2fc43b2c53b4c8b415ee9fb6e4b0c9289fc3d1004047c35

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: yarobot-0.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for yarobot-0.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3b9b45fe87d00abb70f50b70c40036085801eee1b1062b938e4b6f7f9cd2f9b7
MD5 64f117afe6b49ac346e6af5399539b00
BLAKE2b-256 852011b1a0193561d0e1a916c944a7a818ac94ad97ac0d862e196faea2bee3c7

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9b48b1306ad1891e3c09aa11212aea6f0d55427cf71722f54d19f1f26ce1c5f9
MD5 7a50b1280e2ddd3ad4cf917520e13ca1
BLAKE2b-256 1e1439b96e9c2442f53aad81c85bd42eebef3292f952a3c98ee110ec46c4131a

See more details on using hashes here.

Provenance

The following attestation bundles were made for yarobot-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: python-publish.yml on ogre2007/yarobot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yarobot-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe258f026d7a75b4690e0b9e15ebf61810334a8c47640265bbc2c1bbb18f6a24
MD5 0d99acd827e0dcbaf0ac690410d3c402
BLAKE2b-256 ca1b52c55b8d08615fd12e7192f37ef9f0d3d1a366b10b35e6f2b48686d3ccb6

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd6f82a25b1861c0977b37be6bf3b768c00891ee03bda884e70b1670aa6544ab
MD5 f121509c51d270a4c5e8165d3a25bc04
BLAKE2b-256 e79d15716bd58cb3e07cd8833f709b7177369380bfb371213f74bad14e0e5e60

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: yarobot-0.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for yarobot-0.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fd399b379e128120e59c033c1defefcb1f60a352369c5b4c78fcd45a8e4efb55
MD5 8950b38116fb8d7920a3db5988726701
BLAKE2b-256 e3c1e2f77ced91f4f7a4929ef79bf21c099d8da717fe73f963eb8af02c0ca63c

See more details on using hashes here.

File details

Details for the file yarobot-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for yarobot-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c10cc15b636e6cd9f179c03321a6852bc934cc87132a9bfbc54199f112474f46
MD5 7885d8289878fc449bcb1300560f4107
BLAKE2b-256 25c751273d6a1eae024735e4e5ba55e1365811287e8126dbc5e8a1312948d3f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page