Potential Credential Access via MSBuild Loading Credential Management DLLs
The detection rule identifies a potential credential access attempt via the trusted developer utility MSBuild by detecting instances where it loads DLLs associated with Windows credential management, specifically vaultcli.dll or SAMLib.DLL, which is often used for credential dumping.
This detection rule identifies potential credential access attempts leveraging the Microsoft Build Engine (MSBuild). Attackers may abuse MSBuild, a legitimate developer tool, to load malicious DLLs related to Windows credential management, such as vaultcli.dll or SAMLib.dll. This technique enables credential dumping by a trusted Windows utility, making it harder to detect. The rule focuses on detecting the loading of these specific DLLs by MSBuild processes. The rule relies on data from Elastic Defend and Sysmon logs.
Attack Chain
- Attacker gains initial access to the target system (e.g., via phishing or exploiting a vulnerability).
- Attacker places a malicious
.csprojfile or a DLL designed to load credential management DLLs on the system. - The attacker executes
MSBuild.exeto process the malicious project file. MSBuild.exeloads the attacker-controlled DLL.- The attacker-controlled DLL loads either
vaultcli.dllorSAMLib.dll. - The loaded DLLs are used to dump credentials from the system.
- The attacker accesses the dumped credentials.
- The attacker uses the compromised credentials for lateral movement or data exfiltration.
Impact
A successful attack can lead to the compromise of sensitive credentials stored on the affected system. This can allow attackers to move laterally within the network, access confidential data, and potentially compromise entire domains. The impact ranges from data breaches to complete system compromise, depending on the privileges of the compromised accounts.
Recommendation
- Deploy the Sigma rule
MSBuild Loads Credential Management DLLto your SIEM, tuned for your specific environment, to detect instances of MSBuild loadingvaultcli.dllorSAMLib.dll. - Enable Sysmon event ID 7 (Image Loaded) logging with the appropriate configurations to capture DLL loading events.
- Investigate any instances of MSBuild loading
vaultcli.dllorSAMLib.dllfrom unusual or unexpected locations using the guidance in the rule note.
Detection coverage 2
MSBuild Loads Credential Management DLL
highDetects instances of MSBuild loading vaultcli.dll or SAMLib.dll, which is often associated with credential dumping.
MSBuild Process Creation
mediumDetects the execution of MSBuild, potentially used for malicious purposes such as loading malicious DLLs.
Detection queries are kept inside the platform. Get full rules →