Skip to main content
Glama

Kerberoast

Extract and crack Kerberos service tickets from Active Directory to identify weak user passwords through offline analysis.

Instructions

The goal of Kerberoasting is to harvest TGS tickets for services that run on behalf of user accounts in the AD, not computer accounts. Thus, part of these TGS tickets is encrypted with keys derived from user passwords. As a consequence, their credentials could be cracked offline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipsYes
usernamesYes
passwordsYes
output_fileYes

Implementation Reference

  • The handler function for the 'Kerberoast' tool. It prepends the project directory to the output_file path and executes netexec ldap with the --kerberoast option, providing usernames and optional passwords to harvest TGS tickets for offline cracking.
    @mcp.tool(name="Kerberoast",description="The goal of Kerberoasting is to harvest TGS tickets for services that run on behalf of user accounts in the AD, not computer accounts. Thus, part of these TGS tickets is encrypted with keys derived from user passwords. As a consequence, their credentials could be cracked offline.")
    def kerberoast(ips:List[str],usernames,passwords,output_file:str):
        output_file=config.PROJECT_DIRECTORY+output_file
        if len(passwords)>0:
            return run_command(["netexec","ldap"]+ips+["-u",usernames,"-p",passwords,"--kerberoast",output_file])
    
        return run_command(["netexec","ldap"]+ips+["-u",usernames,"--kerberoast",output_file])
  • The @mcp.tool decorator registers the 'kerberoast' function as the 'Kerberoast' tool with MCP, including its description.
    @mcp.tool(name="Kerberoast",description="The goal of Kerberoasting is to harvest TGS tickets for services that run on behalf of user accounts in the AD, not computer accounts. Thus, part of these TGS tickets is encrypted with keys derived from user passwords. As a consequence, their credentials could be cracked offline.")
  • The run_command helper function used by the Kerberoast handler to execute the netexec command and handle its output, errors, and timeouts.
    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?

No annotations are provided, so the description carries full burden for behavioral disclosure. The description explains what Kerberoasting achieves ('harvest TGS tickets', 'credentials could be cracked offline') but doesn't describe what the tool actually does behaviorally - whether it performs the attack, simulates it, tests for vulnerability, or something else. It doesn't disclose execution characteristics, side effects, or output behavior.

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 reasonably concise (3 sentences) and well-structured, explaining the technique's goal and consequences. However, it's entirely conceptual rather than functional - every sentence explains Kerberoasting as a technique rather than describing the tool's operation, so while concise, it's misdirected.

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?

For a 4-parameter tool with no annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It explains the concept of Kerberoasting but provides no information about tool operation, parameters, behavior, or output. Given the security context and potential destructive nature implied by the technique, this lack of operational detail is particularly problematic.

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%, so the description must compensate for undocumented parameters. The description provides no information about any of the 4 required parameters (ips, usernames, passwords, output_file). It doesn't explain what these parameters represent, their format, or how they're used in the Kerberoasting process.

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 explains what Kerberoasting is conceptually but doesn't state what this specific tool does. It describes the goal of Kerberoasting as a technique ('harvest TGS tickets') but doesn't specify the verb this tool performs (e.g., 'execute', 'perform', 'run'). The description is more educational about the technique than functional about the tool's operation.

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 about when to use this tool versus alternatives. The description doesn't mention any prerequisites, context for use, or comparison with sibling tools like ASREPRoast or other attack tools in the server. It's purely explanatory about the technique without operational guidance.

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