Article Details
Scrape Timestamp (UTC): 2023-10-04 14:57:18.828
Original Article Text
Click to Toggle View
Microsoft: Hackers target Azure cloud VMs via breached SQL servers. Hackers have been observed trying to breach cloud environments through Microsoft SQL Servers vulnerable to SQL injection. Microsoft's security researchers report that this lateral movement technique has been previously seen in attacks on other services like VMs and Kubernetes clusters. However, this is the first time they have seen SQL Servers leveraged for this purpose. Attack chain The attacks Microsoft observed start with exploiting an SQL injection vulnerability in an application in the target's environment. This enables the threat actors to gain access to the SQL Server instance hosted on Azure Virtual Machine with elevated permissions to execute SQL commands and extract valuable data. This includes data on databases, table names, schemas, database versions, network configuration, and read/write/delete permissions. If the compromised application has elevated permissions, the attackers may activate the 'xp_cmdshell' command to run operating system (OS) commands via SQL, giving them a shell in the host. The commands executed by the attackers at this stage include the following: Using a legitimate service for data exfiltration makes the activity less likely to appear suspicious or raise any flags by security products, allowing the attackers to discreetly steal data from the host. Next, the attackers attempted to exploit the cloud identity of the SQL Server instance to access the IMDS (Instant Metadata Service) and obtain the cloud identity access key. In Azure, resources are often assigned managed identities for authentication with other cloud resources and services. If the attackers hold that token, they can use it to access any cloud resource the identity has permissions to. Microsoft says the attackers failed to successfully leverage this technique due to errors, but the approach remains valid and constitutes a dire threat to organizations. Finally, the threat actors deleted any downloaded scripts and wiped temporary database modifications to erase traces of the attack. Defending tips Microsoft suggests using Defender for Cloud and Defender for Endpoint to catch SQL injections and suspicious SQLCMD activity, both employed in the observed attack. To mitigate the threat, Microsoft recommends applying the principle of least privilege when granting user permissions, which always adds friction in lateral movement attempts. Hunting queries for 365 Defender and Sentinel are provided in the appendix of Microsoft's report.
Daily Brief Summary
Hackers are exploiting Microsoft SQL Servers vulnerable to SQL injection in an attempt to breach Azure cloud environments.
Microsoft’s security researchers have observed an attack chain beginning with exploiting an SQL injection vulnerability, allowing threat actors to gain access to a Microsoft Azure Virtual Machine-hosted SQL Server instance.
Once access is gained, attackers can access databases, schemas, network configurations, and permissions, effectively giving them a shell in the host if the compromised app has elevated permissions.
Attackers attempted to acquire the cloud identity access key from the SQL Server instance to access any cloud resource the identity has permissions to. Although this attempt failed due to errors, the method itself continues to pose a significant threat.
Microsoft’s security recommendations include using the Defender for Cloud and Defender for Endpoint protections to catch SQL injections and suspicious SQLCMD activity, and applying the principle of least privilege when granting user permissions to add obstacles to lateral movement attempts.