jar-attachments


Description

This query was originally published in the threat analytics report, Adwind utilizes Java for cross-platform impact. Adwind is a remote access tool (RAT) that takes advantage of the cross-platform capabilities of the Java framework. It can check which operating system a target is running and adapt accordingly, allowing it to successfully compromise both Windows and macOS devices. The query below must be run in Microsoft Defender XDR. This query detects events where a single Java archive, or JAR file, was attached to an incoming email. Since Adwind is distributed as a JAR file, this can help detect the initial access stage of a Adwind attack. Note that, although the behavior detected by this query is typical of attacks that use Adwind malware, unrelated attacks may use the same or similar techniques. Also note that JAR attachments are not necessarily or even often malware, and that further research will be needed to determine if query results are associated with malicious behavior. See Hiding a Java class file for an additional query that detects behavior associated with Adwind attacks.

Query · kql

let mailsHTML = EmailAttachmentInfo
| where FileType startswith "Jar"
| distinct NetworkMessageId;
EmailEvents
| where NetworkMessageId in (mailsHTML) and AttachmentCount > 0
Raw source jar-attachments · KQL
Esc
Published by Azure/Azure-Sentinel ↗, licensed under MIT ↗. Reproduced here unmodified.
id: 3a45afa5-e955-4bff-8876-a42934f3533f
name: jar-attachments
description: |
  This query was originally published in the threat analytics report, Adwind utilizes Java for cross-platform impact.
  Adwind is a remote access tool (RAT) that takes advantage of the cross-platform capabilities of the Java framework. It can check which operating system a target is running and adapt accordingly, allowing it to successfully compromise both Windows and macOS devices.
  The query below must be run in Microsoft Defender XDR. This query detects events where a single Java archive, or JAR file, was attached to an incoming email. Since Adwind is distributed as a JAR file, this can help detect the initial access stage of a Adwind attack. Note that, although the behavior detected by this query is typical of attacks that use Adwind malware, unrelated attacks may use the same or similar techniques. Also note that JAR attachments are not necessarily or even often malware, and that further research will be needed to determine if query results are associated with malicious behavior.
  See Hiding a Java class file for an additional query that detects behavior associated with Adwind attacks.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - EmailAttachmentInfo
  - EmailEvents
tactics:
- Initial access
query: |
  let mailsHTML = EmailAttachmentInfo
  | where FileType startswith "Jar"
  | distinct NetworkMessageId;
  EmailEvents
  | where NetworkMessageId in (mailsHTML) and AttachmentCount > 0

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.