← Back to SOC feed Coverage →

java-executing-cmd-to-run-powershell

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficialpowershell
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-06T11:00:00Z · Confidence: medium

Hunt Hypothesis

The hypothesis is that an adversary is using a Java process to execute a command that runs PowerShell to perform stealthy system reconnaissance or lateral movement. A SOC team should proactively hunt for this behavior in Azure Sentinel as it indicates potential botnet activity and could signal the initial compromise of a system by a sophisticated threat actor.

KQL Query

DeviceProcessEvents                         
| where InitiatingProcessFileName == 'java.exe' and FileName == 'cmd.exe' 
and ProcessCommandLine has_all('powershell iex','DownloadString')

Analytic Rule Definition

id: 99a5a930-9ca6-440e-95f4-dfe23d217157
name: java-executing-cmd-to-run-powershell
description: |
  This query was originally published in the threat analytics report, Sysrv botnet evolution.
  Sysrv is a Go-based botnet that targets both Windows and Linux servers, and steals resources to mine cryptocurrency.
  The following query finds instances of the Java process being used to execute cmd.exe, and download and execute a PowerShell script.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
query: |
  DeviceProcessEvents                         
  | where InitiatingProcessFileName == 'java.exe' and FileName == 'cmd.exe' 
  and ProcessCommandLine has_all('powershell iex','DownloadString')

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/Campaigns/Sysrv-botnet/java-executing-cmd-to-run-powershell.yaml