Skip to main content
Glama

nikto_scan

Scan web applications for vulnerabilities by running Nikto security tests to identify potential security issues in target URLs.

Instructions

Run Nikto web vulnerability scanner

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL
portNoTarget port (default: 80/443)

Implementation Reference

  • The primary handler function that runs the Nikto scanner via child_process.exec, parses results, and structures the ScanResult output.
    async niktoScan(url: string, port?: number): Promise<ScanResult> {
      try {
        let command = `nikto -h ${url}`;
        
        if (port) {
          command += ` -p ${port}`;
        }
        
        // Output format
        command += ' -Format txt';
        
        console.error(`Executing: ${command}`);
        
        const { stdout, stderr } = await execAsync(command, { 
          timeout: 600000 // 10 min timeout
        });
        
        const vulnerabilities = this.parseNiktoOutput(stdout, url);
        
        return {
          target: url,
          timestamp: new Date().toISOString(),
          tool: 'nikto',
          results: {
            vulnerabilities,
            total_found: vulnerabilities.length,
            raw_output: stdout
          },
          status: 'success'
        };
      } catch (error) {
        return {
          target: url,
          timestamp: new Date().toISOString(),
          tool: 'nikto',
          results: {},
          status: 'error',
          error: error instanceof Error ? error.message : String(error)
        };
      }
    }
  • JSON schema defining input parameters for nikto_scan: required 'url' (string) and optional 'port' (number).
    inputSchema: {
      type: "object",
      properties: {
        url: { type: "string", description: "Target URL" },
        port: { type: "number", description: "Target port (default: 80/443)" }
      },
      required: ["url"]
    }
  • src/index.ts:149-160 (registration)
    Tool registration in the MCP server's listTools handler, defining name, description, and input schema for discovery.
    {
      name: "nikto_scan",
      description: "Run Nikto web vulnerability scanner",
      inputSchema: {
        type: "object",
        properties: {
          url: { type: "string", description: "Target URL" },
          port: { type: "number", description: "Target port (default: 80/443)" }
        },
        required: ["url"]
      }
    },
  • src/index.ts:521-522 (registration)
    Dispatch registration in CallToolRequestSchema switch statement that invokes the actual niktoScan handler.
    case "nikto_scan":
      return respond(await this.vulnScanTools.niktoScan(args.url, args.port));
  • Supporting function that parses Nikto's textual output into VulnerabilityResult array with severity classification.
    private parseNiktoOutput(output: string, target: string): VulnerabilityResult[] {
      const vulnerabilities: VulnerabilityResult[] = [];
      const lines = output.split('\n');
      
      for (const line of lines) {
        if (line.includes('+ ') && !line.includes('Nikto v') && !line.includes('Target Host')) {
          let severity: 'info' | 'low' | 'medium' | 'high' | 'critical' = 'info';
          
          // Determine severity based on content
          if (line.toLowerCase().includes('xss') || 
              line.toLowerCase().includes('sql injection') ||
              line.toLowerCase().includes('command injection')) {
            severity = 'high';
          } else if (line.toLowerCase().includes('directory') ||
                     line.toLowerCase().includes('admin') ||
                     line.toLowerCase().includes('backup')) {
            severity = 'medium';
          } else if (line.toLowerCase().includes('version') ||
                     line.toLowerCase().includes('information')) {
            severity = 'low';
          }
          
          vulnerabilities.push({
            id: `nikto-${vulnerabilities.length + 1}`,
            name: 'Nikto Finding',
            severity,
            description: line.trim(),
            affected_url: target
          });
        }
      }
      
      return vulnerabilities;
    }
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 'Run Nikto web vulnerability scanner' implies an active scanning operation, it doesn't disclose important behavioral traits like whether this is a passive or active scan, potential impact on target systems, authentication requirements, rate limiting considerations, or what the output format looks like.

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 5 words, front-loading the essential information with zero wasted words. Every element earns its place, making it easy for an agent to quickly understand the tool's basic function.

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 vulnerability scanning tool with no annotations and no output schema, the description is incomplete. It doesn't explain what kind of results to expect, whether this is a comprehensive scan or targeted test, potential side effects on the target, or how this integrates with the broader penetration testing workflow represented by the sibling tools.

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?

With 100% schema description coverage, the input schema already documents both parameters (url and port) adequately. The description adds no additional parameter semantics beyond what's in the schema, so the baseline score of 3 is appropriate when the schema does the heavy lifting.

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 ('Run') and resource ('Nikto web vulnerability scanner'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from other vulnerability scanning siblings like 'nuclei_scan' or 'test_web_application' beyond naming the specific scanner.

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 web testing tools available (burp_active_scan, nuclei_scan, test_web_application), there's no indication of Nikto's specific use cases, strengths, or when it might be preferred over other options.

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