Shell 命令行历史记录篡改

编辑

攻击者可能会尝试清除或禁用 Bash 命令行历史记录,以试图逃避检测或取证调查。

规则类型: eql

规则索引:

  • logs-endpoint.events.*
  • endgame-*
  • auditbeat-*
  • logs-auditd_manager.auditd-*

严重性: 中等

风险评分: 47

每隔: 5 分钟

搜索索引时间范围: now-9m (日期数学格式,另请参见 额外回溯时间)

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

参考:

标签:

  • 领域:端点
  • 操作系统:Linux
  • 操作系统:macOS
  • 用例:威胁检测
  • 战术:防御规避
  • 数据源:Elastic Defend
  • 数据源:Elastic Endgame
  • 数据源:Auditd Manager

版本: 107

规则作者:

  • Elastic

规则许可证: Elastic License v2

设置

编辑

设置

如果在非 elastic-agent 索引(例如 beats)上启用 EQL 规则且版本 < 8.2,则事件将不会定义 event.ingested,并且直到版本 8.2 才添加了 EQL 规则的默认回退。因此,为了使此规则有效,用户需要添加一个自定义摄取管道以将 event.ingested 填充到 @timestamp。有关添加自定义摄取管道的更多详细信息,请参阅 - https://elastic.ac.cn/guide/en/fleet/current/data-streams-pipeline-tutorial.html

规则查询

编辑
process where event.action in ("exec", "exec_event", "executed", "process_started") and event.type == "start" and
 (
  ((process.args : ("rm", "echo") or
    (process.args : "ln" and process.args : "-sf" and process.args : "/dev/null") or
    (process.args : "truncate" and process.args : "-s0"))
    and process.args : (".bash_history", "/root/.bash_history", "/home/*/.bash_history","/Users/.bash_history", "/Users/*/.bash_history",
                        ".zsh_history", "/root/.zsh_history", "/home/*/.zsh_history", "/Users/.zsh_history", "/Users/*/.zsh_history")) or
  (process.args : "history" and process.args : "-c") or
  (process.args : "export" and process.args : ("HISTFILE=/dev/null", "HISTFILESIZE=0")) or
  (process.args : "unset" and process.args : "HISTFILE") or
  (process.args : "set" and process.args : "history" and process.args : "+o")
 )

框架: MITRE ATT&CKTM