潜在可疑文件编辑edit

此规则监控潜在的可疑文件编辑。在 Linux 中,当通过编辑器编辑文件时,会创建一个临时 .swp 文件。通过监控此 .swp 文件的创建,我们可以检测到潜在的可疑文件编辑。此规则的执行并不代表文件被编辑的明确迹象,因为仅通过编辑器打开文件就会触发此事件。攻击者可能会更改此规则中添加的任何文件以建立持久性,提升特权或对系统进行侦察。

规则类型: eql

规则索引:

  • logs-endpoint.events.*
  • endgame-*

严重性: low

风险评分: 21

: 5m

: now-9m (Date Math 格式,另请参阅 Additional look-back time)

每次执行的最大警报数: 1

参考: 无

标签:

  • 领域: 端点
  • 操作系统: Linux
  • 用例: 威胁检测
  • 战术: 持久性
  • 战术: 特权提升
  • 数据源: Elastic Endgame
  • 数据源: Elastic Defend

版本: 5

规则作者:

  • Elastic

规则许可证: Elastic License v2

规则查询edit

file where host.os.type == "linux" and event.action in ("creation", "file_create_event") and file.extension == "swp" and
file.path : (
  /* common interesting files and locations */
  "/etc/.shadow.swp", "/etc/.shadow-.swp", "/etc/.shadow~.swp", "/etc/.gshadow.swp", "/etc/.gshadow-.swp",
  "/etc/.passwd.swp", "/etc/.pwd.db.swp", "/etc/.master.passwd.swp", "/etc/.spwd.db.swp", "/etc/security/.opasswd.swp",
  "/etc/.environment.swp", "/etc/.profile.swp", "/etc/sudoers.d/.*.swp", "/etc/ld.so.conf.d/.*.swp",
  "/etc/init.d/.*.swp", "/etc/.rc.local.swp", "/etc/rc*.d/.*.swp", "/dev/shm/.*.swp", "/etc/update-motd.d/.*.swp",
  "/usr/lib/update-notifier/.*.swp",

  /* service, timer, want, socket and lock files */
  "/etc/systemd/system/.*.swp", "/usr/local/lib/systemd/system/.*.swp", "/lib/systemd/system/.*.swp",
  "/usr/lib/systemd/system/.*.swp","/home/*/.config/systemd/user/.*.swp", "/run/.*.swp", "/var/run/.*.swp/",

  /* profile and shell configuration files */
  "/home/*.profile.swp", "/home/*.bash_profile.swp", "/home/*.bash_login.swp", "/home/*.bashrc.swp", "/home/*.bash_logout.swp",
  "/home/*.zshrc.swp", "/home/*.zlogin.swp", "/home/*.tcshrc.swp", "/home/*.kshrc.swp", "/home/*.config.fish.swp",
  "/root/*.profile.swp", "/root/*.bash_profile.swp", "/root/*.bash_login.swp", "/root/*.bashrc.swp", "/root/*.bash_logout.swp",
  "/root/*.zshrc.swp", "/root/*.zlogin.swp", "/root/*.tcshrc.swp", "/root/*.kshrc.swp", "/root/*.config.fish.swp"
)

框架: MITRE ATT&CKTM