← Back to SOC feed Coverage →

detect-jscript-file-creation

kql MEDIUM Azure-Sentinel
DeviceFileEvents
backdoorevasionhuntingmicrosoftofficialransomware
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-08T23:00:01Z · Confidence: medium

Hunt Hypothesis

The detection of a .jse file creation in the environment may indicate the presence of obfuscated JavaScript used for initial compromise or payload delivery. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential adversarial activity that could lead to persistent access or data exfiltration.

KQL Query

// Creation of any .jse file, including legitimate and malicious ones 
DeviceFileEvents 
| where Timestamp > ago(7d)
| where FileName endswith ".jse"

Analytic Rule Definition

id: 7913cb78-0e5a-4c4c-ab5b-31ef823ba25b
name: detect-jscript-file-creation
description: |
  This query was originally published in the threat analytics report, Emulation-evading JavaScripts.
  Attackers in several ransomware campaigns have employed heavily obfuscated JavaScript code, in order to implant malware or execute malicious commands. The obfuscation is intended to help the code evade security systems and potentially escape sandbox environments.
  The following query detects the creation of files with a .jse extension. Certain ransomware campaigns, such as Emotet, are known to employ encrypted JavaScript code that is saved to the target as .jse files.
  See Detect potentially malicious .jse launch by File Explorer or Word for a similar technique.
  Reference - https://www.microsoft.com/security/blog/2017/11/06/mitigating-and-eliminating-info-stealing-qakbot-and-emotet-in-corporate-networks/
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceFileEvents
tactics:
- Execution
- Defense evasion
query: |
  // Creation of any .jse file, including legitimate and malicious ones 
  DeviceFileEvents 
  | where Timestamp > ago(7d)
  | where FileName endswith ".jse"

Required Data Sources

Sentinel TableNotes
DeviceFileEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Delivery/detect-jscript-file-creation.yaml