detect-suspicious-commands-initiated-by-web-server-processes


Description

This query was originally published in the threat analytics report, Operation Soft Cell. Operation Soft Cell is a series of campaigns targeting users' call logs at telecommunications providers throughout the world. These attacks date from as early as 2012. Operation Soft Cell operators sometimes use legitimate web server processes to launch commands, especially for network discovery and user/owner discovery. The following query detects activity of this kind. Reference - https://www.cybereason.com/blog/operation-soft-cell-a-worldwide-campaign-against-telecommunications-providers

Query · kql

// Suspicious commands launched by web server processes
DeviceProcessEvents 
| where Timestamp > ago(7d)
// Pivoting on parents or grand parents
and (((InitiatingProcessParentFileName in("w3wp.exe", "beasvc.exe",
"httpd.exe") or InitiatingProcessParentFileName startswith "tomcat")
or InitiatingProcessFileName in("w3wp.exe", "beasvc.exe", "httpd.exe") or
InitiatingProcessFileName startswith "tomcat"))
    and FileName in~('cmd.exe','powershell.exe')
| where ProcessCommandLine contains '%temp%'
    or ProcessCommandLine has 'wget'
    or ProcessCommandLine has 'whoami'
    or ProcessCommandLine has 'certutil'
    or ProcessCommandLine has 'systeminfo'
    or ProcessCommandLine has 'ping'
    or ProcessCommandLine has 'ipconfig'
    or ProcessCommandLine has 'timeout'
| summarize any(Timestamp), any(Timestamp), any(FileName),
makeset(ProcessCommandLine), any(InitiatingProcessFileName),
any(InitiatingProcessParentFileName) by DeviceId
Raw source detect-suspicious-commands-initiated-by-web-server-processes · KQL
Esc
Published by Azure/Azure-Sentinel ↗, licensed under MIT ↗. Reproduced here unmodified.
id: 7fdc5f4a-700d-4713-abfc-181f02968726
name: detect-suspicious-commands-initiated-by-web-server-processes
description: |
  This query was originally published in the threat analytics report, Operation Soft Cell.
  Operation Soft Cell is a series of campaigns targeting users' call logs at telecommunications providers throughout the world. These attacks date from as early as 2012.
  Operation Soft Cell operators sometimes use legitimate web server processes to launch commands, especially for network discovery and user/owner discovery. The following query detects activity of this kind.
  Reference - https://www.cybereason.com/blog/operation-soft-cell-a-worldwide-campaign-against-telecommunications-providers
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Execution
- Defense evasion
- Discovery
query: |
  // Suspicious commands launched by web server processes
  DeviceProcessEvents 
  | where Timestamp > ago(7d)
  // Pivoting on parents or grand parents
  and (((InitiatingProcessParentFileName in("w3wp.exe", "beasvc.exe",
  "httpd.exe") or InitiatingProcessParentFileName startswith "tomcat")
  or InitiatingProcessFileName in("w3wp.exe", "beasvc.exe", "httpd.exe") or
  InitiatingProcessFileName startswith "tomcat"))
      and FileName in~('cmd.exe','powershell.exe')
  | where ProcessCommandLine contains '%temp%'
      or ProcessCommandLine has 'wget'
      or ProcessCommandLine has 'whoami'
      or ProcessCommandLine has 'certutil'
      or ProcessCommandLine has 'systeminfo'
      or ProcessCommandLine has 'ping'
      or ProcessCommandLine has 'ipconfig'
      or ProcessCommandLine has 'timeout'
  | summarize any(Timestamp), any(Timestamp), any(FileName),
  makeset(ProcessCommandLine), any(InitiatingProcessFileName),
  any(InitiatingProcessParentFileName) by DeviceId

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.