Skip to content

Oops, I Weaponized the Database Abusing AI Features in SQL S...#2359

Open
carlospolop wants to merge 1 commit into
masterfrom
update_Oops_I_Weaponized_the_Database_Abusing_AI_Featur_0a321beb8abfd0d4
Open

Oops, I Weaponized the Database Abusing AI Features in SQL S...#2359
carlospolop wants to merge 1 commit into
masterfrom
update_Oops_I_Weaponized_the_Database_Abusing_AI_Featur_0a321beb8abfd0d4

Conversation

@carlospolop

Copy link
Copy Markdown
Collaborator

🤖 Automated Content Update

This PR was automatically generated by the HackTricks News Bot based on a technical blog post.

📝 Source Information

🎯 Content Summary

Blog focus: SpecterOps demonstrates how Microsoft SQL Server 2025 AI-related features can be abused as database-native exfiltration, NTLM coercion, and command-and-control transport primitives. This is not presented as a CVE; the techniques abuse intended SQL Server 2025 functionality, especially sp_invoke_external_rest_endpoint, CREATE EXTERNAL MODEL, and AI_GENERATE_EMBEDDINGS.

PoC repository: all proof-of-concep...

🔧 Technical Details

Database-native HTTPS exfiltration: If an attacker has sufficient SQL Server privileges, sp_configure 'external rest endpoint enabled', 1 enables sp_invoke_external_rest_endpoint, allowing SQL Server to send arbitrary HTTPS requests. Sensitive rows can be serialized with FOR JSON AUTO and posted to an attacker server in payloads up to 100 MB. This moves exfiltration into the database engine and avoids noisier PowerShell or implant-based transfer paths.

File exfiltration through SQL Server: When SQL Server can read local files, OPENROWSET(BULK N'path', SINGLE_CLOB) can load file contents into a SQL variable. The attacker can then POST the file contents with sp_invoke_external_rest_endpoint. This makes MSSQL the network origin for file theft and can bypass monitoring focused on traditional endpoint processes.

Persistent table exfiltration with triggers: An at...

🤖 Agent Actions

Done.

Updated:

  • src/network-services-pentesting/pentesting-mssql-microsoft-sql-server/README.md

Added concise coverage for:

  • sp_invoke_external_rest_endpoint abuse
  • HTTPS table/file exfil via FOR JSON AUTO + OPENROWSET
  • trigger-based persistent exfiltration
  • CREATE EXTERNAL MODEL / AI_GENERATE_EMBEDDINGS
  • ONNX UNC-path NetNTLM coercion
  • embedding-shaped MSSQL C2
  • detection notes
  • references to SpecterOps, PoC repo, and Microsoft docs

Validation:

  • git diff --check passed
  • mdbook build couldn’t run because mdbook isn’t installed in this environment

This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.

@carlospolop

Copy link
Copy Markdown
Collaborator Author

🔗 Additional Context

Original Blog Post: https://specterops.io/blog/2026/06/10/oops-i-weaponized-the-database-abusing-ai-features-in-mssql-2025

Content Categories: Based on the analysis, this content was categorized under "Network Services Pentesting > 1433 - Pentesting MSSQL - Microsoft SQL Server > SQL Server 2025 AI feature abuse / sp_invoke_external_rest_endpoint / CREATE EXTERNAL MODEL".

Repository Maintenance:

  • MD Files Formatting: 977 files processed

Review Notes:

  • This content was automatically processed and may require human review for accuracy
  • Check that the placement within the repository structure is appropriate
  • Verify that all technical details are correct and up-to-date
  • All .md files have been checked for proper formatting (headers, includes, etc.)

Bot Version: HackTricks News Bot v1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant