Automatically Generating Rules of Malicious Software Packages via Large Language Model

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhang, XiangRui, Chen, HaoYu, He, Yongzhong, Niu, Wenjia, Li, Qiang
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910917817532416
author Zhang, XiangRui
Chen, HaoYu
He, Yongzhong
Niu, Wenjia
Li, Qiang
author_facet Zhang, XiangRui
Chen, HaoYu
He, Yongzhong
Niu, Wenjia
Li, Qiang
contents Today's security tools predominantly rely on predefined rules crafted by experts, making them poorly adapted to the emergence of software supply chain attacks. To tackle this limitation, we propose a novel tool, RuleLLM, which leverages large language models (LLMs) to automate rule generation for OSS ecosystems. RuleLLM extracts metadata and code snippets from malware as its input, producing YARA and Semgrep rules that can be directly deployed in software development. Specifically, the rule generation task involves three subtasks: crafting rules, refining rules, and aligning rules. To validate RuleLLM's effectiveness, we implemented a prototype system and conducted experiments on the dataset of 1,633 malicious packages. The results are promising that RuleLLM generated 763 rules (452 YARA and 311 Semgrep) with a precision of 85.2\% and a recall of 91.8\%, outperforming state-of-the-art (SOTA) tools and scored-based approaches. We further analyzed generated rules and proposed a rule taxonomy: 11 categories and 38 subcategories.
format Preprint
id arxiv_https___arxiv_org_abs_2504_17198
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Automatically Generating Rules of Malicious Software Packages via Large Language Model
Zhang, XiangRui
Chen, HaoYu
He, Yongzhong
Niu, Wenjia
Li, Qiang
Software Engineering
Artificial Intelligence
Cryptography and Security
Today's security tools predominantly rely on predefined rules crafted by experts, making them poorly adapted to the emergence of software supply chain attacks. To tackle this limitation, we propose a novel tool, RuleLLM, which leverages large language models (LLMs) to automate rule generation for OSS ecosystems. RuleLLM extracts metadata and code snippets from malware as its input, producing YARA and Semgrep rules that can be directly deployed in software development. Specifically, the rule generation task involves three subtasks: crafting rules, refining rules, and aligning rules. To validate RuleLLM's effectiveness, we implemented a prototype system and conducted experiments on the dataset of 1,633 malicious packages. The results are promising that RuleLLM generated 763 rules (452 YARA and 311 Semgrep) with a precision of 85.2\% and a recall of 91.8\%, outperforming state-of-the-art (SOTA) tools and scored-based approaches. We further analyzed generated rules and proposed a rule taxonomy: 11 categories and 38 subcategories.
title Automatically Generating Rules of Malicious Software Packages via Large Language Model
topic Software Engineering
Artificial Intelligence
Cryptography and Security
url https://arxiv.org/abs/2504.17198