Detect Video Capture in Elastic Security
Adversaries may leverage a computer's peripheral devices (e.g., integrated cameras or webcams) or applications (e.g., video call services) to capture video recordings for the purpose of gathering information. Images may also be captured from devices or applications, potentially in specified intervals, in lieu of video files. Malware or scripts may interact with webcam devices through OS or application APIs such as the Windows Video Capture API (avicap32.dll), DirectShow, Windows Media Foundation, or platform-specific libraries on macOS and Linux. Captured video or image files may be written to disk and exfiltrated later. Threat actors including Transparent Tribe (Crimson RAT), Silence Group, and tools such as Empire, NanoCore, Agent Tesla, and PoetRAT have demonstrated active use of this technique.
MITRE ATT&CK
- Tactic
- Collection
- Technique
- T1125 Video Capture
- Canonical reference
- https://attack.mitre.org/techniques/T1125/
Elastic Detection Query
sequence by host.name with maxspan=5m
[library where host.os.type == "windows" and
dll.name in~ ("avicap32.dll", "vfw32.dll", "mfreadwrite.dll") and
not process.name in~ ("Teams.exe", "zoom.exe", "Skype.exe", "slack.exe", "webex.exe",
"chrome.exe", "msedge.exe", "firefox.exe", "obs64.exe", "obs32.exe",
"vlc.exe", "ffmpeg.exe", "WindowsCamera.exe", "CameraApp.exe")]
any where host.os.type == "windows" and
(
/* Branch 1: Camera DLL load by suspicious process */
(event.category == "library" and
dll.name in~ ("avicap32.dll", "vfw32.dll", "mfreadwrite.dll") and
not process.name in~ ("Teams.exe", "zoom.exe", "Skype.exe", "slack.exe", "webex.exe",
"chrome.exe", "msedge.exe", "firefox.exe", "obs64.exe", "obs32.exe",
"vlc.exe", "ffmpeg.exe", "WindowsCamera.exe", "CameraApp.exe",
"VideoCapture.exe", "SnippingTool.exe"))
OR
/* Branch 2: Video file creation in suspicious paths */
(event.category == "file" and event.type == "creation" and
file.extension in~ ("avi", "mp4", "wmv", "mkv", "mov", "flv", "m4v") and
(
file.path like~ "*\\AppData\\Local\\Temp\\*" or
file.path like~ "*\\AppData\\Roaming\\*" or
file.path like~ "*\\ProgramData\\*" or
file.path like~ "*\\Users\\Public\\*" or
file.path like~ "*\\Windows\\Temp\\*"
) and
not process.name in~ ("Teams.exe", "zoom.exe", "Skype.exe", "slack.exe", "webex.exe",
"chrome.exe", "msedge.exe", "firefox.exe", "obs64.exe", "obs32.exe",
"vlc.exe", "ffmpeg.exe", "WindowsCamera.exe"))
OR
/* Branch 3: Camera registry enumeration by suspicious process */
(event.category == "registry" and
(
registry.path like~ "*KSCATEGORY_VIDEO_CAMERA*" or
registry.path like~ "*KSCATEGORY_CAPTURE*" or
registry.path like~ "*Camera*" or
registry.path like~ "*Webcam*" or
registry.path like~ "*VideoCapture*"
) and
not process.name in~ ("Teams.exe", "zoom.exe", "Skype.exe", "svchost.exe",
"WmiPrvSE.exe", "DeviceEnumerator.exe", "System"))
) Detects MITRE ATT&CK T1125 (Video Capture) by monitoring three behavioral signals: (1) suspicious processes loading Windows camera capture DLLs (avicap32.dll, vfw32.dll, mfreadwrite.dll) that are not known legitimate media applications, (2) video file creation in anomalous temp/staging paths by non-media processes, and (3) registry enumeration of camera/webcam device keys by unexpected processes. Covers RAT families such as Crimson RAT, NanoCore, Agent Tesla, and frameworks like Empire.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate screen recording or video editing software such as Camtasia, Bandicam, or OBS loading avicap32.dll during normal operation — tune by adding known applications to the exclusion list
- Enterprise video conferencing tools installed in non-standard paths or with unusual parent processes (e.g., auto-updaters) may trigger the DLL load branch
- Security software or endpoint agents performing device inventory scans may enumerate camera registry keys, particularly during initial deployment or policy refresh
Other platforms for T1125
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 1Webcam Access via avicap32.dll (Windows Legacy API)
Expected signal: Sysmon Event ID 7 (Image Load): Image=powershell.exe, ImageLoaded=C:\Windows\System32\avicap32.dll. Sysmon Event ID 1 (Process Create): CommandLine will contain 'avicap32.dll' and 'capCreateCaptureWindowA'. PowerShell Script Block Log Event ID 4104 with the full P/Invoke code.
- Test 2Video File Creation in Temp Directory Simulation
Expected signal: Sysmon Event ID 11 (File Create): Image=powershell.exe, TargetFilename=C:\Users\<user>\AppData\Local\Temp\capture_<timestamp>.avi. File will contain RIFF header bytes matching AVI format. Sysmon Event ID 1 (Process Create) for the PowerShell process.
- Test 3Webcam Capture via Python OpenCV (Cross-Platform)
Expected signal: Sysmon Event ID 1 (Process Create): Image=python3.exe (or python.exe), CommandLine contains 'cv2.VideoCapture' and 'imwrite'. Sysmon Event ID 7 (Image Load): opencv_videoio*.dll or _cv2.pyd loaded by python3.exe. Sysmon Event ID 11 (File Create): TargetFilename matching frame_<timestamp>.jpg in %TEMP%.
- Test 4Webcam Capture Using ffmpeg (Common RAT Dependency)
Expected signal: Sysmon Event ID 1 (Process Create): Image=ffmpeg.exe, CommandLine contains '-f dshow' and '-i video=' and the output .mp4 path in %TEMP%. Sysmon Event ID 11 (File Create): TargetFilename matching *.mp4 in %TEMP% with Image=ffmpeg.exe. DeviceNetworkEvents (KQL) should be clean for this test — ffmpeg does not make network connections in offline capture mode.
References (11)
- https://attack.mitre.org/techniques/T1125/
- https://objective-see.com/blog/blog_0x25.html
- https://learn.microsoft.com/en-us/windows/win32/multimedia/video-capture
- https://learn.microsoft.com/en-us/windows/win32/medfound/microsoft-media-foundation-sdk
- https://www.proofpoint.com/us/threat-insight/post/new-poison-ivy-rat-variant-targets-us-government-employees
- https://securelist.com/the-machete-apt/98121/
- https://blog.talosintelligence.com/2020/04/poetrat-targets-azerbaijan.html
- https://www.group-ib.com/resources/threat-research/silence_moving_into_the_darkside.pdf
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1125/T1125.md
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceimageloadevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
Unlock Pro Content
Get the full detection package for T1125 including response playbook, investigation guide, and atomic red team tests.