Skip to main content
Glama

password_spray

Test multiple passwords against one or more user accounts to identify weak credentials during security assessments.

Instructions

spray passwords on an account or several accounts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipsYes
usernamesYes
passwordsYes
oneloginNo

Implementation Reference

  • The handler function for the 'password_spray' tool. It uses netexec to perform password spraying on specified IPs with given usernames and passwords, with an option for one-login behavior.
    @mcp.tool(name="password_spray",description="spray passwords on an account or several accounts")
    def password_spray(ips:List[str],usernames:List[str],passwords:List[str],onelogin:bool=False):
        if(onelogin):
            return run_command(["netexec","smb"]+ips+["-u"]+usernames+["-p"]+passwords+["--no-bruteforce","--continue-on-success"])
        return run_command(["netexec","smb"]+ips+["-u"]+usernames+["-p"]+passwords)
  • The @mcp.tool decorator registers the password_spray function as an MCP tool.
    @mcp.tool(name="password_spray",description="spray passwords on an account or several accounts")
  • Helper function used by password_spray to execute shell commands via subprocess.
    def run_command(command: List[str], timeout: int = 150,communicate:bool=False) -> Dict[str, Union[str, int, bool]]:
        try:
            logger.info(f"communicate :{communicate}")
            logger.info(f"Running command: {' '.join(command)}")
            if communicate:
                # Use Popen for interactive communication
                process = subprocess.Popen(
                    command,
                    stdout=subprocess.PIPE,
                    stderr=subprocess.PIPE,
                    stdin=subprocess.PIPE,
                    text=True
                )
                stdout, stderr = process.communicate(input="y\n", timeout=timeout)
                returncode = process.returncode
            else:
                # Use run for non-interactive commands
                result = subprocess.run(
                    command,
                    stdout=subprocess.PIPE,
                    stderr=subprocess.PIPE,
                    text=True,
                    check=True,
                    timeout=timeout
                )
                stdout = result.stdout
                stderr = result.stderr
                returncode = result.returncode
    
            logger.info(f"Command completed with return code {returncode}")
            return {
                "success": True,
                "stdout": stdout,
                "stderr": stderr,
                "returncode": returncode
            }
            
        except subprocess.CalledProcessError as e:
            logger.error(f"Command failed with return code {e.returncode}: {e.stderr}")
            return {
                "success": False,
                "stdout": e.stdout,
                "stderr": e.stderr,
                "returncode": e.returncode,
                "error": f"Command failed with return code {e.returncode}"
            }
        except subprocess.TimeoutExpired as e:
            logger.error(f"Command timed out after {timeout} seconds")
            return {
                "success": False,
                "error": f"Command timed out after {timeout} seconds"
            }
        except Exception as e:
            logger.error(f"Error running command: {str(e)}")
            return {
                "success": False,
                "error": str(e)
            }
Behavior1/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 but fails to do so. It doesn't explain what 'spray passwords' entails (e.g., network requests, authentication attempts, potential security impacts), whether it's destructive or safe, rate limits, or required permissions. This omission is critical for a tool with parameters like 'ips' and 'passwords' that suggest network or security operations.

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

Conciseness3/5

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

The description is concise with a single sentence, but it's under-specified rather than efficiently informative. While it avoids unnecessary words, it lacks the structure needed to convey purpose, usage, or parameters, making it ineffective despite its brevity.

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

Completeness1/5

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

Given the tool's complexity (4 parameters, 0% schema coverage, no annotations, no output schema, and security-related context from sibling tools), the description is severely incomplete. It doesn't address behavioral aspects, parameter meanings, or usage scenarios, failing to provide the minimal information required for safe and effective tool use.

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

Parameters1/5

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

Schema description coverage is 0%, meaning no parameters are documented in the schema. The description adds no information about parameters, failing to explain what 'ips', 'usernames', 'passwords', or 'onelogin' mean or how they should be used. This leaves all four parameters completely undocumented, which is inadequate for tool invocation.

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

Purpose2/5

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

The description 'spray passwords on an account or several accounts' restates the tool name 'password_spray' with minimal elaboration, making it tautological. It vaguely suggests testing passwords against accounts but lacks specificity about the action's nature (e.g., authentication attempts, security testing). Compared to siblings like 'bruteforce_rid_users' or 'Kerberoast', it doesn't clearly differentiate its purpose.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention context, prerequisites, or exclusions, and it doesn't reference sibling tools like 'bruteforce_rid_users' or 'Kerberoast' for comparison. This leaves the agent with no information to make informed decisions 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/YoussefSahnoun/PentestMCP'

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