performing-second-order-sql-injection

Detect and exploit second-order SQL injection by tracing stored payloads to unsafe query execution points.

4|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/braydos-h/BreachPilot --skill performing-second-order-sql-injection-braydos-h
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performing-second-order-sql-injection
Source: https://github.com/braydos-h/BreachPilot/tree/main/skills/performing-second-order-sql-injection
Command: npx skills add https://github.com/braydos-h/BreachPilot --skill performing-second-order-sql-injection-braydos-h

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Second-order SQL injection hides where input is safely stored but later executed in an unsafe query, so standard injection testing misses it. This Skill provides a structured workflow to identify storage points, trigger points, and confirm exploitation paths in authorized assessments. ## Core Features & Use Cases - Storage and Trigger Mapping: Step-by-step methodology to identify where user input is stored and where it is later used in unsafe queries, with curl and SQLMap (--second-url) examples. - Blind Extraction Techniques: Covers boolean-based, time-based, and out-of-band DNS extraction for second-order scenarios. - Automated Analysis Agent: A Python script scans JSON database dumps for stored injection payloads, scans source code for dangerous query sinks, and correlates them into confirmed attack paths. - Use Case: During an authorized web application pentest, register a user with a SQL payload as the username, then trigger execution via the admin user-listing page to demonstrate data exfiltration and produce a remediation report. ## Quick Start Ask the agent to scan a JSON database dump and the application source directory for stored second-order SQL injection payloads and generate a findings report.

Frequently Asked Questions about performing-second-order-sql-injection

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

FAQPage Schema
How do I test for second-order SQL injection?▼

Second-order SQL injection testing requires identifying a storage point (like user registration) and a separate trigger point (like an admin panel) that uses the stored data in an unsafe query. Inject the payload at the storage point, then invoke the trigger function and observe the response for injection effects.

How to use SQLMap for second-order SQL injection?▼

Use SQLMap with the --second-url flag to specify the trigger endpoint, or --second-req with a saved request file for complex triggers. Mark the injectable parameter with an asterisk in the --data payload of the storage request.

What is the difference between first-order and second-order SQL injection?▼

First-order injection executes the payload immediately at the input point, while second-order injection stores the payload safely and executes it later in a different operation. Second-order attacks bypass input-time sanitization because developers trust data retrieved from the database.

Can blind techniques work for second-order SQL injection?▼

Yes, boolean-based, time-based (WAITFOR DELAY), and out-of-band DNS extraction all work for second-order injection. Store the blind payload, trigger execution, and observe response differences, timing delays, or collaborator interactions.

What input format does the analysis agent require?▼

The agent requires a JSON database dump mapping table names to row objects, plus a source code directory to scan for dangerous query patterns. Run it with --db-dump and --source flags to correlate stored payloads with code sinks into confirmed attack paths.