Detection rules › Sigma

Linux Keylogging with Pam.d

Status
test
Severity
high
Log source
product linux, service auditd
Author
Pawel Mazur
Source
github.com/SigmaHQ/sigma

Detect attempt to enable auditing of TTY input

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Linux Keylogging with Pam.d
id: 49aae26c-450e-448b-911d-b3c13d178dfc
status: test
description: Detect attempt to enable auditing of TTY input
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1056.001/T1056.001.md
    - https://linux.die.net/man/8/pam_tty_audit
    - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/sec-configuring_pam_for_auditing
    - https://access.redhat.com/articles/4409591#audit-record-types-2
author: 'Pawel Mazur'
date: 2021-05-24
modified: 2022-12-18
tags:
    - attack.collection
    - attack.credential-access
    - attack.t1003
    - attack.t1056.001
logsource:
    product: linux
    service: auditd
detection:
    selection_path_events:
        type: PATH
        name:
            - '/etc/pam.d/system-auth'
            - '/etc/pam.d/password-auth'
    selection_tty_events:
        type:
            - 'TTY'
            - 'USER_TTY'
    condition: 1 of selection_*
falsepositives:
    - Administrative work
level: high

Stages and Predicates

Stage 0: condition

1 of selection_*

Stage 1: selection_path_events

selection_path_events:
    type: PATH
    name:
        - '/etc/pam.d/system-auth'
        - '/etc/pam.d/password-auth'

Stage 2: selection_tty_events

selection_tty_events:
    type:
        - 'TTY'
        - 'USER_TTY'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
nameeq
  • /etc/pam.d/password-auth
  • /etc/pam.d/system-auth
typeeq
  • PATH
  • TTY
  • USER_TTY