Detect NET runtime being loaded in JScript for code execution
| Id | 9f921513-65f3-48a2-ae7d-326c5901c55e |
| Rulename | Detect .NET runtime being loaded in JScript for code execution |
| Description | This query detects .NET being loaded from wscript or cscript to run .NET code, such as cactustorch and sharpshooter. All based on the DotNetToJScript by James Foreshaw documented here https://github.com/tyranid/DotNetToJScript. |
| Severity | Medium |
| Tactics | Execution |
| Techniques | T1204 |
| Required data connectors | MicrosoftThreatProtection |
| Kind | Scheduled |
| Query frequency | 1h |
| Query period | 1h |
| Trigger threshold | 0 |
| Trigger operator | gt |
| Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/FalconFriday/Analytic Rules/DotNetToJScript.yaml |
| Version | 1.0.0 |
| Arm template | 9f921513-65f3-48a2-ae7d-326c5901c55e.json |
DeviceImageLoadEvents
| where FileName in~ ("mscoree.dll", "mscorlib.dll", "mscorlib.ni.dll")
| where tolower(InitiatingProcessFileName) in ("wscript.exe", "cscript.exe", "mshta.exe")
query: |
DeviceImageLoadEvents
| where FileName in~ ("mscoree.dll", "mscorlib.dll", "mscorlib.ni.dll")
| where tolower(InitiatingProcessFileName) in ("wscript.exe", "cscript.exe", "mshta.exe")
entityMappings:
- fieldMappings:
- identifier: Sid
columnName: InitiatingProcessAccountSid
- identifier: Name
columnName: InitiatingProcessAccountName
- identifier: NTDomain
columnName: InitiatingProcessAccountDomain
entityType: Account
- fieldMappings:
- identifier: FullName
columnName: DeviceName
entityType: Host
- fieldMappings:
- identifier: CommandLine
columnName: InitiatingProcessCommandLine
entityType: Process
triggerOperator: gt
description: |
This query detects .NET being loaded from wscript or cscript to run .NET code, such as cactustorch and sharpshooter.
All based on the DotNetToJScript by James Foreshaw documented here https://github.com/tyranid/DotNetToJScript.
tactics:
- Execution
severity: Medium
queryFrequency: 1h
kind: Scheduled
name: Detect .NET runtime being loaded in JScript for code execution
triggerThreshold: 0
status: Available
id: 9f921513-65f3-48a2-ae7d-326c5901c55e
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
dataTypes:
- DeviceImageLoadEvents
relevantTechniques:
- T1204
version: 1.0.0
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/FalconFriday/Analytic Rules/DotNetToJScript.yaml
queryPeriod: 1h