Query Details
// SAP NetWeaver Attack by Chinese Threat Actor Impact Assessment // https://www.forescout.com/blog/threat-analysis-sap-vulnerability-exploited-in-the-wild-by-chinese-threat-actor/ let InternetFacing = DeviceInfo | where IsInternetFacing == true and isnotempty(PublicIP) | distinct DeviceId; let SAPNetweaver = DeviceProcessEvents | where TimeGenerated > ago(90d) | where InitiatingProcessVersionInfoProductName has "netweaver" | summarize arg_max(TimeGenerated, *) by DeviceId | where DeviceId has_any(InternetFacing); let ForescoutIOC=externaldata(Type:string, Value:string, Source:string) [h'https://raw.githubusercontent.com/SlimKQL/Hunting-Queries-Detection-Rules/refs/heads/main/IOC/Chaya_004-IOC10May2025.csv']; DeviceNetworkEvents | where TimeGenerated > ago(30d) | join ForescoutIOC on $left.RemoteIP == $right.Value | where ActionType has "ConnectionSuccess" or ActionType has "InboundConnectionAccepted" | where DeviceId has_any(SAPNetweaver) | summarize NoOfHits=count() by DeviceName, ActionType, RemoteIP | sort by NoOfHits desc
This query is designed to assess the impact of a potential attack on SAP NetWeaver systems by a Chinese threat actor. Here's a simplified breakdown of what the query does:
Identify Internet-Facing Devices: It first identifies devices that are exposed to the internet by checking if they have a public IP address.
Find SAP NetWeaver Processes: It then looks for processes related to SAP NetWeaver that have been active in the last 90 days on these internet-facing devices.
Load Indicators of Compromise (IOCs): The query imports a list of known threat indicators (IOCs) from an external CSV file hosted on GitHub. These indicators are associated with the Chinese threat actor.
Detect Network Events: It examines network events from the last 30 days, specifically looking for successful connections or accepted inbound connections that match the threat indicators.
Summarize and Sort Results: Finally, it counts and summarizes these events by device name, action type, and remote IP address, sorting them by the number of hits in descending order to highlight the most affected devices.
In essence, this query helps identify which internet-facing SAP NetWeaver systems might have been targeted or compromised by the specified threat actor, based on known threat indicators.

Steven Lim
Released: May 10, 2025
Tables
Keywords
Operators