潜在的可疑文件编辑

编辑

此规则监控潜在的可疑文件编辑。在 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