Query Details
//DefenderXDR Exposure Management for CVE-2024-3094 //https://www.linkedin.com/posts/activity-7180041278829580288-I4hU/ //After reading so many infosec posts relating XZ, I decided to build this high precision KQL detection using the latest DefenderXDR exposure management capability to determine Azure internet facing Linux machines that has vulnerable compromised XZ and running SSHD which are susceptible to RCE attack. If you have this rule triggered, I would strongly suggest you quickly remediate your Linux VM.🫡 let DeviceWithVulnerableXZ = DeviceTvmSoftwareInventory | where SoftwareName contains "xz" | where SoftwareVersion contains "5.6." | distinct DeviceName; let DevicewithSSHD = DeviceNetworkEvents | where ActionType == "ListeningConnectionCreated" | where LocalPort == 22 | distinct DeviceName; ExposureGraphNodes | where NodeLabel == 'device' or (Categories has 'virtual_machine' and set_has_element(Categories, 'virtual_machine')) // Condition: Internet Facing with vulnerable XZ and running SSHD | where NodeProperties.rawData.isInternetFacing == true | where NodeName has_any (DeviceWithVulnerableXZ) | where NodeName has_any (DevicewithSSHD)
This KQL query is designed to identify Azure internet-facing Linux machines that are vulnerable to a specific security issue (CVE-2024-3094) and are running SSHD, which makes them susceptible to remote code execution (RCE) attacks. Here's a simplified breakdown of what the query does:
Identify Devices with Vulnerable XZ Software:
Identify Devices Running SSHD:
Filter for Internet-Facing Devices:
Combine Conditions:
If this rule is triggered, it indicates that the identified Linux virtual machines are at high risk and should be remediated immediately.

Steven Lim
Released: August 2, 2024
Tables
Keywords
Operators