T1098.004 CrowdStrike LogScale · LogScale

Detect SSH Authorized Keys in CrowdStrike LogScale

Adversaries may modify the SSH authorized_keys file to maintain persistence on a victim host. The authorized_keys file specifies SSH keys permitted for logging into a user account, typically found at <user-home>/.ssh/authorized_keys. Adversaries add their own public keys to this file, enabling passwordless SSH access using the corresponding private key. This technique is used by multiple threat actors including Earth Lusca, TeamTNT, and Salt Typhoon, as well as malware families like Skidmap, XCSSET, and Bundlore.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation
Technique
T1098 Account Manipulation
Sub-technique
T1098.004 SSH Authorized Keys
Canonical reference
https://attack.mitre.org/techniques/T1098/004/

LogScale Detection Query

CrowdStrike LogScale (LogScale)
cql
// SSH Authorized Keys Modification — T1098.004
// Detects process command lines writing to authorized_keys paths via shell utilities or network downloaders

#event_simpleName in (ProcessRollup2, SyntheticProcessRollup2)
| CommandLine = /authorized_keys/i
| regex("(?i)(echo|printf|tee|>>|ssh-keygen|curl|wget|cp |mv |dd |install )", field=CommandLine)
| IsRootSSHDir := if(CommandLine = /\/root\/.ssh/i, 1, 0)
| IsEtcSSHKeys := if(CommandLine = /\/etc\/ssh\/keys-/i, 1, 0)
| IsRedirectAppend := if(CommandLine = />>|tee -a|tee --append/i, 1, 0)
| IsSshKeygen := if(CommandLine = /ssh-keygen/i, 1, 0)
| IsCurlWget := if(CommandLine = /curl|wget/i OR ParentBaseFileName = /^(curl|wget)$/i, 1, 0)
| IsSuspiciousParent := if(ParentBaseFileName = /^(bash|sh|dash|zsh|python[23]?|perl|ruby|nc|ncat|netcat)$/i, 1, 0)
| SuspicionScore := IsRootSSHDir + IsEtcSSHKeys + IsRedirectAppend + IsSshKeygen + IsCurlWget + IsSuspiciousParent
| SuspicionScore > 0
| sort(SuspicionScore, order=desc)
| select([ComputerName, UserName, FileName, CommandLine, ParentBaseFileName, SHA256HashData, IsRootSSHDir, IsEtcSSHKeys, IsRedirectAppend, IsSshKeygen, IsCurlWget, IsSuspiciousParent, SuspicionScore])
high severity high confidence

Detects SSH authorized_keys modification in CrowdStrike LogScale (Humio) by querying Falcon process telemetry (ProcessRollup2, SyntheticProcessRollup2) for command lines referencing authorized_keys alongside file-writing utilities or download tools. Computes a six-factor suspicion score: root SSH directory access, /etc/ssh/keys- paths, append redirect operators, ssh-keygen invocation, curl/wget parents or command usage, and suspicious scripting/network parent executables. Events with SuspicionScore > 0 are surfaced, sorted by highest risk first.

Data Sources

CrowdStrike Falcon EDR sensor (ProcessRollup2, SyntheticProcessRollup2 events)CrowdStrike Falcon LogScale (Humio) via NG-SIEMCrowdStrike Falcon Insight XDR event searchCrowdStrike Falcon Foundry custom application queries

Required Tables

ProcessRollup2SyntheticProcessRollup2

False Positives & Tuning

  • DevOps engineers running Ansible playbooks or custom shell scripts that legitimately add or rotate SSH public keys as part of server provisioning, generating ProcessRollup2 events from python/ansible-playbook with authorized_keys in the command context
  • Security hardening scripts that invoke ssh-keygen to generate new host keys or audit existing authorized_keys files for expired or unauthorized entries as part of scheduled compliance checks
  • Automated deployment pipelines (Capistrano, Fabric, or custom CI/CD shell scripts) that use SCP or SSH key operations to configure service account access on freshly provisioned Linux build agents or deployment targets
Download portable Sigma rule (.yml)

Other platforms for T1098.004


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Append Adversary SSH Key to Root authorized_keys

    Expected signal: auditd SYSCALL records for open()/write() on /root/.ssh/authorized_keys if auditd watch is configured. syslog entries from auditd. DeviceFileEvents (if MDE for Linux deployed): FileCreated or FileModified event for FileName=authorized_keys with FolderPath=/root/.ssh. DeviceProcessEvents: Process Create for ssh-keygen and echo/bash with ProcessCommandLine containing 'authorized_keys'. Shell history entry in /root/.bash_history.

  2. Test 2Add SSH Key via curl Download

    Expected signal: DeviceProcessEvents: Process Create for curl with ProcessCommandLine containing 'authorized_keys'. DeviceNetworkEvents: Network connection from curl to 127.0.0.1:18080 (Sysmon Event ID 3 if Sysmon for Linux). DeviceFileEvents: FileModified on authorized_keys with InitiatingProcessFileName=bash or sh. Shell history entries for curl and python3 commands.

  3. Test 3Modify SSH Config to Enable Root Login and Key Auth

    Expected signal: auditd SYSCALL records for open()/write() on /etc/ssh/sshd_config if auditd watch is configured. DeviceFileEvents (if MDE for Linux): FileModified for FileName=sshd_config in FolderPath=/etc/ssh. DeviceProcessEvents: Process Create for sed with ProcessCommandLine containing 'sshd_config' and 'PermitRootLogin'. Shell history entries for sed and grep commands.

  4. Test 4Add SSH Key to Non-Root User Account

    Expected signal: DeviceFileEvents: FileCreated or FileModified for FileName=authorized_keys under /home/<user>/.ssh/. DeviceProcessEvents: Process Create for useradd, ssh-keygen, cat with relevant command lines. auditd records for file operations on the authorized_keys path. Shell history for all commands executed.

  5. Test 5Simulate ESXi authorized_keys Modification

    Expected signal: DeviceFileEvents: FileCreated for FileName=authorized_keys with FolderPath containing /etc/ssh/keys-. DeviceProcessEvents: Process Create for ssh-keygen and cat with ProcessCommandLine containing the ESXi key path. On actual ESXi systems, ESXCLI audit logs and /var/log/auth.log entries would also be generated.

Unlock Pro Content

Get the full detection package for T1098.004 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections