Potential macOS SSH Brute Force Detected
This rule identifies a high number of inbound SSH login attempts on a macOS host within a short time window by monitoring the `sshd-keygen-wrapper` process, indicating potential brute-force attacks against exposed SSH services.
This detection rule identifies potential SSH brute-force attacks targeting macOS systems. It leverages Elastic Defend’s process monitoring capabilities to detect a high volume of inbound SSH login attempts within a short timeframe. The rule focuses on the sshd-keygen-wrapper process, which spawns for each SSH authentication attempt, whether successful or not. By monitoring the frequency of this process, the rule aims to identify potential brute-force or password spraying attacks against exposed SSH services, ultimately preventing unauthorized access to macOS systems. The rule does not detect key-based brute force activity.
Attack Chain
- An attacker identifies a macOS system with an exposed SSH service.
- The attacker initiates a brute-force attack against the SSH service, attempting multiple username and password combinations.
- Each failed SSH authentication attempt spawns a new
sshd-keygen-wrapperprocess on the target macOS system. - The detection rule monitors process creation events, specifically looking for the
sshd-keygen-wrapperprocess withlaunchdas its parent. - If the number of
sshd-keygen-wrapperprocess starts exceeds a defined threshold within a short time window, the rule triggers. - The attacker gains unauthorized access to the macOS system if valid credentials are found.
- Once inside, the attacker can perform actions such as data exfiltration, lateral movement, or installation of malware.
Impact
Successful SSH brute-force attacks can lead to unauthorized access to macOS systems, potentially impacting confidentiality, integrity, and availability. Attackers can gain access to sensitive data, install malware, or use the compromised system as a foothold for further attacks within the network. This can result in financial losses, reputational damage, and disruption of business operations.
Recommendation
- Deploy the Sigma rule
Detect High SSHD Keygen Wrapper Countto your SIEM and tune the threshold value based on your environment. - Enable Elastic Defend integration to capture process creation events on macOS endpoints, as required by the rule.
- Investigate alerts generated by the rule by reviewing SSH authentication logs for suspicious source IPs and targeted usernames.
- Implement IP blocking or rate limiting on the SSH service to mitigate further login attempts, as mentioned in the overview.
- Review and reset credentials for affected user accounts if compromise is confirmed, as suggested in the overview.
Detection coverage 2
Detect High SSHD Keygen Wrapper Count
mediumDetects a high number of sshd-keygen-wrapper processes spawning with launchd as the parent, indicating potential SSH brute-force attempts on macOS.
Detect SSH Brute Force via Repeated Failed Logins
mediumDetects a high number of failed SSH logins within a short time frame, indicating a potential brute-force attempt. Requires authentication logs.
Detection queries are available on the platform. Get full rules →