Skip to main content
Glama

subdomain_enum

Discover subdomains of target domains using multiple enumeration methods including wordlist fuzzing and external tools for comprehensive reconnaissance in penetration testing.

Instructions

Enumerate subdomains of target domain using multiple methods

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesTarget domain
wordlistNoWordlist to use (optional)
use_subfinderNoAlso use subfinder for enumeration
fuzz_toolNoUse fuzzing tool for subdomain discovery (ffuf/wfuzz)

Implementation Reference

  • Core handler function implementing subdomain enumeration using certificate transparency logs, DNS brute-forcing, optional subfinder, and fuzzing with ffuf/wfuzz.
    async subdomainEnum(domain: string, wordlist?: string, useSubfinder?: boolean, fuzzTool?: 'ffuf' | 'wfuzz'): Promise<ScanResult> {
      try {
        const subdomains = new Set<string>();
        
        // Method 1: Certificate Transparency logs
        try {
          const ctLogs = await this.getCertTransparencySubdomains(domain);
          ctLogs.forEach(sub => subdomains.add(sub));
        } catch (e) {
          console.error('CT logs failed:', e);
        }
        
        // Method 2: DNS brute force with common subdomains or supplied wordlist
        const commonSubs = [
          'www', 'mail', 'ftp', 'localhost', 'webmail', 'smtp', 'pop', 'ns1', 'webdisk',
          'ns2', 'cpanel', 'whm', 'autodiscover', 'autoconfig', 'dev', 'staging', 'test',
          'api', 'admin', 'blog', 'shop', 'forum', 'support', 'mobile', 'app', 'cdn'
        ];
        
        const customWordlist = wordlist ? await this.loadWordlist(wordlist) : commonSubs;
        
        for (const subdomain of customWordlist) {
          try {
            const fullDomain = `${subdomain}.${domain}`;
            const dns = require('dns').promises;
            await dns.lookup(fullDomain);
            subdomains.add(fullDomain);
          } catch (e) {
            // Subdomain doesn't exist
          }
        }
        // Method 3: subfinder integration
        if (useSubfinder) {
          try {
            const cmd = `subfinder -silent -d ${domain}`;
            const { stdout } = await execAsync(cmd, { timeout: 60000 });
            stdout.split('\n').map(s => s.trim()).filter(s => s).forEach(s => subdomains.add(s));
          } catch (e) {
            console.error('subfinder failed:', e);
          }
        }
    
        // Method 4: Fuzzing with ffuf/wfuzz
        if (fuzzTool) {
          try {
            const fuzzSubs = await this.fuzzSubdomains(domain, fuzzTool, wordlist);
            fuzzSubs.forEach(sub => subdomains.add(sub));
          } catch (e) {
            console.error(`${fuzzTool} subdomain fuzzing failed:`, e);
          }
        }
    
        return {
          target: domain,
          timestamp: new Date().toISOString(),
          tool: 'subdomain_enum',
          results: {
            subdomains: Array.from(subdomains),
            count: subdomains.size,
            methods_used: ['certificate_transparency', 'dns_bruteforce']
              .concat(useSubfinder ? ['subfinder'] : [])
              .concat(fuzzTool ? [`${fuzzTool}_fuzzing`] : [])
          },
          status: 'success'
        };
      } catch (error) {
        return {
          target: domain,
          timestamp: new Date().toISOString(),
          tool: 'subdomain_enum',
          results: {},
          status: 'error',
          error: error instanceof Error ? error.message : String(error)
        };
      }
  • Input schema and tool metadata definition for the subdomain_enum tool, registered in the MCP server.
    name: "subdomain_enum",
    description: "Enumerate subdomains of target domain using multiple methods",
    inputSchema: {
      type: "object",
      properties: {
        domain: { type: "string", description: "Target domain" },
        wordlist: { type: "string", description: "Wordlist to use (optional)" },
        use_subfinder: { type: "boolean", description: "Also use subfinder for enumeration" },
        fuzz_tool: { 
          type: "string", 
          enum: ["ffuf", "wfuzz"],
          description: "Use fuzzing tool for subdomain discovery (ffuf/wfuzz)" 
        }
      },
      required: ["domain"]
    }
  • src/index.ts:508-509 (registration)
    Dispatch/registration case in the MCP tool call handler that invokes the subdomainEnum method from ReconTools.
    case "subdomain_enum":
      return respond(await this.reconTools.subdomainEnum(args.domain, args.wordlist, args.use_subfinder, args.fuzz_tool));
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'enumerate' implies a read-only reconnaissance operation, the description doesn't specify whether this is passive or active, what the output format will be, whether it requires network access, or any rate limits or ethical considerations. It mentions 'multiple methods' but doesn't elaborate on what those are or their implications.

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 no wasted words. It's appropriately sized for a tool with 4 parameters and clear 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?

For a security testing tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns, what 'multiple methods' entails, whether this is passive or active reconnaissance, or any ethical/legal considerations. Given the complexity of security tools and the lack of structured metadata, more context is needed.

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 100%, so all parameters are documented in the schema. The description adds no additional parameter semantics beyond what's already in the schema descriptions. It mentions 'multiple methods' which loosely relates to the use_subfinder and fuzz_tool parameters, but doesn't provide meaningful context about when to choose which methods.

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 action ('enumerate') and target ('subdomains of target domain'), and mentions 'using multiple methods' which adds specificity. However, it doesn't explicitly differentiate this tool from other enumeration tools in the sibling list like directory_bruteforce or tech_detection, which prevents 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 focused on different aspects of security testing (nmap_scan, nikto_scan, sqlmap_scan, etc.), there's no indication of when subdomain enumeration is appropriate versus other reconnaissance or attack tools.

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/adriyansyah-mf/mcp-pentest'

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