Skip to main content
Glama

Run Netcat Client

run_netcat_client

Connect to a target host and port to scan open ports, grab service banners, send local files, or establish reverse-shell connections.

Instructions

Netcat (nc/ncat) is a versatile networking tool used for port scanning, banner grabbing, and establishing client connections for data transfer or remote shells. Tags: network, security, pentest, shell, transfer, enumeration, scanning

Usage Guide:

  • Port Scanning: Set scan=True to check if ports are open without sending data.

  • Banner Grabbing: Connect to a target and port with verbose=True to identify services.

  • Reverse Shell: Provide target (attacker IP) and port (attacker listener) along with exec_shell (e.g., '/bin/bash' or 'cmd.exe') to initiate a reverse connection.

  • File Transfer (Send): Provide file_to_send to transmit a local file to a remote listener.

  • Secure Connection: Set use_ssl=True to connect to an Ncat SSL-enabled listener.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "target": "<target>",
      "port": "<port>"
    },
    "name": "run_netcat_client"
  }
}

Input Schema

NameRequiredDescriptionDefault
portYesDestination port or port range (e.g., "80", "1-1000").
scanNoIf True, uses -z for zero-I/O mode (useful for scanning).
targetYesTarget IP address or hostname.
use_sslNoIf True, uses 'ncat' with SSL encryption.
verboseNoEnables verbose output.
exec_shellNoPath to executable for bind/reverse shell (e.g., /bin/bash).
file_to_sendNoPath to a local file to send to the target.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and largely meets it: it discloses that scan mode sends no data, that verbose connects identify services, that SSL uses ncat, and that exec_shell opens a remote shell. It omits the operational risk profile of reverse shells (remote code execution, need for a pre-existing listener) and says nothing about connection timeouts or failure 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 Usage Guide bullets are tight and front-load the actionable modes, but the opening definitional sentence about netcat being a 'versatile networking tool' and the trailing Tags line are boilerplate that consume space without aiding tool selection or invocation.

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

Completeness4/5

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

For a 7-parameter tool with no annotations, the description covers the practical call patterns well, and the presence of an output schema removes the need to explain return values. Completeness would be higher if it flagged that reverse-shell and file-transfer modes require a listener on the far end and noted any safety or permission expectations for shell execution.

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 coverage is 100%, so the schema already documents every one of the seven parameters with examples, establishing a baseline of 3. The description adds scenario-level meaning by grouping parameters into modes, but contributes no format, default, or constraint detail beyond what the schema already states.

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 title and opening sentence establish that this runs netcat as a client for connections, scanning, banner grabbing, and transfers, and the Usage Guide enumerates the concrete modes. It stops short of explicitly contrasting with the listener siblings (start_netcat_listener/start_ncat_listener), so an agent must infer that this is the outbound/connect side.

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

Usage Guidelines4/5

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

Each mode is tied to a concrete parameter setting (scan=True for port checks, verbose=True for banners, exec_shell for reverse shells, file_to_send for transfers, use_ssl for Ncat SSL), which is strong when-to-use guidance. The one notable gap is the absence of an explicit when-not or alternative pointer: nothing says to use start_ncat_listener instead when the goal is to receive a connection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.