← Back to SOC feed Coverage →

Malware_In_recyclebin

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
backdoorhuntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-19T23:00:00Z · Confidence: medium

Hunt Hypothesis

Attackers may use the recycle bin to hide malware by moving or deleting malicious files, leveraging the persistence of deleted files in this location. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential malware persistence and exfiltration tactics that evade traditional detection methods.

KQL Query

DeviceProcessEvents 
| where Timestamp > ago(7d)
| where FileName in~('cmd.exe','ftp.exe','schtasks.exe','powershell.exe','rundll32.exe','regsvr32.exe','msiexec.exe')
| where ProcessCommandLine contains ":\\recycler"
| project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessFileName

Analytic Rule Definition

id: 5fa993a8-b9cd-419b-b67a-b783bf7dadbb
name: Malware_In_recyclebin
description: |
  Finding attackers hiding malware in the recycle bin.
  Read more here: https://azure.microsoft.com/blog/how-azure-security-center-helps-reveal-a-cyberattack/.
  Tags: #execution #SuspiciousPath.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
query: |
  DeviceProcessEvents 
  | where Timestamp > ago(7d)
  | where FileName in~('cmd.exe','ftp.exe','schtasks.exe','powershell.exe','rundll32.exe','regsvr32.exe','msiexec.exe')
  | where ProcessCommandLine contains ":\\recycler"
  | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessFileName

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Execution/Malware_In_recyclebin.yaml