Generates a single YARA rule file (LOLDrivers.yar) for detecting known
vulnerable and malicious Windows drivers ("Bring Your Own Vulnerable Driver" /
BYOVD), sourced live from the LOLDrivers project.
The script pulls the full driver dataset from the LOLDrivers API and builds two YARA rules in one output file:
LOLDrivers_Hash— matches known vulnerable driver binaries by SHA256 hash using YARA'shashmodule.LOLDrivers_Name— matches known vulnerable driver filenames as strings, gated on the presence ofntoskrnl.exeto reduce false positives to kernel-mode contexts.
Every condition is preceded by a comment showing the driver's name and a short description of how it's abused (including a plain-English explanation of any MITRE ATT&CK technique IDs), so you can tell at a glance what each hash or filename corresponds to without looking it up.
import "hash"
rule LOLDrivers_Hash
{
meta:
description = "BYOVD: Detects known vulnerable/malicious drivers by SHA256 hash"
author = "FallinBinary (github.com/fallinbinary)"
source = "https://www.loldrivers.io/api/drivers.json"
reference = "https://www.loldrivers.io"
generated = "2026-06-30 12:00:00 UTC"
hash_count = "500"
condition:
// [Driver: RTCore64, MSI Afterburner] [Use: T1068 (Exploitation for Privilege Escalation) | Hardware monitoring]
hash.sha256(0, filesize) == "01a4d6212d...c4a0e"
or
// [Driver: gdrv, Gigabyte] [Use: T1068 (Exploitation for Privilege Escalation) | Arbitrary kernel R/W via IOCTL]
hash.sha256(0, filesize) == "5e8e8f2c1b...8d23f"
}
rule LOLDrivers_Name
{
meta:
description = "BYOVD: Detects known vulnerable/malicious drivers by filename"
author = "FallinBinary (github.com/fallinbinary)"
source = "https://www.loldrivers.io/api/drivers.json"
reference = "https://www.loldrivers.io"
generated = "2026-06-30 12:00:00 UTC"
filename_count = "480"
strings:
$krnl = "ntoskrnl.exe" nocase ascii wide fullword
// [Driver: RTCore64, MSI Afterburner] [Use: T1068 (Exploitation for Privilege Escalation) | Hardware monitoring]
$drv0000 = "RTCore64.sys" nocase ascii wide fullword
// [Driver: gdrv, Gigabyte] [Use: T1068 (Exploitation for Privilege Escalation) | Arbitrary kernel R/W via IOCTL]
$drv0001 = "gdrv.sys" nocase ascii wide fullword
condition:
$krnl and 1 of ($drv*)
}- Python 3.9+
- No third-party dependencies (uses only the standard library)
- To run the resulting
.yarfile: YARA compiled with thehashmodule enabled (default in most builds)
python3 loldrivers_yara.pyThis produces LOLDrivers.yar in the current directory.
To scan a file or directory with the generated rule:
yara -r LOLDrivers.yar /path/to/scanFor each driver entry, the script looks for a description in this order of preference:
- The driver's top-level
Usecasefield - The
Descriptionfield of any associatedCommands - The driver's
MitreIDfield(s), expanded into plain-English technique descriptions (e.g.T1068→ "Exploitation for Privilege Escalation — gain elevated privileges") - Any
Usecasefield found on individualKnownVulnerableSamples - The driver's
Categoryas a last resort
Any MITRE ATT&CK codes that appear in the resulting text are automatically expanded with a short explanation, and additional relevant codes attached to the driver are appended if not already present.
LOLDrivers is updated frequently as new vulnerable drivers are discovered.
Re-run the script periodically (e.g. via a scheduled GitHub Action) to keep
LOLDrivers.yar current.
- Driver data: LOLDrivers.io by the Living Off The Land Drivers project
- Generator script & rules: FallinBinary (github.com/fallinbinary)
MIT — see LOLDrivers' own licensing for terms governing the underlying driver dataset.