Skip to main content
Glama

directory_bruteforce

Discover hidden directories and files on web servers by systematically testing common paths and extensions to identify accessible resources during security assessments.

Instructions

Bruteforce directories and files on web server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL
wordlistNoWordlist to use
extensionsNoFile extensions to check
use_seclistsNoUse SecLists common lists if no wordlist provided

Implementation Reference

  • Core handler function that performs directory and file brute-force enumeration on a web target using HTTP HEAD requests with configurable wordlists and extensions.
    async directoryBruteforce(url: string, wordlist?: string, extensions?: string[], useSecLists?: boolean): Promise<ScanResult> {
      try {
        const foundPaths: string[] = [];
        const baseUrl = new URL(url);
        
        // Default directory wordlist
        const defaultDirs = [
          'admin', 'administrator', 'login', 'dashboard', 'panel', 'config', 'backup',
          'test', 'dev', 'staging', 'api', 'uploads', 'files', 'images', 'css', 'js',
          'assets', 'static', 'public', 'private', 'secure', 'hidden', 'secret',
          'wp-admin', 'wp-content', 'wp-includes', 'phpmyadmin', 'mysql', 'database'
        ];
        
        let dirs: string[] = defaultDirs;
        if (wordlist) {
          dirs = await this.loadWordlist(wordlist);
        } else if (useSecLists) {
          const candidates = [
            '/usr/share/seclists/Discovery/Web-Content/common.txt',
            '/usr/share/seclists/Discovery/Web-Content/raft-small-words.txt',
            '/usr/share/seclists/Discovery/Web-Content/raft-medium-words.txt'
          ];
          for (const path of candidates) {
            try {
              const loaded = await this.loadWordlist(path);
              if (loaded.length > 0) { dirs = loaded; break; }
            } catch (_) {}
          }
        }
        const exts = extensions || ['php', 'html', 'asp', 'aspx', 'jsp', 'txt', 'xml', 'json'];
        
        // Check directories
        for (const dir of dirs) {
          try {
            const testUrl = `${baseUrl.origin}/${dir}/`;
            const response = await axios.head(testUrl, { timeout: 5000 });
            if (response.status === 200 || response.status === 403) {
              foundPaths.push(testUrl);
            }
          } catch (e) {
            // Path not found or error
          }
        }
        
        // Check files with extensions
        for (const dir of dirs) {
          for (const ext of exts) {
            try {
              const testUrl = `${baseUrl.origin}/${dir}.${ext}`;
              const response = await axios.head(testUrl, { timeout: 5000 });
              if (response.status === 200) {
                foundPaths.push(testUrl);
              }
            } catch (e) {
              // File not found or error
            }
          }
        }
        
        return {
          target: url,
          timestamp: new Date().toISOString(),
          tool: 'directory_bruteforce',
          results: {
            found_paths: foundPaths,
            total_found: foundPaths.length,
            wordlist_size: dirs.length,
            extensions_tested: exts
          },
          status: 'success'
        };
      } catch (error) {
        return {
          target: url,
          timestamp: new Date().toISOString(),
          tool: 'directory_bruteforce',
          results: {},
          status: 'error',
          error: error instanceof Error ? error.message : String(error)
        };
      }
    }
  • Input schema definition for the directory_bruteforce tool, specifying parameters like url, wordlist, extensions, and use_seclists.
    {
      name: "directory_bruteforce",
      description: "Bruteforce directories and files on web server",
      inputSchema: {
        type: "object",
        properties: {
          url: { type: "string", description: "Target URL" },
          wordlist: { type: "string", description: "Wordlist to use" },
          extensions: { type: "array", items: { type: "string" }, description: "File extensions to check" },
          use_seclists: { type: "boolean", description: "Use SecLists common lists if no wordlist provided" }
        },
        required: ["url"]
      }
    },
  • src/index.ts:514-515 (registration)
    Tool dispatch/registration in the main switch statement that routes calls to the ReconTools.directoryBruteforce handler.
    case "directory_bruteforce":
      return respond(await this.reconTools.directoryBruteforce(args.url, args.wordlist, args.extensions, args.use_seclists));
  • Usage of directoryBruteforce in the automated pentest workflow during web discovery phase.
    // Directory brute force
    const dirResult = await this.reconTools.directoryBruteforce(webTarget);
    phase.results!.push(dirResult);
  • directory_bruteforce listed in allowed tools for security validation.
    const allowedTools = [
      'nmap_scan', 'subdomain_enum', 'tech_detection', 'directory_bruteforce',
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 'Bruteforce' implies aggressive enumeration that could trigger security alerts or rate limiting, the description doesn't mention these risks, required permissions, expected output format, or whether this is a passive vs. active scan. It lacks crucial operational context for a security testing tool.

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 extremely concise at just 6 words with zero wasted language. It's front-loaded with the core purpose and contains no unnecessary elaboration. This is an example of efficient communication where every word earns its place.

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 4 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, what constitutes success/failure, ethical considerations, or operational constraints. Given the complexity and sensitive nature of bruteforce operations, more context is needed for safe and effective use.

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 structured schema. It doesn't explain relationships between parameters (e.g., how 'use_seclists' interacts with 'wordlist') or provide usage examples.

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 ('Bruteforce') and target ('directories and files on web server'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'directory_scan' or 'fuzzing_directories', which likely perform similar reconnaissance functions.

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 multiple sibling tools for web reconnaissance (directory_scan, fuzzing_directories, nikto_scan, etc.), there's no indication of when this specific bruteforce approach is preferred or what distinguishes it from other directory discovery methods.

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