MCADDF

[MISCONFIG-011]: Default SSH Keys in Use

Metadata

| Attribute | Details | |—|—| | Technique ID | MISCONFIG-011 | | MITRE ATT&CK v18.1 | T1098.004 – Account Manipulation: SSH Authorized Keys (related), T1530 – Data from Cloud Storage Object (for stolen keys) | | Tactic | Persistence / Initial Access | | Platforms | Entra ID / Azure (Linux VMs, appliances, containers, IoT) | | Severity | High / Critical (depending on exposure) | | Technique Status | ACTIVE | | Last Verified | 2026-01-10 | | Affected Versions | Azure Linux VMs, virtual appliances, and images using shared or default SSH host or authorized keys | | Patched In | N/A – depends on image and configuration; mitigated via unique key provisioning and Entra-based SSH | | Author | SERVTEPArtur Pchelnikau |


2. EXECUTIVE SUMMARY

Operational Risk

Compliance Mappings

| Framework | Control / ID | Description | |—|—|—| | CIS Benchmark | Azure Foundations controls on SSH, network access | Unique credentials; no shared or default keys. | | DISA STIG | RHEL/Unix STIG – default accounts/keys | Disallow vendor-supplied default auth material. | | CISA SCuBA | Identity and access hardening | Unique strong credentials and key hygiene. | | NIST 800-53 | IA-2, IA-5, AC-2 | Identification and authentication; management of authenticators. | | GDPR | Art. 32 | Appropriate security including access control to personal data. | | DORA | Art. 9 | Access control and authentication for critical financial infrastructure. | | NIS2 | Art. 21 | Secure authentication and privileged access controls. | | ISO 27001 | A.5.17, A.8.2 | Management of authentication information and access rights. | | ISO 27005 | Risk Scenario | Shared credentials enabling undetected compromise of many assets.

3. TECHNICAL PREREQUISITES

Supported Versions:

4. ENVIRONMENTAL RECONNAISSANCE

On-VM Key Fingerprint Recon

# List SSH host key fingerprints
sudo ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
sudo ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub 2>/dev/null || true
sudo ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub 2>/dev/null || true

# List authorized keys for privileged users
sudo find /root /home -maxdepth 3 -name "authorized_keys" -print -exec cat {} \;

What to Look For:

Azure-Side Recon (Policy and VM Creation)

Check whether:

5. DETAILED EXECUTION METHODS AND THEIRS STEPS

METHOD 1 – Exploiting Shared or Default Authorized Keys

Supported Versions: All Linux VMs.

Step 1: Reuse a Known Private Key

Objective: Connect to multiple VMs that share the same public key.

Command:

ssh -i id_rsa_default azureuser@vm1.contoso.cloud
ssh -i id_rsa_default admin@vm2.contoso.cloud

Expected Output:

What This Means:

OpSec & Evasion:

METHOD 2 – Vendor Default Keys in Virtual Appliances

Supported Versions: Marketplace or third-party virtual appliances.

Step 1: Identify Appliance Families with Known Issues

Step 2: Connect Using Published Private Keys

6. ATTACK SIMULATION & VERIFICATION (Atomic Red Team)

Use Atomic Red Team for T1098.004 (Account Manipulation – SSH Authorized Keys) to simulate adding and abusing SSH keys in authorized_keys. While this does not specifically test default keys, it demonstrates the persistence vector.

7. TOOLS & COMMANDS REFERENCE

8. SPLUNK DETECTION RULES

Rule 1: Unusual SSH Key-Based Logins

9. MICROSOFT SENTINEL DETECTION

10. WINDOWS EVENT LOG MONITORING

Not directly applicable (Linux-focused) but Windows-based SSH servers can also use default keys; monitor for new authorized_keys and OpenSSH server configuration on Windows if used.

11. SYSMON DETECTION PATTERNS

For Windows OpenSSH servers:

12. MICROSOFT DEFENDER FOR CLOUD

13. MICROSOFT PURVIEW (UNIFIED AUDIT LOG)

Not directly applicable to SSH itself, but use Purview to monitor admin actions that deploy VMs, modify access policies, or add privileged identities that can use SSH.

14. DEFENSIVE MITIGATIONS

Priority 1: CRITICAL

Priority 2: HIGH

Validation Command (Verify Fix)

# On each VM
sudo ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub

# Compare fingerprints across VMs – they must be unique per host.

15. DETECTION & INCIDENT RESPONSE

Indicators of Compromise (IOCs)

Forensic Artifacts

Response Procedures

  1. Urgently rotate all default or shared keys, starting with externally exposed hosts.
  2. Invalidate and remove any vendor support keys unless contractually required and tightly controlled.
  3. Conduct compromise assessment focusing on SSH sessions while default keys were in use.
Step Phase Technique Description
1 Initial Access Exposed SSH endpoint Internet-accessible SSH on Azure VM or appliance.
2 Credential Access Theft or discovery of default key Attacker obtains private key (for example, from vendor advisory or leaked image).
3 Current Step MISCONFIG-011 – Default SSH Keys in Use Shared keys allow broad access across many systems.
4 Persistence Add own keys Attacker drops additional authorized_keys for long term access.
5 Lateral Movement & Impact Pivot and data theft Use SSH to pivot, exfiltrate, and deploy malware.

17. REAL-WORLD EXAMPLES

Example 1: Cisco Virtual Appliances Default SSH Keys (CVE-2015-4216/4217)

Example 2: Cloud Images with Cloned Host Keys