This hunt identifies potential persistence mechanisms leveraging Pluggable Authentication Modules (PAM) on Linux systems. PAM is a powerful framework for managing authentication-related tasks, but its flexibility can be abused by attackers to introduce malicious modules or modify configurations to gain unauthorized access or establish persistence. This hunt monitors for modifications to PAM-related files, directories, and modules.
"""
integration=["endpoint"]
uuid="2a3c46b8-7bd6-4bc4-a4a8-a1af114ea152"
name="Persistence via Pluggable Authentication Modules (PAM)"
language=["ES|QL","SQL"]
license="Elastic License v2"
notes=[
"PAM modules are critical to Linux authentication workflows, but they can be abused to establish persistence or execute malicious actions.",
"This hunt identifies suspicious file creation or modification events in PAM directories, such as /etc/pam.d/, /lib/security/, and related paths.",
"Uses ES|QL queries to track file events and identify potentially malicious activity based on process activity and file paths.",
"Complemented by OSQuery queries to provide detailed file metadata for modified PAM-related files, including timestamps and ownership information."