Modification of OpenSSH Binaries

Last updated 6 months ago on 2025-02-03
Created 5 years ago on 2020-12-21

About

Adversaries may modify SSH related binaries for persistence or credential access by patching sensitive functions to enable unauthorized access or by logging SSH credentials for exfiltration.
Tags
Domain: EndpointOS: LinuxUse Case: Threat DetectionTactic: Credential AccessTactic: PersistenceTactic: Lateral MovementData Source: Elastic EndgameData Source: Elastic DefendLanguage: kuery
Severity
medium
Risk Score
47
MITRE ATT&CK™

Persistence (TA0003)(opens in a new tab or window)

Credential Access (TA0006)(opens in a new tab or window)

Lateral Movement (TA0008)(opens in a new tab or window)

False Positive Examples
Trusted OpenSSH executable updates. It's recommended to verify the integrity of OpenSSH binary changes.
License
Elastic License v2(opens in a new tab or window)

Definition

Rule Type
Query (Kibana Query Language)
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.*endgame-*
Related Integrations

endpoint(opens in a new tab or window)

Query
event.category:file and host.os.type:linux and event.type:change and 
  process.name:(* and not (
    dnf or dnf-automatic or dpkg or yum or rpm or yum-cron or anacron or platform-python* or
    apk or ansible-admin or systemd or python* or yum or nix-daemon or nix
    )
  ) and 
  (file.path:(/usr/bin/scp or 
                /usr/bin/sftp or 
                /usr/bin/ssh or 
                /usr/sbin/sshd) or 
  file.name:libkeyutils.so) and
  not process.executable:/usr/share/elasticsearch/*

Install detection rules in Elastic Security

Detect Modification of OpenSSH Binaries in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).