← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux SSH authorized_keys Backdoor Dataset

This hunt uses a simulated Linux auditd dataset (linux_ssh_authkeys_backdoor_2022-05-21T220000.json) capturing T1098.004: Account Manipulation - SSH Authorized Keys, where an adversary appends their own public key to a user's ~/.ssh/authorized_keys file, establishing password-free, MFA-bypassing persistent access.

Step 1: Hypothesis Formation

Hypothesis: An authorized_keys file is modified (append or overwrite) outside of a documented key-rotation/onboarding process, and the newly added key is subsequently used for a successful SSH login from an IP address not previously associated with that user account. Indicators:

Null Hypothesis: A system administrator legitimately rotated or added an SSH key as part of routine key management. Invalidate via ticket/change-management cross-check and by confirming the new key's fingerprint is not registered in the central key inventory.

Rationale: SSH key-based backdoors are quiet and durable - they don't trigger password-based brute-force alerts and often survive password resets; this hunt validates file-integrity monitoring on authorized_keys combined with login-source correlation as a detection strategy.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (6 shown) confirm an unauthorized key was appended to deploy_svc's authorized_keys file and used for login from a new IP within minutes.

Timestamp (UTC)HostAccountEventIOC/Why Suspicious?
2022-05-21 22:04:11jump01.proddeploy_svcauditd WRITE: ~/.ssh/authorized_keys (append)Write IOC: file modified outside of any scheduled deployment window per the change calendar.
2022-05-21 22:04:11jump01.proddeploy_svcNew key: ssh-rsa AAAA...9fQ2 attacker@kaliFingerprint IOC: key comment attacker@kali and fingerprint absent from the central IAM key inventory - no matching onboarding/rotation ticket.
2022-05-21 22:06:33jump01.proddeploy_svcsshd: Accepted publickey for deploy_svc from 103.224.182.51New-source IOC: successful login using the newly added key, from an IP never before associated with this account in 90 days of history.
2022-05-21 22:07:02jump01.proddeploy_svcShell command: sudo -lImmediate privilege-enumeration command after login - reconnaissance behavior atypical of a legitimate deploy job.
-jump01.prod(IAM check)N/AProcess-gap IOC: existing legitimate keys for deploy_svc are all tagged with ticket IDs in the IAM inventory; the new key has none.
2022-05-21 23:15:00jump01.proddeploy_svcsshd: second login from 103.224.182.51Return visit ~1 hour later using the same backdoor key - confirms durable, repeatable access rather than a one-off test.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an unauthorized SSH key was backdoored into a service account's authorized_keys file and used for repeated unauthorized access!