T1204

User Execution

Adversaries rely on specific actions by a user to gain execution. Users are subjected to social engineering to execute malicious code by opening malicious document files, clicking links, running copy-pasted commands, or installing remote access tools under false pretenses. This technique frequently follows phishing (T1566) and encompasses a wide range of deceptive methods including malicious Office documents spawning shells, fake CAPTCHAs instructing users to paste PowerShell into Run dialogs (ClickFix/ClearFake), tech support scams prompting RAT installation, and malicious LNK files on removable media. Threat groups including Scattered Spider, LAPSUS$, and malware families like Lumma Stealer and Raspberry Robin rely heavily on user-initiated execution to bypass automated defenses.

Microsoft Sentinel / Defender
kusto
let OfficeAndDocApps = dynamic([
  "WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE", "OUTLOOK.EXE",
  "MSPUB.EXE", "ONENOTE.EXE", "VISIO.EXE",
  "acrord32.exe", "acrobat.exe", "foxitreader.exe",
  "chrome.exe", "msedge.exe", "firefox.exe", "iexplore.exe", "opera.exe"
]);
let ShellInterpreters = dynamic([
  "cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe",
  "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe",
  "certutil.exe", "bitsadmin.exe"
]);
let RATBinaries = dynamic([
  "anydesk.exe", "teamviewer.exe", "screenconnect.exe",
  "connectwisecontrol.exe", "splashtopstreamer.exe", "ultraviewer.exe",
  "rustdesk.exe", "supremo.exe", "ammyy admin.exe", "radmin.exe",
  "atera_agent.exe", "level.exe", "fleetdeck.exe", "netsupport.exe"
]);
let UserWritablePaths = dynamic([
  "\\Downloads\\", "\\Desktop\\",
  "\\AppData\\Local\\Temp\\", "\\Users\\Public\\",
  "\\AppData\\Roaming\\"
]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| extend IsOfficeOrBrowserParent = InitiatingProcessFileName has_any (OfficeAndDocApps)
| extend IsShellChild = FileName has_any (ShellInterpreters)
| extend IsRATExecution = FileName has_any (RATBinaries)
| extend IsUserDirExec = FolderPath has_any (UserWritablePaths)
    and FileName endswith ".exe"
    and InitiatingProcessFileName =~ "explorer.exe"
// Exclude common legitimate browser-spawned updaters
| where not (
    IsUserDirExec
    and FileName in~ ("OneDriveSetup.exe", "Teams.exe", "Slack.exe",
                      "Zoom.exe", "update.exe", "setup.exe")
  )
| extend OfficeShellSpawn = IsOfficeOrBrowserParent and IsShellChild
| where OfficeShellSpawn or IsRATExecution or IsUserDirExec
| extend DetectionCategory = case(
    OfficeShellSpawn, "Office/Browser Shell Spawn",
    IsRATExecution, "Remote Access Tool Execution (Possible Social Engineering)",
    "Executable Launched from User-Writable Directory"
  )
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
          ProcessCommandLine, InitiatingProcessFileName,
          InitiatingProcessCommandLine, DetectionCategory
| sort by Timestamp desc
high severity high confidence

Data Sources

Process: Process Creation Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • Legitimate IT-deployed remote access tools (AnyDesk, TeamViewer, ScreenConnect) installed by helpdesk staff — these should appear with MSI/SCCM parent processes rather than browsers or explorer.exe
  • Developers running scripts directly from their Downloads or Desktop folder — allowlist known developer workstations or specific AccountNames with documented exceptions
  • Office macros used by finance or operations teams for legitimate automation — document and allowlist specific macro-enabled workbooks and the user accounts that run them
  • Browser-spawned update helpers or credential managers that briefly launch from AppData\Roaming — build a baseline of expected binaries per application

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections