| ID | Technique | Tactic |
|---|---|---|
| T1218 | System Binary Proxy Execution | Stealth |
Detection: Windows Proxy Execution of .NET Utilities via Scripts
Description
The following analytic detects the launch of common .NET-related utilities—aspnet_compiler.exe, msbuild.exe, regasm.exe, InstallUtil.exe, or vbc.exe when the parent appears to be a script (batch, CMD, PowerShell, JScript, VBScript, or HTML) running from an unusual or user-writable Windows location (for example Public, Temp, Fonts, Debug, Recycle Bin, Prefetch, or similar paths), and the child process shows little or no command-line variation from the image path or name. That pattern is consistent with adversaries using trusted .NET binaries as a proxy to run code while hiding execution behind script parents in low-trust folders, behavior associated with techniques such as signed binary proxy execution.
Search
1
2| tstats `security_content_summariesonly`
3 count min(_time) as firstTime
4 max(_time) as lastTime
5from datamodel=Endpoint.Processes where
6
7Processes.process_name IN (
8 "aspnet_compiler.exe",
9 "InstallUtil.exe",
10 "msbuild.exe",
11 "regasm.exe",
12 "vbc.exe",
13)
14Processes.parent_process IN (
15 "*.bat*",
16 "*.cmd*",
17 "*.html*",
18 "*.js*",
19 "*.ps1*",
20 "*.vbe*",
21 "*.vbs*"
22)
23Processes.parent_process IN (
24 ":\\Windows\\repair\\*",
25 "*:\\Microsoft\\Windows\\Libraries\\*",
26 "*:\\Temp\\*",
27 "*:\\Users\\Administrator\\Music\\*",
28 "*:\\Users\\Public\\*",
29 "*:\\Windows\\Cursors\\*",
30 "*:\\Windows\\debug\\*",
31 "*:\\Windows\\Fonts\\*",
32 "*:\\Windows\\INF\\*",
33 "*:\\Windows\\Media\\*",
34 "*:\\Windows\\Prefetch\\*",
35 "*:\\Windows\\Temp\\*",
36 "*\\AppData\\Local\\Temp\\*",
37 "*\\PerfLogs\\*",
38 "*Recycle.bin*"
39 )
40 by Processes.action Processes.dest Processes.original_file_name Processes.parent_process Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id Processes.parent_process_name Processes.parent_process_path Processes.process Processes.process_exec Processes.process_guid Processes.process_hash Processes.process_id Processes.process_integrity_level Processes.process_name Processes.process_path Processes.user Processes.user_id Processes.vendor_product
41
42
43| where (isnull(Processes.process) OR Processes.process=Processes.process_path OR Processes.process=Processes.process_name)
44
45
46| `drop_dm_object_name(Processes)`
47
48| `security_content_ctime(firstTime)`
49
50| `security_content_ctime(lastTime)`
51
52| `windows_proxy_execution_of__net_utilities_via_scripts_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| CrowdStrike ProcessRollup2 | Other | 'crowdstrike:events:sensor' |
'crowdstrike' |
| Sysmon EventID 1 | 'XmlWinEventLog' |
'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational' |
|
| Windows Event Log Security 4688 | 'XmlWinEventLog' |
'XmlWinEventLog:Security' |
Macros Used
| Name | Value |
|---|---|
| security_content_ctime | convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$) |
| windows_proxy_execution_of__net_utilities_via_scripts_filter | search * |
windows_proxy_execution_of__net_utilities_via_scripts_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
| Setting | Value |
|---|---|
| Disabled | true |
| Cron Schedule | 0 * * * * |
| Earliest Time | -70m@m |
| Latest Time | -10m@m |
| Schedule Window | auto |
| Creates Risk Event | True |
Implementation
The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process GUID, process name, and parent process. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the Processes node of the Endpoint data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process.
Known False Positives
No false positives have been identified at this time.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message:
A suspicious script [$parent_process$] spawned [$process_name$] with CommandLine [$process$] on [$dest$].
| Risk Object | Risk Object Type | Risk Score | Threat Objects |
|---|---|---|---|
| dest | system | 20 | process_name, process, parent_process_name, parent_process |
References
Detection Testing
| Test Type | Status | Dataset | Source | Sourcetype |
|---|---|---|---|---|
| Validation | ✅ Passing | N/A | N/A | N/A |
| Unit | ✅ Passing | Dataset | XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
XmlWinEventLog |
| Integration | ✅ Passing | Dataset | XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
XmlWinEventLog |
Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
Source: GitHub | Version: 1