GithubHelp home page GithubHelp logo

randomrhythm / yara_rules_util Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 4.0 24 KB

YARA duplicate rule detection and removal. YARA rule index creation. YARA rule file merger.

Python 100.00%
remove duplicate yara rules index indexer

yara_rules_util's Introduction

YARA_Rules_Util

YARA duplicate rule detection and removal. YARA rule index creation. YARA rule file merger.

This script was initally written to deal with YARA error “duplicated identifier” in Cuckoo sandbox:

ERROR: Unable to match Yara signatures: /path/to/file.yar(85): duplicated identifier "RuleName" 

Parameters are optional. If you don’t provide the directory path the current directory is used.

Options:

-h, --help show this help message and exit

-r, --remove Remove duplicate rules

-d YARA_DIRECTORY_PATH, --directory=YARA_DIRECTORY_PATH (Folder path to directory containing YARA files)

-c YARA_FILE_PATH, --consolidate=YARA_FILE_PATH File path for consolidated YARA file

-m, --modify Modify the file to rename duplicate rules

-i YARA_INDEX_PATH, --index=YARA_INDEX_PATH Create and index of YARA files

-t YARA_INDEX_TYPE, --type=YARA_INDEX_TYPE Index YARA files based on parent folder match.

-b BASE_FOLDER_PATH, --BaseDirectory=BASE_FOLDER_PATH Base folder to mark as current directory ./

-s, --subdirectories Recurse into subdirectories

-v, --verboselog log all rules and the associated file to CSV

Remove duplicates example:

              YARA_Util.py -d "C:\YARAFolder" -r

Create index for a directory example:

              YARA_Util.py -d C:\YARA\rules-master\email -i C:\YARA\rules-master\email_index_new.yar -b rules-master

Create index for subdirectories example:

              YARA_Util.py -d C:\YARA\rules-master -i C:\YARA\rules-master\index_new.yar -b rules-master -s

Consolidate YARA rules of a certain file type example:

              YARA_Util.py -d C:\YARA\rules-master -c C:\YARA\PHP_Rules.yar -b rules-master -s -t php

References:

https://www.optiv.com/insights/source-zero/blog/selective-yara-scanning-whats-your-type

yara_rules_util's People

Contributors

randomrhythm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yara_rules_util's Issues

THANK YOU!

Not an issue. Just wanted to say this works perfectly and you just made my night.
Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.