Huntress Details Two-Day MSSQL Attempt to Deploy a Web Shell

· Original article ↗

Summary

Huntress reconstructed two days of attempts to use MSSQL access to deploy a PHP reverse shell on a Windows server. Windows Defender detected and quarantined the files, and no functioning shell was observed.

Key points

  • The activity targeted a Windows Server 2019 Essentials system and used the MSSQL 'sa' account; Huntress assessed that the actor likely had access to the credentials before the observed attempts.
  • The actor enabled MSSQL's xp_cmdshell procedure, then used PowerShell via sqlservr.exe and certutil.exe while attempting to create a web-accessible reverse shell.
  • The attempted PHP files, maa.php and fata.php, were repeatedly detected and quarantined by Windows Defender.
  • The activity spanned about two and a quarter hours across two days. Huntress observed no successful reverse-shell deployment; a day-one request for maa.php returned 404, and no requests for either file appeared in day-two web logs.
  • Huntress could not determine the source of the MSSQL logins because the server recorded failed logins but not successful ones.
  • Huntress recommends inventorying externally accessible systems, applications, and services, and removing unneeded services or keeping required ones maintained and patched.

Article Details

Attack Vectors
  • The actor apparently used previously obtained access to an MSSQL instance and attempted to use the 'sa' account.
  • The actor enabled the xp_cmdshell stored procedure, then ran PowerShell scripts and commands through sqlservr.exe.
  • The actor used certutil.exe to decode files and attempted to place PHP reverse-shell files in an accessible web-server directory.
  • The reverse-shell attempts did not succeed; Windows Defender detected and quarantined the files.
Defensive Notes
  • Maintain an inventory of systems, applications, and services accessible from the internet.
  • Remove services and applications that are not needed for business operations; otherwise, include them in the inventory and keep them updated and patched.
  • Huntress reported process and endpoint detections, and Windows Defender detected and quarantined the attempted reverse-shell files.

Indicators of compromise

TypeIndicatorContext
HOSTNAME0[.]tcp[.]eu[.]ngrok[.]ioHost used as the reverse-shell connection target in the attempted payloads.
IPV441[.]102[.]167[.]182Source IP for a GET request for maa.php associated with the attempted reverse-shell activity.
URLhxxps[:]//github[.]com/hightidAOaa/azdaz/raw/main/fata.phpSpecific GitHub-hosted URL used in an attempt to download a PHP file containing reverse-shell code.
URLhxxps[:]//raw[.]githubusercontent[.]com/hightidAOaa/azdaz/main/maa.phpSpecific GitHub-hosted URL used in an attempt to download a PHP reverse shell.

MITRE ATT&CK

Vendors

Products

Tools

Related Articles