Detect System Firmware in IBM QRadar
Adversaries may modify system firmware (BIOS or UEFI/EFI) to achieve persistent access that survives OS reinstallation and disk replacement. Because firmware executes before the operating system loads, malicious implants planted here are extremely difficult to detect and remove. Attackers typically require a vulnerable or attacker-supplied kernel-mode driver to gain ring-0 access to SPI flash memory before overwriting or patching the firmware image. Real-world examples include LoJax (Fancy Bear/APT28), which repurposed the legitimate LoJack anti-theft agent's UEFI module; Trojan.Mebromi, which modified the Award BIOS; and the Hacking Team UEFI Rootkit. Detection must focus on observable pre-conditions and side-effects: execution of firmware analysis and flashing utilities, loading of privileged hardware-access drivers, suspicious UEFI variable modification, and creation of raw firmware image files.
MITRE ATT&CK
- Tactic
- Persistence Defense Evasion
- Technique
- T1542 Pre-OS Boot
- Sub-technique
- T1542.001 System Firmware
- Canonical reference
- https://attack.mitre.org/techniques/T1542/001/
QRadar Detection Query
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS EventTime,
logsourcename(logsourceid) AS LogSource,
devicestring AS Host,
username AS User,
QIDNAME(qid) AS EventName,
"Process Name" AS ProcessName,
"Command Line" AS CommandLine,
"Image Loaded" AS ImageLoaded,
"Target Filename" AS TargetFilename,
"Service Name" AS ServiceName,
"Service File Name" AS ServiceFileName,
magnitude AS RiskScore
FROM events
WHERE LOGSOURCETYPEID IN (
SELECT id FROM log_source_types
WHERE name IN ('Microsoft Windows Security Event Log', 'Microsoft Sysmon')
)
AND starttime > NOW() - INTERVAL '1440' MINUTES
AND (
(
(QIDNAME(qid) LIKE '%Process Create%' OR QIDNAME(qid) LIKE '%new process has been created%')
AND (
"Process Name" ILIKE ANY (
'%chipsec.exe', '%flashrom.exe', '%RWEverything.exe', '%RwDrv.exe',
'%AFUWIN.exe', '%AFUWIN64.exe', '%fpt.exe', '%fptw.exe', '%fptw64.exe',
'%FWUpdate.exe', '%biosflash.exe', '%meinfo.exe', '%meinfowin.exe',
'%UEFITool.exe', '%iflash.exe', '%AmiBIOSCoreUtil.exe'
)
OR "Command Line" ILIKE ANY (
'%chipsec%', '%flashrom%', '%SpiFlash%', '%bios.rom%', '%uefi.rom%',
'%bios.bin%', '%bios_backup%', '%flash_bios%', '%RWEverything%',
'%writephysmem%', '%readphysmem%'
)
)
)
OR (
QIDNAME(qid) LIKE '%Driver Loaded%'
AND "Image Loaded" ILIKE ANY (
'%RwDrv.sys%', '%sednit.sys%', '%chipsec.sys%', '%WinIo.sys%',
'%WinIo64.sys%', '%PhyMemX64.sys%', '%DirectIO64.sys%', '%asmmap64.sys%',
'%gdrv.sys%', '%bsflash64.sys%', '%inpoutx64.sys%', '%hwrwdrv.sys%',
'%lenovoemc.sys%', '%atkwio.sys%'
)
)
OR (
QIDNAME(qid) LIKE '%New Service Installed%'
AND (
(
"Service File Name" ILIKE ANY ('%\\Temp\\%', '%\\Users\\%', '%\\ProgramData\\%', '%\\Downloads\\%')
AND "Service File Name" ILIKE '%.sys%'
)
OR "Service Name" ILIKE ANY (
'%RwDrv%', '%chipsec%', '%WinIo%', '%DirectIO%', '%PhyMem%',
'%asmmap%', '%gdrv%', '%inpout%'
)
)
)
OR (
QIDNAME(qid) LIKE '%File Created%'
AND "Target Filename" ILIKE ANY ('%.rom', '%.fd', '%.cap')
AND "Process Name" NOT ILIKE ANY ('%svchost.exe%', '%MsMpEng.exe%', '%TrustedInstaller.exe%')
)
)
ORDER BY starttime DESC QRadar AQL detection for T1542.001 System Firmware modification using Windows Security and Sysmon log sources. Queries across four detection branches: firmware utility execution (Sysmon EID 1 / Security EID 4688) matching known tool names and CLI patterns, hardware-access driver loading (Sysmon EID 6) for named SPI-capable kernel drivers, suspicious kernel driver service installation (EID 7045) from user-writable paths or by known malicious service names, and firmware image file creation (Sysmon EID 11) for .rom/.fd/.cap extensions excluding trusted system processes.
Data Sources
Required Tables
False Positives & Tuning
- Vendor-supplied BIOS/UEFI update packages from Dell OMSA, HP iLO Amplifier, or Lenovo XClarity legitimately execute AFUWIN64.exe or fpt.exe and may install signed driver services during managed firmware patch deployments
- Authorized penetration testers using CHIPSEC (which registers chipsec.sys as a kernel service from a temp path) to validate firmware write-protect configurations on in-scope systems
- Disk imaging and system backup software that includes firmware backup functionality, creating .bin files in user profile directories as pre-update recovery snapshots
Other platforms for T1542.001
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Enumerate BIOS/UEFI Version and Vendor via WMI
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe and CommandLine containing 'Win32_BIOS' and 'EfiEnvironment'. PowerShell ScriptBlock Log Event ID 4104 with the full script. WMI activity logged in Microsoft-Windows-WMI-Activity/Operational.
- Test 2Execute CHIPSEC Firmware Analysis Tool
Expected signal: Sysmon Event ID 1: Process Create for python.exe with CommandLine containing 'chipsec'. Sysmon Event ID 6 (Driver Loaded): ImageLoaded ending in chipsec.sys, likely Signed=false. Windows System Event ID 7045: ServiceName=chipsec, ServiceFileName pointing to a temp path. If chipsec.sys is extracted to %TEMP%, Sysmon Event ID 11 (File Create) for chipsec.sys.
- Test 3Load RWEverything Privileged Hardware Access Driver (BYOVD Simulation)
Expected signal: Windows System Event ID 7045: ServiceName=RwDrv, ServiceType=kernel mode driver, ServiceFileName=%TEMP%\RwDrv.sys. Windows System Event ID 7036: RwDrv service entered running state. Sysmon Event ID 6 (Driver Loaded): ImageLoaded=%TEMP%\RwDrv.sys with Signed and SignatureStatus fields. Security Event ID 4688 for sc.exe process creation.
- Test 4Create Fake Firmware Image File from Non-System Process
Expected signal: Sysmon Event ID 11 (File Create): TargetFilename=%TEMP%\bios_modified.rom, Image=powershell.exe. Sysmon Event ID 1 (Process Create): powershell.exe CommandLine containing 'bios_modified.rom' and 'WriteAllBytes'. PowerShell ScriptBlock Log Event ID 4104 with the full script content.
References (10)
- https://attack.mitre.org/techniques/T1542/001/
- https://www.welivesecurity.com/2018/09/27/lojax-first-uefi-rootkit-found-wild-courtesy-sednit-group/
- https://securingtomorrow.mcafee.com/business/chipsec-support-vault-7-disclosure-scanning/
- https://github.com/chipsec/chipsec
- https://loldrivers.io/
- https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/microsoft-recommended-driver-block-rules
- https://www.mitre.org/capabilities/cybersecurity/overview/cybersecurity-blog/copernicus-question-your-assumptions-about
- https://web.archive.org/web/20170313124421/http://www.intelsecurity.com/advanced-threat-research/content/data/HT-UEFI-rootkit.html
- https://www.blackhat.com/docs/us-17/thursday/us-17-Matrosov-The-UEFI-Firmware-Rootkits-Myths-And-Reality.pdf
- https://eclypsium.com/research/the-firmware-supply-chain-problem/
Unlock Pro Content
Get the full detection package for T1542.001 including response playbook, investigation guide, and atomic red team tests.