潜在可疑文件编辑

编辑

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

规则类型: eql

规则索引:

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

严重性: 低

风险评分: 21

: 5 分钟运行一次

搜索索引自: now-9m (日期数学格式,另请参见 附加回溯时间

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

参考: 无

标签:

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

版本: 5

规则作者:

  • Elastic

规则许可证: Elastic License v2

规则查询

编辑
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