NY

neo23x0/yargen-go

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

94 stars 质量 54 趋势 0GPL-3.0

neo23x0/Yargen-Go 是从 https://github.com/neo23x0/yargen-go. 导入的特工技能候选人

概览

neo23x0/Yargen-Go 是从 https://github.com/neo23x0/yargen-go. 导入的特工技能候选人

概述(AI 翻译)

由 Florian Roth 重写的 yarGen(Python)——一个自动 YARA 规则生成器。

概述

yarGen-Go 从恶意软件文件中的字符串生成 YARA 规则,同时移除所有出现在 goodware 文件中的字符串。它包括:

  • yargen - 主规则生成器(CLI + 网页服务器)
  • yargen-util - 数据库管理工具

开始

Linux/macOS:

  1. 前置条件: 安装Go 1.22+

  2. 构建: 克隆仓库或下载ZIP并解压

  3. 构建二进制文件: 执行以下命令:

  4. 数据库: 运行./yargen-util update以下载goodware数据库

  5. 配置(可选): 将config/config.example.yml复制到config/config.yaml,并设置你的LLM API密钥

  6. ** 使用:** 运行 ./yargen serve 并打开网页界面 [http://127.0.0.1:8080

Windows:

  1. 前置条件: 安装Go 1.22+

  2. 构建: 克隆仓库或下载ZIP并解压

  3. 构建二进制文件: 执行以下命令:

  4. 数据库: 运行yargen-util.exe update下载goodware数据库

  5. 配置(可选): 将.\config\config.example.yml复制到.\config\config.yaml,并设置你的LLM API密钥

  6. 使用: 跑。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

yarGen-Go

A Go rewrite of yarGen (Python) by Florian Roth - an automatic YARA rule generator.

Overview

yarGen-Go generates YARA rules from strings found in malware files while removing all strings that also appear in goodware files. It includes:

  • yargen - Main rule generator (CLI + web server)
  • yargen-util - Database management utility

Getting Started

Linux/macOS:

  1. Prerequisites: Install Go 1.22+
  2. Build: Clone repository or download the ZIP and extract it
  3. Build binaries: Run the following commands:
    go mod tidy
    go build -o yargen ./cmd/yargen
    go build -o yargen-util ./cmd/yargen-util
    
  4. Databases: Run ./yargen-util update to download goodware databases
  5. Configure (Optional): Copy config/config.example.yml to config/config.yaml and set your LLM API key
  6. Use: Run ./yargen serve and open the Web UI at http://127.0.0.1:8080

Windows:

  1. Prerequisites: Install Go 1.22+
  2. Build: Clone repository or download the ZIP and extract it
  3. Build binaries: Run the following commands:
    go mod tidy
    go build -o yargen.exe .\cmd\yargen
    go build -o yargen-util.exe .\cmd\yargen-util
    
  4. Databases: Run yargen-util.exe update to download goodware databases
  5. Configure (Optional): Copy .\config\config.example.yml to .\config\config.yaml and set your LLM API key
  6. Use: Run .\yargen.exe serve and open the Web UI at http://127.0.0.1:8080

📖 For detailed setup instructions, see the Step-by-Step Setup Guide

Features

  • ASCII and UTF-16LE (wide) string extraction
  • Opcode extraction from PE/ELF executables
  • Encoding detection: Base64, hex-encoded, reversed strings
  • Magic header and filesize conditions
  • Super rule generation (overlapping string patterns across files)
  • Customizable scoring rules (SQLite-backed, editable via Web UI)
  • Efficient LLM integration for string selection (OpenAI, Anthropic, Gemini, Ollama)
    • Only submits prefiltered top candidates (no goodware strings, max 500 from automatic evaluation)
    • Requests numbered list instead of full strings to minimize token usage
    • Significantly reduces API costs compared to naive approaches
  • Web UI for rule generation and scoring rules management

Installation (Alternative Methods)

Using Pre-built Binaries

Download pre-built binaries from the Releases page for your platform.

Using Go Install

go install github.com/Neo23x0/yarGen-Go/cmd/yargen@latest
go install github.com/Neo23x0/yarGen-Go/cmd/yargen-util@latest

Binaries will be installed to $GOPATH/bin or $HOME/go/bin (add to PATH if needed).

Usage

CLI Mode

# Basic usage
yargen -m ./malware-samples

# With options
在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add neo23x0/yargen-go
新手?先看 mcpskill.org 教程 →