haryy985/yunkun-console-preview/sqli-sql-injection
Claude Code and agent skill by haryy985/yunkun-console-preview
- community
Checking that the SKILL.md file is still in the repository.
SQL injection playbook. Use when input reaches SQL queries, authentication logic, sorting, filtering, reporting, or DB-specific blind and out-of-band execution paths.
Install
npx vskill@latest install haryy985/yunkun-console-preview/sqli-sql-injectionSKILL.md
SKILL: SQL Injection — Expert Attack Playbook
AI LOAD INSTRUCTION: Advanced SQLi techniques. Assumes basic UNION/error/boolean-blind fundamentals known. Focuses on: per-database exploitation, out-of-band exfiltration, second-order injection, parameterized query bypass scenarios, filter evasion, and escalation to OS. For real-world CVE cases, SMB/DNS OOB exfiltration, INSERT/UPDATE injection patterns, and framework-specific exploitation (ThinkPHP, Django GIS), load the companion SCENARIOS.md.
0. QUICK START
Extended Scenarios
Also load SCENARIOS.md when you need:
- SMB out-of-band exfiltration via
LOAD_FILE+ UNC paths (Windows MySQL) - KEY injection / URI injection / non-parameter injection points
- INSERT/DELETE/UPDATE statement injection differences
- ThinkPHP5 array key injection (
updatexmlerror-based) - Django GIS Oracle
utl_inaddr.get_host_nameCVE - ORDER BY / LIMIT injection techniques
如果只是刚确认可疑 SQL sink,不要先加载额外的 payload skill,直接在这里完成第一轮验证。
First-pass payload families
| Situation | Start With | Why | |
|---|---|---|---|
| Login or boolean branch | ' or 1=1-- | Fast signal on auth or conditional checks | |
| Numeric parameter | 1 or 1=1 | Avoid quote dependency | |
| ORDER BY / sorting | 1,2,3 then 1 desc-- | Good for structural probing | |
| Visible SQL errors | ' then DBMS-specific error probes | Error text gives DBMS clues | |
| No visible output | time-based payloads | Stable fallback for blind targets | |
| Heavy filtering / WAF | polyglot or whitespace-free variants | Expands parser confusion surface |
Small, stable first-pass set
DBMS routing hints
| Clue | Likely DBMS | Good Next Move | |
|---|---|---|---|
You have an error in your SQL syntax | MySQL | try SLEEP() and @@version | |
Microsoft OLE DB Provider | MSSQL | try WAITFOR DELAY | |
PG:: / PostgreSQL | PostgreSQL | try pg_sleep() | |
ORA- prefix | Oracle | pivot to out-of-band or XML features | |
| SQLite errors, local apps | SQLite | focus on boolean/UNION and file-backed behavior |
1. DETECTION — SUBTLE INDICATORS
Most SQLi is found by behavioral differences, not errors:
| Signal | Meaning | |
|---|---|---|
Page loads differently with ' vs '' | String context injection point | |
Numeric: 1 vs 1-1 vs 2-1 returns same | Arithmetic evaluated | |
1=1 vs 1=2 in condition changes result | Boolean-based injection | |
| SELECT with ORDER BY N: column count enumeration | UNION prep | |
Time delay: '; WAITFOR DELAY '0:0:5'-- | Blind/time-based | |
500 error on ', 200 on '' | Unhandled exception = SQLi | |
| Different HTTP response size | Boolean blind indicator |
Critical: test in ALL parameter types — URL query, POST body, JSON fields, XML values, HTTP headers (X-Forwarded-For, User-Agent, Referer, Cookie values).
2. DATABASE FINGERPRINTING
Error-based fingerprint: inject ' and read error message format. MySQL errors differ from Oracle/MSSQL.
3. UNION-BASED DATA EXTRACTION
Column count determination:
Column type detection (NULL is safest):
Database-specific string concat (required when column accepts only int):
4. BLIND INJECTION — INFERENCE TECHNIQUES
Boolean Blind (conditional response difference)
Time-Based Blind (no response difference)
5. OUT-OF-BAND (OOB) EXFILTRATION — CRITICAL
Use when blind injection has no time/boolean indicator, or when batch queries can't return data inline.
MSSQL — OpenRowSet (requires SQLOLEDB, outbound TCP)
Use port 80 or 443 to bypass firewall egress restrictions.
Oracle — UTL_HTTP (HTTP GET with data in URL path)
Oracle's UTL_HTTP supports proxy — can exfil through corporate proxy!
Oracle — UTL_INADDR (DNS exfiltration — often bypasses HTTP restrictions)
Attacker sees: HASH_VALUE.attacker.com DNS query → read password hash.
Oracle — UTL_SMTP / UTL_TCP
MySQL — DNS via LOAD_FILE (Windows + UNC path)
MySQL — INTO OUTFILE (in-band filesystem write)
6. ESCALATION — OS COMMAND EXECUTION
MSSQL — xp_cmdshell (if enabled, or if sysadmin)
MySQL — UDF (User Defined Functions)
Write malicious shared library to filesystem, then CREATE FUNCTION ... SONAME.
Oracle — Java Stored Procedures
7. SECOND-ORDER INJECTION
Concept: User input is stored safely (parameterized), but later retrieved as trusted data and concatenated into a new query without re-sanitization.
Example attack flow:
- Register username:
admin'-- - Application safely inserts this into users table
- Password change function fetches username from session (trusted!) and builds:
``sql UPDATE users SET password='newpass' WHERE username='admin'--' ``
- Comment strips the condition → updates admin's password
Key insight: Any application function that reads stored data and uses it in a new DB query is a second-order candidate. Review: password change, profile update, admin action on user data.
8. PARAMETERIZED QUERY BYPASS SCENARIOS
Parameterized queries do NOT prevent SQLi when:
- Table/column names are user-controlled — params can't parameterize identifiers:
``sql -- UNSAFE even with params: "SELECT * FROM " + tableName + " WHERE id = ?" `` Mitigation: whitelist-validate table/column names.
- Partial parameterization — some fields concatenated, others parameterized:
``sql "SELECT * FROM users WHERE type='" + userType + "' AND id=?" -- userType not parameterized → injection ``
- IN clause with dynamic count (common mistake in ORMs):
``sql SELECT * FROM items WHERE id IN (1, 2, ?) -- only last is parameterized ``
- Second-order — data retrieved from DB assumed clean, re-used in query without params.
9. FILTER EVASION TECHNIQUES
Comment Injection (break keywords)
Case Variation
URL Encoding
Whitespace Alternatives
String Construction (bypass literal-string detection)
10. DATABASE METADATA EXTRACTION
MySQL
MSSQL
Oracle
PostgreSQL
11. STORED PROCEDURE ABUSE
MSSQL — sp_OAMethod (COM automation)
Oracle — DBMS_LDAP (outbound LDAP = DNS exfil)
12. QUICK REFERENCE — INJECTION TEST STRINGS
13. WAF BYPASS MATRIX
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 70 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsource/skills/yunkun-security-workflow/references/skills/specialized/sqli-sql-injection/SKILL.md
Popularity
- Repository stars
- 131
- Repository forks
- 7
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/haryy985/yunkun-console-preview/sqli-sql-injection)