Skip to main content
Glama
SlanyCukr

Bug Bounty MCP Server

by SlanyCukr

dnsenum_scan

Perform DNS enumeration and subdomain discovery to identify potential attack surfaces during security assessments and reconnaissance activities.

Instructions

Execute dnsenum for DNS enumeration and subdomain discovery.

Args: domain: Target domain dns_server: DNS server to use wordlist: Wordlist for brute force threads: Number of threads delay: Delay between requests reverse: Enable reverse DNS lookup additional_args: Additional dnsenum arguments

Returns: DNS enumeration results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
additional_argsNo
delayNo
dns_serverNo
domainYes
reverseNo
threadsNo
wordlistNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server tool handler and registration for 'dnsenum_scan'. Forwards parameters to the REST API /api/dnsenum endpoint for execution.
    @mcp.tool()
    def dnsenum_scan(
        domain: str,
        dns_server: str = "",
        wordlist: str = "",
        threads: int = 5,
        delay: int = 0,
        reverse: bool = False,
        additional_args: str = "",
    ) -> dict[str, Any]:
        """Execute dnsenum for DNS enumeration and subdomain discovery.
    
        Args:
            domain: Target domain
            dns_server: DNS server to use
            wordlist: Wordlist for brute force
            threads: Number of threads
            delay: Delay between requests
            reverse: Enable reverse DNS lookup
            additional_args: Additional dnsenum arguments
    
        Returns:
            DNS enumeration results
        """
        data = {
            "domain": domain,
            "dns_server": dns_server,
            "wordlist": wordlist,
            "threads": threads,
            "delay": delay,
            "reverse": reverse,
            "additional_args": additional_args,
        }
    
        logger.info(f"🔍 Starting dnsenum DNS enumeration on {domain}")
        result = api_client.safe_post("api/dnsenum", data)
    
        if result.get("success"):
            logger.info(f"✅ dnsenum scan completed on {domain}")
        else:
            logger.error("❌ dnsenum scan failed")
    
        return result
  • REST API endpoint handler that implements the core logic for running dnsenum command, parsing output, and formatting results. This is the actual execution backend called by the MCP tool.
    @tool(required_fields=["target"])
    def execute_dnsenum():
        """Execute dnsenum for DNS enumeration and subdomain discovery."""
        try:
            data = request.get_json()
            if not data:
                return {"error": "No JSON data provided", "success": False}
    
            # Extract parameters
            params = extract_dnsenum_params(data)
    
            logger.info(f"Executing dnsenum on {params['domain']}")
    
            # Build command
            command = build_dnsenum_command(params)
            logger.info(f"Executing command: {' '.join(command)}")
    
            # Execute command with timing
            started_at = datetime.now()
            execution_result = execute_command(
                " ".join(command), timeout=600
            )  # 10 minute timeout for DNS enumeration
            ended_at = datetime.now()
    
            return parse_dnsenum_output(
                execution_result, params, " ".join(command), started_at, ended_at
            )
    
        except ValueError as e:
            logger.error(f"Invalid parameters for dnsenum: {e}")
            return {
                "error": f"Invalid parameters: {str(e)}",
                "success": False,
                "tool": "dnsenum",
            }
        except Exception as e:
            logger.error(f"Unexpected error in dnsenum execution: {e}")
            return {
                "error": f"Execution failed: {str(e)}",
                "success": False,
                "tool": "dnsenum",
            }
  • Helper function to construct the dnsenum command line arguments from input parameters.
    def build_dnsenum_command(params):
        """Build dnsenum command from parameters."""
        cmd_parts = ["dnsenum", "--nocolor", "-v", "-t", "60"]
    
        # Add domain
        cmd_parts.append(params["domain"])
    
        # Add DNS server if specified
        if params["dns_server"]:
            cmd_parts.extend(["--dnsserver", params["dns_server"]])
    
        # Add wordlist file if specified
        if params["wordlist"]:
            cmd_parts.extend(["-f", params["wordlist"]])
    
        # Add threads if specified
        if params["threads"] != 5:
            cmd_parts.extend(["--threads", str(params["threads"])])
    
        # Add delay if specified
        if params["delay"] > 0:
            cmd_parts.extend(["-d", str(params["delay"])])
    
        # Add reverse lookup option
        if not params["reverse"]:
            cmd_parts.append("--noreverse")
    
        # Handle additional arguments
        if params["additional_args"]:
            try:
                additional_parts = shlex.split(params["additional_args"])
                cmd_parts.extend(additional_parts)
            except ValueError as e:
                logger.warning(f"Failed to parse additional_args: {e}")
  • Helper function to parse dnsenum output and extract subdomain findings with deduplication.
    def parse_dnsenum_subdomains(stdout, domain):
        """Extract subdomains from dnsenum output."""
        findings = []
        seen_subdomains = set()
    
        if not stdout.strip():
            return findings
    
        lines = stdout.strip().split("\n")
    
        for line in lines:
            line = line.strip()
    
            # Skip empty lines and noise
            if not line:
                continue
    
            # Look for successful DNS resolutions (lines with IP addresses)
            if "IN    A" in line and "query failed" not in line.lower():
                parts = line.split()
                if len(parts) >= 5:
                    subdomain_candidate = parts[0].rstrip(".")
                    ip_address = parts[-1]
    
                    # Check if this is a subdomain of our target domain
                    if (
                        subdomain_candidate.endswith(f".{domain}")
                        or subdomain_candidate == domain
                    ):
                        if subdomain_candidate not in seen_subdomains:
                            seen_subdomains.add(subdomain_candidate)
    
                            finding = {
                                "type": "subdomain",
                                "target": subdomain_candidate,
                                "evidence": {
                                    "subdomain": subdomain_candidate,
                                    "domain": domain,
                                    "ip_address": ip_address,
                                    "discovered_by": "dnsenum",
                                },
                                "tags": ["subdomain", "dns_enumeration"],
                                "raw_ref": line,
                            }
                            findings.append(finding)
    
        return findings
  • Parameter extraction and validation function defining the input schema for the dnsenum tool.
    def extract_dnsenum_params(data):
        """Extract dnsenum parameters from request data."""
        return {
            "domain": data.get("target", "").strip(),
            "dns_server": data.get("dns_server", "").strip(),
            "wordlist": data.get("wordlist", "").strip(),
            "threads": data.get("threads", 5),
            "delay": data.get("delay", 0),
            "reverse": data.get("reverse", False),
            "additional_args": data.get("additional_args", "").strip(),
        }
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 states the tool executes dnsenum but doesn't mention critical behaviors: whether it's read-only or destructive, if it requires specific permissions, rate limits, network impact, or what 'DNS enumeration results' entail. For a tool with 7 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. It starts with a clear purpose statement, followed by organized 'Args' and 'Returns' sections. Each sentence adds value without redundancy. Minor improvements could include bolding key terms, but overall it's efficient and easy to parse.

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 (7 parameters, no annotations, but has an output schema), the description is partially complete. It covers the purpose and parameters adequately but lacks behavioral context, usage guidelines, and details on the output. The output schema existence reduces the need to explain return values, but overall completeness is moderate due to missing operational guidance.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It lists all 7 parameters with brief explanations (e.g., 'Target domain', 'Wordlist for brute force'), adding meaningful context beyond the schema's property titles. However, it doesn't provide format details, examples, or constraints (e.g., wordlist file paths, valid DNS server formats), leaving some ambiguity for the agent.

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 dnsenum for DNS enumeration and subdomain discovery.' It specifies the verb ('execute'), resource ('dnsenum'), and objective ('DNS enumeration and subdomain discovery'), which is more specific than just restating the name. However, it doesn't explicitly differentiate from sibling tools like 'subfinder_scan' or 'fierce_scan' that may also perform DNS/subdomain discovery.

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 (e.g., 'subfinder_scan', 'fierce_scan', 'amass_scan'), there's no indication of when dnsenum is preferred, what scenarios it's suited for, or any prerequisites. The lack of usage context leaves the agent guessing about tool selection.

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