可插拔身份验证模块或配置的创建或修改

编辑

可插拔身份验证模块或配置的创建或修改编辑

此规则监控可插拔身份验证模块 (PAM) 共享对象文件或配置文件的创建或修改。攻击者可能会创建或修改这些文件,以便在受感染系统上保持持久性或收集帐户凭证。

规则类型: eql

规则索引:

  • logs-endpoint.events.file*

严重性: 中等

风险评分: 47

每隔: 5 分钟运行一次

从以下时间开始搜索索引: now-9m(日期数学格式,另请参见 Additional look-back time

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

参考:

标签:

  • 域:端点
  • 操作系统:Linux
  • 用例:威胁检测
  • 策略:凭证访问
  • 策略:持久性
  • 数据源:Elastic Defend

版本: 1

规则作者:

  • Elastic

规则许可证: Elastic 许可证 v2

规则查询编辑

file where host.os.type == "linux" and event.action in ("rename", "creation") and
process.executable != null and (
  (file.path : ("/lib/security/*", "/lib64/security/*", "/usr/lib/security/*", "/usr/lib64/security/*",
  "/usr/lib/x86_64-linux-gnu/security/*") and file.extension == "so") or
  (file.path : "/etc/pam.d/*" and file.extension == null) or
  (file.path : "/etc/security/pam_*" or file.path == "/etc/pam.conf")
) and not (
  process.executable in (
    "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
    "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
    "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
    "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
    "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
    "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client",
    "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe", "/dev/fd/*",  "/usr/bin/pamac-daemon",
    "/bin/pamac-daemon", "/usr/lib/snapd/snapd", "/usr/local/bin/dockerd", "/usr/sbin/pam-auth-update",
    "/usr/lib/systemd/systemd", "/usr/libexec/packagekitd", "/usr/bin/bsdtar"
  ) or
  file.path : (
    "/tmp/snap.rootfs_*/pam_*.so", "/tmp/newroot/lib/*/pam_*.so", "/tmp/newroot/usr/lib64/security/pam_*.so"
  ) or
  file.extension in ("swp", "swpx", "swx", "dpkg-remove") or
  file.Ext.original.extension == "dpkg-new" or
  process.executable : (
    "/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*"
  ) or
  (process.name == "sed" and file.name : "sed*") or
  (process.name == "perl" and file.name : "e2scrub_all.tmp*")
)

框架: MITRE ATT&CKTM