Home

Awesome

GhidraYara

A direct Yara/Ghidra integration, finally YARA for Ghidra without the suck!

Build

Screenshot Screenshot

Introduction

This is an extension providing an Analyzer for Ghidra integrating the YARA engine (via yara-java bindings) directly in the analysis process, as well as YARA generation and management capabilities throughout the Ghidra toolkit.

Until now, Ghidra users interested in leveraging YARA signature detection needed to resort to scripting or out-of-band solutions. With this extension, the entire process can be configured per-program and executed within the existent analysis workflow, automatically or manually, making the YARA engine a first-class citizen in the process. The same approach is applied for rule generation and testing.

This extension is still in development. It is fully functional, but should be considered experimental.

Highlights

Scanning (signature matching)

Screenshot

Rule generation and testing

Screenshot

Planned features and work in progress

Currently the following features are work-in-progress or planned for future inclusion:

Curated rule sets

TL;DR: Let the disassembler and decompiler do what they do best, and let the YARA engine do what it does best.

Currently, we provide a limited set of rules, documented in the data/rules directory. Some of these have been modified to eliminate false positives and otherwise irrelevant rules that, in our experience, are not particularly useful in a reverse engineering context.

The importance of minimizing or crafting rules carefully cannot be overstated: typically, the use case for YARA inside a tool like a Ghidra will be matching constants, such as those belonging to cryptographic suites, or algorithms related to error correction, lookup tables, encoding, etc. Function detection, for example, is best left to other Ghidra components to deal with (such as the FID engine). For example, YARA rules intended to match strings related to "antivm" or "antidebug", as found in many public repositories, are practically useless, and usually create conflicts. This also applies to rules attempting to detect compiler toolchains (as opposed to, say, packers).

Examples of good targets for rules to use with Ghidra:

Reporting bugs

Please file an issue, or even better, provide a tested and documented PR. :-)

Licensing

   Copyright (c) 2024 Subreption LLC. All rights reserved.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

This library and source code are distributed under the terms described in the LICENSE file.