Skip to content
← RegistryDossier · 6 steps · 5 edges

MSSQL linked-server crawl → cross-host RCE

Linked-server trust chains in MSSQL let a low-priv login execute as a higher-priv login on a remote SQL host — and pivot recursively across the estate.

Filed by AD Knowledge Base
§ Kill-chainDrag · zoom · scroll

§ Context

Assumed environment: attacker has any SQL login on one server. The estate has cross-database linked-server objects, frequently configured with cached credentials for service accounts.

§ Steps

  1. 01
    Dump LSASS for cached domain credsCredential Access
    T1003.001LSASS Memory
  2. 02
    Any SQL loginInitial Access
    T1078Valid Accounts
  3. 03
    Code exec as the SQL service accountExecution
    T1059Command and Scripting Interpreter
  4. 04
    Enumerate linked serversLateral Movement
    AD-MSSQL-LINKMSSQL Linked Server Crawl

    PowerUpSQL: Get-SQLServerLinkCrawl

  5. 05
    Enable xp_cmdshell on a privileged hopExecution
    AD-MSSQL-XPCMDMSSQL xp_cmdshell
  6. 06
    EXECUTE AS / openquery across linksPrivilege Escalation
    AD-MSSQL-IMPERSONATEMSSQL EXECUTE AS

§ References

§ Frequently asked

What is the "MSSQL linked-server crawl → cross-host RCE" attack path?
Linked-server trust chains in MSSQL let a low-priv login execute as a higher-priv login on a remote SQL host — and pivot recursively across the estate. It chains 6 steps drawn from real-world offensive-security techniques.
What starting position does this attack require?
The first step is Dump LSASS for cached domain creds (T1003.001) — a credential access primitive. Assumed environment: attacker has any SQL login on one server.
What is the final impact of this kill-chain?
The final step lands on EXECUTE AS / openquery across links (AD-MSSQL-IMPERSONATE), which falls under Privilege Escalation. From here, an operator typically pivots into post-exploitation or maintains persistence.
How can defenders detect or prevent this attack?
Detection and prevention vary per step. Refer to each linked MITRE ATT&CK entry under "References" — every technique on that page lists defensive controls, detection telemetry, and known threat-actor usage.

§ Related dossiers