SQL Brute Force Leads to BlueSky Ransomware

Two sentences: In December 2022, BlueSky ransomware entered a public-facing MSSQL Server via a brute-force attack on the sa account, leading to a network-wide encryption within about 32 minutes. The intruders used Cobalt Strike and Tor2Mine for post-exploitation, moved laterally to domain controllers, and dropped the BlueSky binary to encrypt files over SMB. Hashtags: #BlueSkyRansomware #CobaltStrike #Tor2Mine #MSSQL #PaperCutNG

Keypoints

  • The initial access occurred via a brute-force attack targeting the MSSQL sa account on an internet-facing server.
  • xp_cmdshell was enabled on the MSSQL server to issue OS commands, with PowerShell and base64-encoded content used to reach Cobalt Strike C2.
  • PowerShell sessions spawned, leading to SMB scans (SMBexec) and lateral movement toward domain controllers and file shares.
  • Tor2Mine was deployed, with a PowerShell script performing privilege checks, AV disablement, and miner deployment, as well as Windows persistence via scheduled tasks and services.
  • BlueSky ransomware (vmware.exe) was dropped around 30 minutes after initial access and spread network-wide via SMB (445), resulting in file renaming to .bluesky and a ransom note.
  • Threat actor activities involved Cobalt Strike, Tor2Mine, and later reuse of Tor2Mine artifacts in a PaperCut NG CVE-2023-27350-related intrusion.
  • Observed artifacts included numerous PowerShell scripts, LSASS memory access, process injection into winlogon, and Defender/MV disabling via Set-MpPreference.

MITRE Techniques

  • [T1110] Brute Force – Brute-forcing MSSQL sa account to gain initial access. [“The initial access occurred via a brute-force attack, where the threat actors mainly targeted the System Admin (‘sa’) account.”]
  • [T1078] Valid Accounts – Successful login after extensive failed attempts, enabling subsequent actions. [“During the intrusion, we observed over 10,000 failed attempts before successful login.”]
  • [T1059.003] Windows Command Shell – xp_cmdshell enabled to issue OS commands on the host. [“The ‘xp_cmdshell’ allows users with sysadmin privilege to execute shell commands on the host.”]
  • [T1059.001] PowerShell – Powershell-based commands (base64-encoded) loaded Cobalt Strike C2 and spawned additional shells. [“The threat actors first executed a PowerShell command on the SQL server. The command contained base64 encoded content, which, upon execution, established a connection to a Cobalt Strike command and control server.”]
  • [T1055] Process Injection – Winlogon process injection to establish persistence and spawn PowerShell/cmd. [“The injected process then spawned PowerShell and cmd to perform SMB scans and discovery using SMBexec.”]
  • [T1021.002] SMB/Windows Admin Shares – Lateral movement toward domain controllers/file shares using remote services. [“Moved laterally toward domain controllers and file shares using remote service creation.”]
  • [T1105] Ingress Tool Transfer – Download and execution of Tor2Mine/COBRA components (beacons, scripts). [“The first PowerShell script executed a command to download a Cobalt Strike beacon.”]
  • [T1486] Data Encrypted for Impact – BlueSky ransomware encrypts network devices via SMB. [“The BlueSky ransomware binary named vmware.exe was dropped on the beachhead, which upon execution, resulted in network wide ransomware.”]
  • [T1053.005] Scheduled Task – Persistence via numerous scheduled tasks (16 tasks in checking.ps1). [“In the script checking.ps1 the threat actor created 16 different tasks on the hosts where Tor2Mine was deployed.”]
  • [T1543.003] Windows Service – Persistence via Windows services referencing Tor2Mine miner and related components. [“The function also creates multiple scheduled tasks and services which have references to Tor2Mine miner java.exe.”]
  • [T1112] Modify Registry – Registry modifications observed as part of defense evasion. [“registry modifications and service disabling.”]
  • [T1562.001] Disable or Modify Tools – Stopping AV (MalwareBytes, Sophos, Windows Defender). [“StopAV, where it tries to disable antivirus solutions.”]
  • [T1033] System Owner/User Discovery – Whoami checks to identify the active user. [“The threat actor ran whoami.exe to identify the user context.”]
  • [T1003.001] LSASS Memory – Tor2Mine accesses LSASS memory. [“Tor2Mine uses LSASS memory space access.”]
  • [T1059.004] Command and Scripting Interpreter – Additional PowerShell-based module behaviors (e.g., PrivTrue/PrivFalse branches). [“PrivTrue() and PrivFalse() paths describe privileged vs non-privileged execution routes.”]

Indicators of Compromise

  • [IP address] – 83.97.20.81 (Tor2Mine C2 server), 5.188.86.237 (Cobalt Strike C2)
  • [Domain] – onion.sh (used in Tor2Mine/Tor2Mine-related infrastructure)
  • [File hash] – vmware.exe SHA256: d4f4069b1c40a5b27ba0bc15c09dceb7035d054a022bb5d558850edfba0b9534
  • [File hash] – java.exe SHA256: 74b6d14e35ff51fe47e169e76b4732b9f157cd7e537a2ca587c58dbdb15c624f
  • [File hash] – WinRing0x64.sys SHA256: 11bd2c9f9e2397c9a16e0990e4ed2cf0679498fe0fd418a3dfdac60b5c160ee5
  • [File hash] – del.ps1 SHA256: 35b95496b243541d5ad3667f4aabe2ed00066ba8b69b82f10dd1186872ce4be2
  • [File hash] – checking.ps1 SHA256: f955eeb3a464685eaac96744964134e49e849a03fc910454faaff2109c378b0b
  • [File hash] – Invoke-PowerDump.ps1 SHA256: 3b463c94b52414cfaad61ecdac64ca84eaea1ab4be69f75834aaa7701ab5e7d0
  • [Port] – 445 (SMB) used for network encryption/spread

Read more: https://thedfirreport.com/2023/12/04/sql-brute-force-leads-to-bluesky-ransomware/