通过 MS VisualStudio 预/构建后事件执行

编辑

通过 MS VisualStudio 预/构建后事件执行

编辑

识别通过 Microsoft Visual Studio 预构建或构建后事件执行命令的行为。攻击者可能会在受信任的 Visual Studio 项目中植入后门,以便在项目构建过程中执行恶意命令。

规则类型: eql

规则索引:

  • logs-endpoint.events.process-*

严重性: 低

风险评分: 21

: 60 分钟运行

搜索索引自: now-119m (日期数学格式,另见 额外回溯时间)

每次执行的最大告警数: 100

参考资料:

标签:

  • 领域:端点
  • 操作系统:Windows
  • 用例:威胁检测
  • 战术:防御规避
  • 战术:执行
  • 规则类型:BBR
  • 数据源:Elastic Defend

版本: 2

规则作者:

  • Elastic

规则许可证: Elastic License v2

规则查询

编辑
sequence with maxspan=1m
  [process where host.os.type == "windows" and event.action == "start" and
   process.name : "cmd.exe" and process.parent.name : "MSBuild.exe" and
   process.args : "?:\\Users\\*\\AppData\\Local\\Temp\\tmp*.exec.cmd"] by process.entity_id
  [process where host.os.type == "windows" and event.action == "start" and
    process.name : (
      "cmd.exe", "powershell.exe",
      "MSHTA.EXE", "CertUtil.exe",
      "CertReq.exe", "rundll32.exe",
      "regsvr32.exe", "MSbuild.exe",
      "cscript.exe", "wscript.exe",
      "installutil.exe"
    ) and
    not
    (
      process.name : ("cmd.exe", "powershell.exe") and
      process.args : (
        "*\\vcpkg\\scripts\\buildsystems\\msbuild\\applocal.ps1",
        "HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS?",
        "process.versions.node*",
        "?:\\Program Files\\nodejs\\node.exe",
        "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\*",
        "*Get-ChildItem*Tipasplus.css*",
        "Build\\GenerateResourceScripts.ps1",
        "Shared\\Common\\..\\..\\BuildTools\\ConfigBuilder.ps1\"",
        "?:\\Projets\\*\\PostBuild\\MediaCache.ps1"
      )
    ) and
    not process.executable : "?:\\Program Files*\\Microsoft Visual Studio\\*\\MSBuild.exe" and
    not (process.name : "cmd.exe" and
         process.command_line :
                  ("*vswhere.exe -property catalog_productSemanticVersion*",
                   "*git log --pretty=format*", "*\\.nuget\\packages\\vswhere\\*",
                   "*Common\\..\\..\\BuildTools\\*"))
  ] by process.parent.entity_id

框架: MITRE ATT&CKTM