Potential Machine Account Relay Attack via SMB
The rule identifies potential relay attacks against a machine account by detecting network share access events originating from a remote source IP but utilizing the target server's computer account, which may indicate an SMB relay attack.
This detection rule identifies potential SMB relay attacks targeting machine accounts in Windows environments. The attack involves an adversary intercepting and relaying authentication requests to gain unauthorized access to network resources. The detection focuses on analyzing Windows Security Event Logs for file share access events (event code 5145) where the source IP address is different from the target server’s IP address, but the user name matches the target server’s computer account (ends with “$”). This activity could indicate that an attacker is relaying SMB authentication requests from a compromised system to the target server, effectively impersonating the machine account. Detecting this behavior is crucial for identifying and mitigating potential lateral movement and credential access attempts within the network.
Attack Chain
- The attacker compromises a host within the network.
- The attacker initiates an SMB connection to a target server.
- The attacker intercepts the authentication request.
- The attacker relays the authentication request to another server using the target server’s machine account.
- The target server authenticates the relayed request, granting access to the attacker.
- The attacker gains unauthorized access to network shares and resources on the target server.
- The attacker attempts lateral movement to other systems within the domain.
- The attacker performs credential access activities, such as dumping credentials or accessing sensitive data.
Impact
Successful exploitation allows attackers to gain unauthorized access to network resources, potentially leading to lateral movement, data theft, or system compromise. A successful SMB relay attack can compromise critical systems and expose sensitive data, potentially impacting hundreds or thousands of systems within the domain. This can result in significant financial losses, reputational damage, and legal liabilities.
Recommendation
- Enable Audit Detailed File Share monitoring to generate the necessary event logs for detection (Setup instructions: https://ela.st/audit-detailed-file-share).
- Deploy the provided Sigma rule “Potential Machine Account Relay Attack via SMB” to your SIEM to detect suspicious SMB activity based on event code 5145 and abnormal source IP addresses.
- Investigate alerts generated by the Sigma rule by reviewing surrounding authentication events (event codes 4624 and 4625) to confirm the use of machine accounts from unexpected source IPs.
- Implement network segmentation and restrict SMB access between systems to limit the potential impact of SMB relay attacks.
- Enforce SMB signing or Extended Protection to prevent man-in-the-middle attacks.
- Monitor for related alerts as described in the transform.investigate sections, focusing on suspicious authentication, service creation, persistence, or credential access on the host.id.
Detection coverage 2
Potential Machine Account Relay Attack via SMB
highDetects potential relay attacks against a machine account by identifying network share access events coming from a remote source.ip but using the target server computer account.
SMB Share Access from Different Source IP Using Machine Account
mediumIdentifies SMB share access events where the source IP is different from the host IP, and the username ends with '$', indicating a potential machine account relay attack.
Detection queries are kept inside the platform. Get full rules →