Skip to main content
Glama
SlanyCukr

Bug Bounty MCP Server

by SlanyCukr

sqlmap_scan

Detect SQL injection vulnerabilities by scanning target URLs with SQLMap, providing enhanced logging for security testing in bug bounty workflows.

Instructions

Execute SQLMap for SQL injection testing with enhanced logging.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
additional_argsNo
dataNo
urlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary MCP handler and registration for the 'sqlmap_scan' tool. Proxies parameters to the REST API endpoint '/api/sqlmap' via BugBountyAPIClient.
    def sqlmap_scan(
        url: str, data: str = "", additional_args: str = ""
    ) -> dict[str, Any]:
        """Execute SQLMap for SQL injection testing with enhanced logging."""
        data_payload = {"url": url, "data": data, "additional_args": additional_args}
    
        logger.info(f"💉 Starting SQLMap SQL injection testing on {url}")
        result = api_client.safe_post("api/sqlmap", data_payload)
    
        if result.get("success"):
            logger.info(f"✅ SQLMap scan completed on {url}")
        else:
            logger.error("❌ SQLMap scan failed")
    
        return result
  • Backend REST API handler for SQLMap execution. Extracts params, builds command, executes via subprocess, parses output into structured findings.
    @tool(required_fields=["url"])
    def execute_sqlmap():
        """Execute SQLMap for SQL injection testing."""
        data = request.get_json()
        params = extract_sqlmap_params(data)
    
        logger.info(f"Executing SQLMap on {params['url']}")
    
        started_at = datetime.now()
        command = build_sqlmap_command(params)
        execution_result = execute_command(command, timeout=900)
        ended_at = datetime.now()
    
        return parse_sqlmap_result(execution_result, params, command, started_at, ended_at)
  • Helper to extract and normalize SQLMap parameters from incoming JSON request data.
    def extract_sqlmap_params(data):
        """Extract sqlmap parameters from request data."""
        params = {
            "url": data["url"],
            "data": data.get("data", ""),
            "method": data.get("method", "GET"),
            "headers": data.get("headers", ""),
            "cookies": data.get("cookies", ""),
            "level": data.get("level", 1),
            "risk": data.get("risk", 1),
            "technique": data.get("technique"),
            "dbms": data.get("dbms"),
            "threads": data.get("threads", 1),
            "delay": data.get("delay", 0),
            "timeout": data.get("timeout", 30),
            "retries": data.get("retries", 3),
            "random_agent": data.get("random_agent", True),
            "proxy": data.get("proxy", ""),
            "tor": data.get("tor", False),
            "tamper": data.get("tamper", ""),
            "additional_args": data.get("additional_args", ""),
        }
    
        return params
  • Helper function to construct the full sqlmap command-line string based on extracted parameters.
    def build_sqlmap_command(params):
        """Build sqlmap command from parameters."""
        cmd_parts = ["sqlmap", "-u", params["url"]]
    
        if params["data"]:
            cmd_parts.extend(["--data", params["data"]])
        if params["method"] and params["method"] != "GET":
            cmd_parts.extend(["--method", params["method"]])
    
        if params["headers"]:
            cmd_parts.extend(["--headers", params["headers"]])
        if params["cookies"]:
            cmd_parts.extend(["--cookie", params["cookies"]])
    
        if params["level"] != 1:
            cmd_parts.extend(["--level", str(params["level"])])
        if params["risk"] != 1:
            cmd_parts.extend(["--risk", str(params["risk"])])
        if params["technique"]:
            cmd_parts.extend(["--technique", params["technique"]])
        if params["dbms"]:
            cmd_parts.extend(["--dbms", params["dbms"]])
    
        if params["threads"] > 1:
            cmd_parts.extend(["--threads", str(params["threads"])])
        if params["delay"] > 0:
            cmd_parts.extend(["--delay", str(params["delay"])])
        if params["timeout"] != 30:
            cmd_parts.extend(["--timeout", str(params["timeout"])])
        if params["retries"] != 3:
            cmd_parts.extend(["--retries", str(params["retries"])])
    
        if params["random_agent"]:
            cmd_parts.append("--random-agent")
        if params["proxy"]:
            cmd_parts.extend(["--proxy", params["proxy"]])
        if params["tor"]:
            cmd_parts.append("--tor")
        if params["tamper"]:
            cmd_parts.extend(["--tamper", params["tamper"]])
    
        cmd_parts.append("--batch")
    
        if params["additional_args"]:
            cmd_parts.extend(params["additional_args"].split())
    
        return " ".join(cmd_parts)
  • Helper to parse raw SQLMap stdout output into structured vulnerability findings or scan results.
    def parse_sqlmap_output(raw_output: str, target_url: str) -> list[dict]:
        """Parse sqlmap text output format for basic vulnerability detection."""
        findings = []
    
        if not raw_output:
            return findings
    
        lines = raw_output.split("\n")
        injectable_found = False
    
        injection_indicators = [
            "is vulnerable",
            "injection point",
            "injectable",
            "vulnerable to sql injection",
            "sqli vulnerability",
            "appears to be injectable",
            "injection found",
            "successfully exploited",
            "payload was successful",
        ]
    
        for line in lines:
            line = line.strip()
            if not line:
                continue
    
            line_lower = line.lower()
    
            if any(indicator in line_lower for indicator in injection_indicators):
                injectable_found = True
    
                finding = {
                    "type": "vulnerability",
                    "target": target_url,
                    "evidence": {
                        "raw_output": line,
                        "url": target_url,
                        "discovered_by": "sqlmap",
                        "vulnerability_type": "sql_injection",
                    },
                    "severity": "high",
                    "confidence": "medium",
                    "tags": ["sql-injection", "vulnerability", "sqlmap"],
                    "raw_ref": line,
                }
                findings.append(finding)
    
        if (
            not injectable_found
            and target_url
            and (
                "scan finished" in raw_output.lower()
                or "all tested parameters" in raw_output.lower()
                or "no injectable parameters" in raw_output.lower()
            )
        ):
            finding = {
                "type": "scan_result",
                "target": target_url,
                "evidence": {
                    "raw_output": "Scan completed - no SQL injection vulnerabilities found",
                    "url": target_url,
                    "discovered_by": "sqlmap",
                    "result": "not_vulnerable",
                },
                "severity": "info",
                "confidence": "high",
                "tags": ["sql-injection-test", "scan-result", "sqlmap"],
                "raw_ref": "scan_completed_no_injection",
            }
            findings.append(finding)
    
        if len(findings) > 100:
            findings = findings[:100]
    
        return findings
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'enhanced logging' which adds some context beyond basic execution, but fails to disclose critical traits such as whether this is a read-only or destructive operation, potential security implications, execution time, rate limits, or authentication needs. For a security testing tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized and front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a security testing tool with 3 parameters, 0% schema coverage, no annotations, but with an output schema, the description is incomplete. While the output schema may cover return values, the description fails to provide necessary context about the tool's behavior, parameter usage, and when to select it among many sibling security tools. For a complex tool in this domain, more guidance is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning none of the 3 parameters (url, data, additional_args) have descriptions in the schema. The tool description provides no information about what these parameters mean, their formats, or how they should be used. The description doesn't compensate for the complete lack of parameter documentation in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Execute SQLMap for SQL injection testing with enhanced logging.' This specifies the verb (execute SQLMap), resource (SQL injection testing), and a distinguishing feature (enhanced logging). It differentiates from siblings by focusing on SQL injection testing specifically, though it doesn't explicitly contrast with other SQL-related tools (none listed in siblings).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'enhanced logging' but doesn't explain when this is beneficial or when other tools like 'nuclei_scan' or 'smart_scan' might be more appropriate. There are no explicit when/when-not statements or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SlanyCukr/bugbounty-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server