Getting into the kernel
Malicious Windows Drivers With Valid Signatures
How attackers get malicious Windows drivers signed: Microsoft's hardware program, stolen certificates, forged timestamps. Signer traces, checks and revocation.
- Goal
- Getting into the kernel
- Layer
- Kernel
- Platforms
- Windows
- Also known as
- Signed malicious drivers, Attestation-signed malware
- Checked by
- Windows drivers
Overview
The direct way to put malicious code in the Windows kernel is to have it signed. Driver signature enforcement then has nothing to object to: the driver loads like any vendor's, with no vulnerability exploited and no protection switched off. Where BYOVD borrows someone else's flawed driver, this technique brings the attacker's own driver with a signature that Windows accepts.
Microsoft's driver signing policy sets the bar. Since Windows 10 version 1607, Windows does not load new kernel drivers that the Hardware Dev Center has not signed, and opening a portal account requires an EV code-signing certificate. Cross-signed drivers are still accepted when the PC was upgraded from an earlier release, when Secure Boot is off, or when the driver was signed with an end-entity certificate issued before 29 July 2015 that chains to a supported cross-signed CA. Each path has been abused:
- submitting the driver to Microsoft's own signing programmes;
- signing with a stolen or leaked vendor certificate;
- using an old cross-signed certificate and forging the signing time so that an expired certificate still passes.
For a responder, the consequence is simple: a valid signature, including Microsoft's, is a fact to read, not a verdict.
How it works
| Route | What the file shows | Abused by | Microsoft's response |
|---|---|---|---|
| Windows Hardware Compatibility Program (WHCP) submission | Signer "Microsoft Windows Hardware Compatibility Publisher" | Netfilter, 2021 | Account suspended; Defender detections (Microsoft) |
| Attestation signing (no HLK testing, Windows 10 client only) | The same signer, with the attestation EKU 1.3.6.1.4.1.311.10.3.5.1 and a program name identifying the submitter (Mandiant) | POORTRY, 2022 | Accounts suspended, files' certificates revoked (ADV220005) |
| Stolen or leaked vendor certificate | A real company that has nothing to do with the product | POORTRY with a leaked NVIDIA certificate, 2022 | The certificate was revoked after its theft (Sophos) |
| Old cross-signed certificate with a forged timestamp | A certificate issued before 29 July 2015, or expired, and a signing time earlier than the build | POORTRY, 2024; tools reported by Cisco Talos | The certificates Talos reported were blocked (Talos); later certificates need their own revocation |
The signing programmes. The Hardware Dev Center signs drivers for vendors after testing (WHCP) or, for attestation, without the hardware tests. An actor who holds a developer account, opened with an EV code-signing certificate, can submit a malicious driver and receive Microsoft's signature; that is the route Mandiant and Sophos describe for POORTRY, and the account abuse Microsoft confirmed in ADV220005. Mandiant notes that legitimate drivers carry the same signer and EKU, so they are pivots for hunting, not proof.
The timestamp loophole. Cisco Talos describes open-source tools that alter "the signing date of a driver during the signing process", so that a newly built driver is signed with a non-revoked certificate issued or expired before 29 July 2015 and falls under the policy's third exception. Microsoft blocked the certificates Talos reported and published ADV230001.
Revocation. When Microsoft learns of such drivers, it suspends the accounts and adds the drivers or certificates to the untrusted list delivered through Windows security updates; ADV230001 says Sophos notified Microsoft on 9 February 2023, and Trend Micro and Cisco reported further drivers afterwards. A revoked driver is then refused and logged by Code Integrity. Revocation only covers what was reported, and the sources differ on the blocklist's role: Microsoft says it covers malicious drivers and certificates used to sign malware, while Talos describes it as focused on vulnerable drivers and advises against relying on it alone for malicious ones.
How families use it
Netfilter. G DATA found a Microsoft-signed driver in June 2021 that redirected traffic, installed a root certificate and set a proxy configuration. Microsoft confirmed that the actor had submitted the drivers through WHCP, that a third party had built them and that the signing certificate was not exposed. Netfilter variants were among the drivers Microsoft untrusted on 11 July 2023 after Sophos's report.
POORTRY. The EDR-killer driver behind BURNTCIGAR has used every route in the table. Sophos's 2022 report lists signers such as a leaked NVIDIA certificate and little-known Chinese companies; Mandiant and Microsoft documented attestation-signed copies submitted from developer accounts. After Microsoft closed that route, Sophos's 2024 report describes a driver signed with a certificate named "FEI XIAO" whose signature timestamp, it has high confidence, was forged; the driver's version information was copied from a legitimate Internet Download Manager driver (idmtdi.sys). Sophos counted at least nine signing certificates in 17 months, sometimes different ones on machines of the same network.
Traces it leaves
| Trace | Where | What to read |
|---|---|---|
| Signer and chain | The driver's Authenticode signature | Signer name, EKUs, attestation program name, certificate validity, signing time |
| Signing time against build time | Signature and PE header | A signing time before the certificate expired but long before or after the compile time, or version information copied from another product |
| File location | Where ImagePath points | Netfilter in %APPDATA%; POORTRY in %TEMP% under a random 5 to 7 letter name |
| Service key | SYSTEM hive, Services\<name> | Type 1, key last-write time |
| System log 7045 | System.evtx | Installation; Netfilter's installer wrote the registry through regini.exe, which may leave no 7045 |
| CodeIntegrity 3032, 3036, 3112, 3077 | Microsoft-Windows-CodeIntegrity%4Operational.evtx | A revoked file or certificate, or a policy block, after the revocation reached the host |
| Defender detections | Defender logs | Microsoft added detections for the reported drivers |
How to check a host
Offline:
- List kernel driver services and their images from the SYSTEM hive, and collect the files. Drivers in user profiles,
TemporProgramDatacome first. - For each, read the signature:
sigcheck -i -hor, on Windows,Get-AuthenticodeSignature. For a "Microsoft Windows Hardware Compatibility Publisher" signer, check the EKUs and the program name. For a third-party signer, ask whether the company makes this product, whether the certificate is known to be leaked or revoked, and whether its validity ends before the file was built. - Compare hashes with Microsoft's advisories and indicators, LOLDrivers (which has a malicious category), and the vendor reports.
- Read the CodeIntegrity log for revocation and block events and the System log for 7045.
Live, from an elevated prompt:
Get-CimInstance Win32_SystemDriver | Where-Object PathName -notmatch '\\System32\\(drivers|DriverStore)\\' | Select-Object Name, State, PathName
Get-AuthenticodeSignature C:\Windows\Temp\*.sys | Format-List Path, Status, SignerCertificate, TimeStamperCertificate
Get-ChildItem C:\Users\*\AppData -Recurse -Filter *.sys -Force -ErrorAction SilentlyContinue | ForEach-Object { sigcheck64.exe -accepteula -nobanner -i -h $_.FullName }
Get-WinEvent -LogName 'Microsoft-Windows-CodeIntegrity/Operational' -MaxEvents 500 | Where-Object Id -in 3032, 3036, 3077, 3112
Limits: signature checks done on an analysis machine use that machine's trust store and revocation data, not the host's at the time. A driver that was loaded, used and removed leaves only events and inventory. A driver that is running controls what the live system reports.
What the checker looks for
The windrivers module reads the driver services, the .sys files with their Authenticode signatures and hashes, Amcache and the System and CodeIntegrity logs:
- it shows each driver's signer and classifies the chain as Microsoft Windows, "Microsoft WHQL / attestation", vendor or other CA, or self-signed. A WHQL or attestation signature is reported as a fact, not as a sign of safety;
- a hash match in its LOLDrivers snapshot raises "A known malicious driver (LOLDrivers)" or the vulnerable-driver finding; the snapshot lists POORTRY samples as malicious and holds a
netfilter.sysentry that LOLDrivers files as vulnerable, so a match there raises the vulnerable-driver finding; - a service image in a temporary or user folder raises "A driver service loads its image from" that folder; an unreferenced copy raises "A driver file in a writable folder";
- broken or imitated signatures raise "The driver's signature does not verify", "The driver was changed after it was signed", "A certificate imitates a Microsoft CA" or "A driver signed with a self-signed certificate";
- CodeIntegrity 3032, 3036 and 3112 raise "Code Integrity refused a revoked file", and 3076 or 3077 the App Control block finding; 7045 raises "A kernel driver service was installed".
It does not check revocation, signing timestamps against certificate validity, EKUs or a trust store, and it holds no list of abused certificates. A driver with a valid signature, in a normal folder, with an unknown hash, raises nothing: read the signer column.
Mitigation and recovery
- Keep Windows updated. Microsoft's revocations and untrusted-driver lists arrive through updates, and the vulnerable driver blocklist, enforced with memory integrity (HVCI), includes drivers and certificates used for malware.
- Allow drivers deliberately. An App Control for Business policy that allows only the driver signers and hashes an organisation needs stops a validly signed driver from an unexpected company. Talos recommends blocking the certificates it published, and blocking malicious drivers by hash or certificate.
- Watch driver installation: 7045 and 4697 events, Sysmon event 6, and new drivers outside the usual folders.
Recovery follows the family pages. Preserve the service key, file and logs; remove the service and file; repair security products the driver disabled; and, since kernel code ran with full control, rebuild the host if you cannot account for everything it did. Investigate how the attacker became an administrator, because loading the driver required it.
Sources
Primary public reports, newest first.
- 2024-08-27Attack tool update impairs Windows computersSophos
- 2024-08-19Driver Signing PolicyMicrosoft
- 2023-07-11Old certificate, new signature: Open-source tools forge signature timestamps on Windows driversCisco Talos
- 2023-07-11ADV230001: Guidance on Microsoft Signed Drivers Being Used MaliciouslyMicrosoft
- 2023-07-11Microsoft Revokes Malicious Drivers in Patch Tuesday CullingSophos
- 2022-12-13ADV220005: Guidance on Microsoft Signed Drivers Being Used MaliciouslyMicrosoft
- 2022-12-13I Solemnly Swear My Driver Is Up to No Good: Hunting for Attestation Signed MalwareMandiant
- 2022-12-13Signed driver malware moves up the software trust chainSophos
- 2021-06-25Investigating and Mitigating Malicious DriversMicrosoft
- 2021-06-25Microsoft signed a malicious Netfilter rootkitG DATA
See also
Related techniques
- Bring your own vulnerable driver (BYOVD)Getting into the kernel
- Driver signature enforcement tamperingGetting into the kernel
- Removing kernel notification callbacksBlinding defences
- File system and network filter driversHiding
Families that use it
- Netfilter driverMalicious or abused driver
- POORTRY / BURNTCIGARMalicious or abused driver