篡改 Shell 命令行历史
编辑篡改 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
-
战术
- 名称: 防御规避
- ID: TA0005
- 参考 URL: https://attack.mitre.org/tactics/TA0005/
-
技术
- 名称: 指标删除
- ID: T1070
- 参考 URL: https://attack.mitre.org/techniques/T1070/
-
子技术
- 名称: 清除命令历史记录
- ID: T1070.003
- 参考 URL: https://attack.mitre.org/techniques/T1070/003/