Detection rules › Elastic

Potential Evasion via ASP.NET Compiler

Source
github.com/elastic/protections-artifacts

Identifies the execution of the ASPNET Compiler utility to execute cshap code passed via arguments. Adversaries may abuse this utility to run malicious code.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of the ASPNET Compiler utility to execute cshap code passed via arguments. Adversaries may
abuse this utility to run malicious code.
"""
id = "2aa05bad-c402-4504-9fbe-cc2fb273193a"
license = "Elastic License v2"
name = "Potential Evasion via ASP.NET Compiler"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Aspnet_Compiler/"]
version = "1.0.7"

query = '''
process where event.action == "start" and
 (process.name : "aspnet_compiler.exe" or process.pe.original_file_name : "aspnet_compiler.exe") and
  process.args : "-v" and process.args : "-f" and process.args : "-u" and not process.args : "-d" and
  not process.parent.executable : ("?:\\Program Files (x86)\\Microsoft Visual Studio*", "?:\\Program Files\\Microsoft Visual Studio*")
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.004"
name = "InstallUtil"
reference = "https://attack.mitre.org/techniques/T1218/004/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 (process.name : "aspnet_compiler.exe" or process.pe.original_file_name : "aspnet_compiler.exe") and
  process.args : "-v" and process.args : "-f" and process.args : "-u" and not process.args : "-d" and
  not process.parent.executable : ("?:\\Program Files (x86)\\Microsoft Visual Studio*", "?:\\Program Files\\Microsoft Visual Studio*")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq-dexcludes:process.args field:"process.args" value:"-d"
process.parent.executablestarts_with?:\Program Files (x86)\Microsoft Visual Studio, ?:\Program Files\Microsoft Visual Studioexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Microsoft Visual Studio" field:"process.parent.executable" value:"?:\Program Files\Microsoft Visual Studio"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • -f corpus 5 (elastic 5)
  • -u corpus 4 (elastic 4)
  • -v corpus 3 (elastic 3)
field:"process.args" kind:wildcard
process.namewildcard
  • aspnet_compiler.exe corpus 3 (elastic 3)
field:"process_name" kind:wildcard value:"aspnet_compiler.exe"
process.pe.original_file_namewildcard
  • aspnet_compiler.exe corpus 2 (elastic 2)
field:"OriginalFileName" kind:wildcard value:"aspnet_compiler.exe"