T1123

Audio Capture

Adversaries may leverage a computer's peripheral devices (e.g., microphones) or applications (e.g., voice and video call services) to capture audio recordings for the purpose of listening into sensitive conversations. Malware or scripts interact with audio devices through OS APIs or application APIs to capture and record audio. Recorded files may be written to disk in staging directories and subsequently exfiltrated. Known malware families using this technique include Flame, ROKRAT, Bandook, VERMIN, TajMahal, Pupy, EvilGrab, LightSpy, Cadelspy, NanoCore, Crimson, MacMa, T9000, and Machete. PowerSploit's Get-MicrophoneAudio module provides an open-source implementation commonly repurposed by attackers.

Microsoft Sentinel / Defender
kusto
let AudioCaptureDlls = dynamic(["winmm.dll", "audioses.dll", "avrt.dll", "dsound.dll", "mfplat.dll"]);
let LegitAudioProcesses = dynamic([
  "audiodg.exe", "svchost.exe", "wmplayer.exe", "groove.exe", "msiexec.exe",
  "teams.exe", "ms-teams.exe", "zoom.exe", "zoomwebviewhost.exe",
  "skype.exe", "skypehost.exe", "skypebridge.exe",
  "discord.exe", "slack.exe", "webex.exe",
  "chrome.exe", "msedge.exe", "firefox.exe", "iexplore.exe", "opera.exe",
  "spotify.exe", "vlc.exe", "mpv.exe", "SoundRecorder.exe",
  "RuntimeBroker.exe", "ShellExperienceHost.exe", "SearchHost.exe",
  "SystemSettings.exe", "explorer.exe"
]);
let AudioExtensions = dynamic([".wav", ".mp3", ".wma", ".ogg", ".flac", ".aac", ".m4a", ".raw"]);
let SuspiciousStagingPaths = dynamic([
  "\\AppData\\Local\\Temp\\", "\\AppData\\Roaming\\Intel\\",
  "\\AppData\\Roaming\\Microsoft\\Windows\\",
  "\\Users\\Public\\", "\\ProgramData\\", "\\Windows\\Temp\\",
  "\\Windows\\Tasks\\", "\\Recycle"
]);
union
(
    DeviceImageLoadEvents
    | where Timestamp > ago(24h)
    | where FileName in~ (AudioCaptureDlls)
    | where not (InitiatingProcessFileName in~ (LegitAudioProcesses))
    | where not (InitiatingProcessFolderPath has_any ("\\Program Files\\", "\\Program Files (x86)\\", "\\Windows\\System32\\", "\\Windows\\SysWOW64\\"))
    | extend DetectionType = "SuspiciousAudioDllLoad"
    | extend Detail = strcat("Process loaded audio DLL: ", FileName)
    | project Timestamp, DeviceName, AccountName, DetectionType, Detail,
              ProcessName = InitiatingProcessFileName,
              CommandLine = InitiatingProcessCommandLine,
              ProcessPath = InitiatingProcessFolderPath
),
(
    DeviceFileEvents
    | where Timestamp > ago(24h)
    | where ActionType == "FileCreated"
    | where FileName has_any (AudioExtensions)
    | where FolderPath has_any (SuspiciousStagingPaths)
    | where not (InitiatingProcessFileName in~ (LegitAudioProcesses))
    | extend DetectionType = "AudioFileStagedInSuspiciousPath"
    | extend Detail = strcat("Audio file created: ", FolderPath)
    | project Timestamp, DeviceName, AccountName, DetectionType, Detail,
              ProcessName = InitiatingProcessFileName,
              CommandLine = InitiatingProcessCommandLine,
              ProcessPath = InitiatingProcessFolderPath
),
(
    DeviceProcessEvents
    | where Timestamp > ago(24h)
    | where ProcessCommandLine has_any (
        "Get-MicrophoneAudio", "WaveInEvent", "WaveFileWriter", "NAudio",
        "mciSendString", "waveInOpen", "AudioCapture", "MicCapture",
        "dshow\", \"audio=", "-f dshow", "avfoundation",
        "WindowsAudioDevice", "CoreAudio", "AVAudioRecorder"
      )
    | extend DetectionType = "AudioCaptureToolUsage"
    | extend Detail = strcat("Audio capture keyword in command line: ", ProcessCommandLine)
    | project Timestamp, DeviceName, AccountName, DetectionType, Detail,
              ProcessName = FileName,
              CommandLine = ProcessCommandLine,
              ProcessPath = FolderPath
)
| sort by Timestamp desc
high severity medium confidence

Data Sources

Module: Module Load File: File Creation Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceImageLoadEvents DeviceFileEvents DeviceProcessEvents

False Positives

  • Legitimate audio/video conferencing software (Teams, Zoom, Webex, Discord) loading audio DLLs from non-standard install paths or as part of update processes
  • Media production software (Audacity, Adobe Audition, OBS, DAWs) creating audio files in user-defined output directories that overlap with staging path heuristics
  • Voice recognition software (Dragon NaturallySpeaking, Windows Cortana/Speech services) continuously accessing audio APIs in the background
  • Game software or streaming tools (OBS, XSplit) that capture system audio via DirectSound or WASAPI for game capture
  • Podcast or screencasting tools recording audio to AppData as their default output path
  • Security testing or red team exercises using PowerSploit or atomic-red-team audio test scripts

Unlock Pro Content

Get the full detection package for T1123 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections