篡改 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

版本: 106

规则作者:

  • Elastic

规则许可: Elastic 许可证 v2

设置编辑

设置

如果在版本 <8.2 的非 elastic-agent 索引(如 beats)上启用 EQL 规则,事件将不会定义 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