sql-injection-stacked

Exploit stacked query and second-order SQL injection across MSSQL, PostgreSQL, MySQL, and Oracle.

253|37|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/blacklanternsecurity/red-run --skill sql-injection-stacked
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-injection-stacked
Source: https://github.com/blacklanternsecurity/red-run/tree/main/skills/web/sql-injection-stacked
Command: npx skills add https://github.com/blacklanternsecurity/red-run --skill sql-injection-stacked

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps penetration testers exploit stacked query SQL injection and second-order injection vulnerabilities to gain unauthorized access, manipulate data, and execute commands on target systems.

Core Features & Use Cases

  • Stacked Query Exploitation: Execute multiple SQL statements via semicolons for data manipulation, command execution (e.g., xp_cmdshell), and file operations across various database systems (MSSQL, PostgreSQL, Oracle).
  • Second-Order Injection: Exploit vulnerabilities where input is stored and later used unsafely in a different query context.
  • Database Support: Provides specific payloads and techniques tailored for MSSQL, PostgreSQL, MySQL, and Oracle.
  • Use Case: A penetration tester identifies a SQL injection vulnerability and uses this Skill to execute xp_cmdshell on an MSSQL server to gain OS-level access, or to write a webshell to the server.

Quick Start

Use the sql-injection-stacked skill to attempt to execute 'whoami' on the target database.

Frequently Asked Questions about sql-injection-stacked

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I execute OS commands via SQL injection using stacked queries?

Stacked query SQL injection enables OS command execution by appending additional SQL statements via semicolons. This Skill facilitates using DBMS-specific functions like xp_cmdshell in MSSQL or COPY TO PROGRAM in PostgreSQL to achieve remote command execution.

What is second-order SQL injection and how is it exploited?

Second-order SQL injection occurs when malicious input is stored by the database and later used unsafely in a different query context. This Skill guides penetration testers in identifying and exploiting these delayed execution vulnerabilities across multiple database systems.

Does this SQL injection exploitation approach support PostgreSQL and Oracle?

Yes, this Skill supports exploiting stacked query SQL injection across MSSQL, PostgreSQL, MySQL, and Oracle. It provides tailored payloads and specific techniques for command execution, data manipulation, and file operations within each supported DBMS environment.

How to write a webshell to a server through stacked query SQL injection?

You can write a webshell by leveraging stacked query SQL injection to perform file operations on the target system. This Skill guides penetration testers in using DBMS-specific functions to manipulate files and deploy webshells for persistent access.

What is the difference between stacked queries and standard SQL injection?

Standard SQL injection typically modifies an existing query, while stacked queries append entirely new statements using semicolons. This allows for broader data manipulation and command execution beyond the original query context, enabling operations like invoking xp_cmdshell.