<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>SQL Server — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/sql-server/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/sql-server/feed.xml" rel="self" type="application/rss+xml"/><item><title>MSSQL xp_cmdshell Stored Procedure Abuse for Persistence</title><link>https://feed.craftedsignal.io/briefs/2024-01-mssql-xp-cmdshell-persistence/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-mssql-xp-cmdshell-persistence/</guid><description>Attackers may leverage the xp_cmdshell stored procedure in Microsoft SQL Server to execute arbitrary commands for privilege escalation and persistence, often bypassing default security configurations.</description><content:encoded><![CDATA[<p>The xp_cmdshell extended stored procedure in Microsoft SQL Server allows execution of operating system commands from within the SQL Server environment. Although disabled by default, its use can provide a direct pathway for attackers to run arbitrary commands on the underlying system with the privileges of the SQL Server service account. This account often has elevated privileges, allowing attackers to escalate their access and establish persistence mechanisms. This activity has been observed in intrusions where attackers seek to maintain control over compromised systems. Defenders should closely monitor for the enabling and use of xp_cmdshell, especially when combined with other suspicious activity.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a vulnerable SQL Server instance, possibly through SQL injection or compromised credentials.</li>
<li>The attacker attempts to enable the xp_cmdshell stored procedure using <code>sp_configure 'xp_cmdshell', 1; RECONFIGURE;</code>.</li>
<li>The attacker uses xp_cmdshell to execute reconnaissance commands, such as <code>xp_cmdshell 'whoami'</code> or <code>xp_cmdshell 'net user'</code> to gather information about the system and user context.</li>
<li>The attacker uses xp_cmdshell to download and execute a malicious payload (e.g., using <code>certutil.exe</code> to download a file).</li>
<li>The attacker establishes persistence by creating a scheduled task via xp_cmdshell executing the <code>schtasks</code> command. For example: <code>xp_cmdshell 'schtasks /create /tn &quot;Malicious Task&quot; /tr &quot;C:\\Windows\\Temp\\evil.exe&quot; /sc ONLOGON /ru SYSTEM'</code>.</li>
<li>The scheduled task executes upon system logon, providing persistent access for the attacker.</li>
<li>The attacker uses the persistent access to deploy additional tools or exfiltrate data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation enables attackers to execute arbitrary commands with elevated privileges on the SQL Server host. This can lead to data theft, system compromise, and the establishment of persistent backdoors. Lateral movement within the network is also possible, leveraging the compromised SQL Server as a pivot point. While specific victim counts and sectors are not provided, any organization using MSSQL Server is potentially vulnerable.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;Detect Suspicious xp_cmdshell Usage&rdquo; to your SIEM to detect attempts to use xp_cmdshell for command execution.</li>
<li>Disable the xp_cmdshell stored procedure unless absolutely necessary. If required, implement strict monitoring and auditing of its usage (reference: rule description).</li>
<li>Monitor for process creation events with a parent process of <code>sqlservr.exe</code>, specifically looking for command-line arguments indicative of exploitation (reference: Sigma rule).</li>
<li>Ensure SQL servers are not directly exposed to the internet and implement strict access controls, using allowlists to restrict connections to legitimate sources (reference: the &ldquo;Response and remediation&rdquo; section).</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">threat</category><category>persistence</category><category>sql-server</category><category>xp_cmdshell</category><category>windows</category></item><item><title>LSASS Memory Dump Creation Detection</title><link>https://feed.craftedsignal.io/briefs/2024-01-lsass-dump-creation/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-lsass-dump-creation/</guid><description>This rule identifies the creation of LSASS memory dump files, often indicative of credential access attempts using tools like Task Manager, SQLDumper, Dumpert, or AndrewSpecial, by monitoring for specific filenames and excluding legitimate dump locations.</description><content:encoded><![CDATA[<p>This detection rule identifies the creation of LSASS memory dump files on Windows systems, which is a common technique used by attackers to extract credentials. The rule focuses on specific filenames associated with LSASS dumps and tools used for creating these dumps, such as <code>lsass*.dmp</code>, <code>dumpert.dmp</code>, <code>Andrew.dmp</code>, <code>SQLDmpr*.mdmp</code>, and <code>Coredump.dmp</code>. The rule excludes known legitimate crash analysis paths and SQLDumper dump locations to reduce false positives. The rule aims to detect credential access attempts through trusted utilities such as Task Manager or SQLDumper, or known tooling such as Dumpert and AndrewSpecial. It is designed to work with data from Elastic Defend, Microsoft Defender XDR, SentinelOne Cloud Funnel, and Sysmon.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a Windows system (e.g., through phishing or exploiting a vulnerability).</li>
<li>The attacker executes a tool or utility to create a memory dump of the LSASS process. This can be done using built-in tools like Task Manager or SQLDumper, or third-party tools like Dumpert or AndrewSpecial.</li>
<li>The tool writes the LSASS memory dump to a file with a name matching a known pattern, such as <code>lsass.dmp</code>, <code>dumpert.dmp</code>, or <code>SQLDmpr0001.mdmp</code>.</li>
<li>The file is created in a location that is not a known legitimate crash dump location (e.g., not in <code>\Windows\System32\config\systemprofile\AppData\Local\CrashDumps\</code>).</li>
<li>The attacker may move, copy, or archive the dump file to avoid detection or to prepare it for exfiltration.</li>
<li>The attacker uses another tool, such as Mimikatz, to parse the LSASS memory dump and extract credentials.</li>
<li>The attacker uses the extracted credentials to move laterally to other systems or to access sensitive data.</li>
<li>The final objective is often to gain domain administrator privileges or to exfiltrate sensitive data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation and credential extraction can lead to complete domain compromise, unauthorized access to sensitive data, and significant financial or reputational damage. The impact is amplified if the compromised system is a domain controller, jump host, or privileged admin workstation. The rule is designed to detect the initial stage of credential access and prevent further damage.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable Sysmon FileCreate events (Event ID 11) to capture the creation of LSASS memory dump files.</li>
<li>Deploy the Sigma rule <code>LSASS Memory Dump Creation</code> to your SIEM to detect suspicious LSASS memory dump creation events and tune for your environment.</li>
<li>Investigate any alerts generated by the Sigma rule, focusing on the process executable, parent process, file path, and user context.</li>
<li>If a suspicious LSASS memory dump is found, isolate the affected host and begin credential hygiene for implicated accounts and systems.</li>
<li>Block known malicious tools like Dumpert and AndrewSpecial from running on your network.</li>
<li>Monitor for related credential-access, staging, privilege, or lateral-movement alerts for the same user or host.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>credential_access</category><category>lsass</category><category>memory_dump</category><category>windows</category></item></channel></rss>