Skip to main content
Glama
SlanyCukr

Bug Bounty MCP Server

by SlanyCukr

hakrawler_crawl

Crawl websites to discover endpoints, forms, and hidden URLs for security testing and vulnerability assessment in bug bounty programs.

Instructions

Execute hakrawler for fast web crawling and endpoint discovery.

Args: url: Target URL to crawl depth: Crawling depth forms: Extract form endpoints robots: Parse robots.txt sitemap: Parse sitemap wayback: Include Wayback Machine URLs insecure: Skip TLS verification additional_args: Additional hakrawler arguments

Returns: Web crawling and endpoint discovery results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
additional_argsNo
depthNo
formsNo
insecureNo
robotsNo
sitemapNo
urlYes
waybackNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler and registration for 'hakrawler_crawl'. This function defines the tool interface, validates inputs via type hints, constructs payload, and proxies execution to the REST API endpoint /api/hakrawler.
    @mcp.tool()
    def hakrawler_crawl(
        url: str,
        depth: int = 2,
        forms: bool = True,
        robots: bool = True,
        sitemap: bool = True,
        wayback: bool = False,
        insecure: bool = False,
        additional_args: str = "",
    ) -> dict[str, Any]:
        """Execute hakrawler for fast web crawling and endpoint discovery.
    
        Args:
            url: Target URL to crawl
            depth: Crawling depth
            forms: Extract form endpoints
            robots: Parse robots.txt
            sitemap: Parse sitemap
            wayback: Include Wayback Machine URLs
            insecure: Skip TLS verification
            additional_args: Additional hakrawler arguments
    
        Returns:
            Web crawling and endpoint discovery results
        """
        data = {
            "url": url,
            "depth": depth,
            "forms": forms,
            "robots": robots,
            "sitemap": sitemap,
            "wayback": wayback,
            "insecure": insecure,
            "additional_args": additional_args,
        }
    
        logger.info(f"🕷️ Starting hakrawler crawling on {url}")
        result = api_client.safe_post("api/hakrawler", data)
    
        if result.get("success"):
            logger.info(f"✅ hakrawler crawling completed on {url}")
        else:
            logger.error("❌ hakrawler crawling failed")
    
        return result
  • Core handler function for hakrawler execution in REST API. Extracts parameters, builds subprocess command, executes hakrawler binary, parses output into structured findings with timings and stats.
    @tool(required_fields=["url"])
    def execute_hakrawler():
        """Execute hakrawler for fast web crawling and endpoint discovery."""
        data = request.get_json()
        params = extract_hakrawler_params(data)
    
        started_at = datetime.now()
        command = build_hakrawler_command(params)
        execution_result = execute_command(
            " ".join(command), timeout=params.get("timeout", 120)
        )
        ended_at = datetime.now()
    
        return parse_hakrawler_output(
            execution_result, params, command, started_at, ended_at
        )
  • Helper function to parse hakrawler stdout into structured JSON findings, extracting URLs, adding metadata like severity, confidence, tags, and computing stats.
    def parse_hakrawler_output(
        execution_result: dict[str, Any],
        params: dict,
        command: list[str],
        started_at: datetime,
        ended_at: datetime,
    ) -> dict[str, Any]:
        """Parse hakrawler execution results into structured findings."""
        duration_ms = int((ended_at - started_at).total_seconds() * 1000)
    
        if not execution_result["success"]:
            return {
                "success": False,
                "tool": "hakrawler",
                "params": params,
                "command": command,
                "started_at": started_at.isoformat(),
                "ended_at": ended_at.isoformat(),
                "duration_ms": duration_ms,
                "error": execution_result.get("error", "Command execution failed"),
                "findings": [],
                "stats": {"findings": 0, "dupes": 0, "payload_bytes": 0},
            }
    
        # Parse successful output
        stdout = execution_result.get("stdout", "")
        findings = []
    
        # Extract URLs from hakrawler output
        for line in stdout.strip().split("\n"):
            line = line.strip()
            if not line:
                continue
    
            # Parse URL findings
            url_info = _extract_url_from_line(line)
            if url_info:
                finding = {
                    "type": "url",
                    "target": url_info.get("url", line),
                    "evidence": {
                        "raw_output": line,
                        "source": url_info.get("source", "crawl"),
                    },
                    "severity": "info",
                    "confidence": "medium",
                    "tags": ["hakrawler", "url-discovery"],
                    "raw_ref": line,
                }
                findings.append(finding)
    
        payload_bytes = len(stdout.encode("utf-8"))
    
        return {
            "success": True,
            "tool": "hakrawler",
            "params": params,
            "command": command,
            "started_at": started_at.isoformat(),
            "ended_at": ended_at.isoformat(),
            "duration_ms": duration_ms,
            "findings": findings,
            "stats": {
                "findings": len(findings),
                "dupes": 0,
                "payload_bytes": payload_bytes,
            },
        }
  • Helper to construct the hakrawler CLI command line arguments from input parameters.
    def build_hakrawler_command(params: dict) -> list[str]:
        """Build the hakrawler command from parameters."""
        args = ["hakrawler"]
    
        # Add URL
        args.extend(["-url", params["url"]])
    
        # Add depth parameter
        args.extend(["-depth", str(params["depth"])])
    
        # Add boolean flags only if enabled
        if params["forms"]:
            args.append("-forms")
        if params["robots"]:
            args.append("-robots")
        if params["sitemap"]:
            args.append("-sitemap")
        if params["wayback"]:
            args.append("-wayback")
        if params["insecure"]:
            args.append("-insecure")
    
        # Add additional arguments
        if params["additional_args"]:
            args.extend(shlex.split(params["additional_args"]))
    
        return args
  • Module init that imports and exposes the execute_hakrawler function for automatic registration via the @tool decorator in the main app.py.
    """Hakrawler tool module - web crawler for web application reconnaissance."""
    
    from .hakrawler import execute_hakrawler
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'fast web crawling' which implies performance characteristics, but lacks critical details: it doesn't specify whether this is a read-only operation, potential side effects (e.g., rate limiting, triggering security alerts), authentication requirements, or error handling. For a tool with 8 parameters and no annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is well-structured and appropriately sized: a clear purpose statement followed by bullet-point lists for arguments and returns. Every sentence earns its place, with no redundant information. It could be slightly more front-loaded by integrating the purpose more tightly with parameter context, but overall it's efficient and readable.

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

Completeness3/5

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

Given the tool's complexity (8 parameters, no annotations, but with an output schema), the description is moderately complete. It covers the purpose and parameters adequately, and the output schema handles return values, so the description doesn't need to explain results. However, it lacks usage guidelines and behavioral context, which are important for a crawling tool that might have operational constraints or ethical considerations.

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

Parameters4/5

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

With 0% schema description coverage, the schema provides only titles and types for 8 parameters. The description compensates well by listing all parameters with brief explanations (e.g., 'depth: Crawling depth', 'forms: Extract form endpoints'), adding meaningful context beyond the bare schema. However, it doesn't elaborate on parameter interactions or provide examples (e.g., depth ranges), keeping it from a perfect score.

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: 'Execute hakrawler for fast web crawling and endpoint discovery.' It specifies the verb ('execute'), resource ('hakrawler'), and outcome ('web crawling and endpoint discovery'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'katana_crawl' or 'gau_discovery' that might offer similar crawling functionality, preventing a perfect score.

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. With many sibling tools for reconnaissance and scanning (e.g., 'katana_crawl', 'gau_discovery', 'waybackurls_discovery'), there's no indication of hakrawler's specific use cases, strengths, or limitations compared to them. The lack of context leaves the agent guessing about appropriate scenarios.

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