Skip to main content
Glama
tachote
by tachote

Create interactsh session

create_interactsh_session

Creates callback domains for out-of-band interaction testing, enabling security testing and verification workflows by capturing DNS/HTTP interactions.

Instructions

Generates credentials, registers with interactsh, and returns the connection details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for create_interactsh_session. Creates a new interactsh session using the service, generates a sample probe host and detailed instructions, then returns a formatted result.
    async () => {
      const session = await service.createSession();
      const baseDomain = service.domainSuffix || new URL(service.baseUrl).hostname;
      const probeNonce = crypto
        .randomBytes(16)
        .toString('base64')
        .replace(/[^a-z0-9]/gi, '')
        .slice(0, 13)
        .toLowerCase();
      const probeHost = `${session.correlationId}${probeNonce}.${baseDomain}`;
      const instructions = [
        'Probing rules (very important):',
        '- Build the host as: <correlation_id><nonce13>.<domain>',
        '- correlation_id: exactly 20 lowercase hex characters (do not alter or truncate).',
        "- nonce13: exactly 13 lowercase alphanumeric characters [a-z0-9] (no hyphens or uppercase).",
        '- The label before the first dot must be length 33 (20 + 13).',
        '- Requests to only <correlation_id>.<domain> (no nonce) will be ignored by interactsh.',
        '',
        `Quick test (HTTP recommended): curl -I http://${probeHost}/`,
        'Then wait 2–3 seconds and call poll_interactsh_session with the same correlation_id to retrieve events.',
        'If you still get zero events, send another probe or use filters (method, protocol, path_contains, text_contains) when polling.',
      ].join('\n');
    
      return result({
        ...session.toJSON(),
        instructions,
        sample_probe_host: probeHost,
      });
    },
  • src/server.js:296-331 (registration)
    Registration of the create_interactsh_session tool with the MCP server via server.registerTool, including title, description, and handler function.
    server.registerTool(
      'create_interactsh_session',
      {
        title: 'Create interactsh session',
        description: 'Generates credentials, registers with interactsh, and returns the connection details.',
      },
      async () => {
        const session = await service.createSession();
        const baseDomain = service.domainSuffix || new URL(service.baseUrl).hostname;
        const probeNonce = crypto
          .randomBytes(16)
          .toString('base64')
          .replace(/[^a-z0-9]/gi, '')
          .slice(0, 13)
          .toLowerCase();
        const probeHost = `${session.correlationId}${probeNonce}.${baseDomain}`;
        const instructions = [
          'Probing rules (very important):',
          '- Build the host as: <correlation_id><nonce13>.<domain>',
          '- correlation_id: exactly 20 lowercase hex characters (do not alter or truncate).',
          "- nonce13: exactly 13 lowercase alphanumeric characters [a-z0-9] (no hyphens or uppercase).",
          '- The label before the first dot must be length 33 (20 + 13).',
          '- Requests to only <correlation_id>.<domain> (no nonce) will be ignored by interactsh.',
          '',
          `Quick test (HTTP recommended): curl -I http://${probeHost}/`,
          'Then wait 2–3 seconds and call poll_interactsh_session with the same correlation_id to retrieve events.',
          'If you still get zero events, send another probe or use filters (method, protocol, path_contains, text_contains) when polling.',
        ].join('\n');
    
        return result({
          ...session.toJSON(),
          instructions,
          sample_probe_host: probeHost,
        });
      },
    );
  • Core logic for creating an interactsh session in InteractshService class: generates RSA keys, correlation ID, secret key, creates session object, registers it, and stores in map.
    async createSession() {
      const { publicKey, privateKey } = crypto.generateKeyPairSync('rsa', {
        modulusLength: 2048,
        publicExponent: 0x10001,
      });
    
      const publicKeyPem = publicKey.export({ type: 'spki', format: 'pem' });
      const publicKeyB64 = Buffer.from(publicKeyPem).toString('base64');
      const correlationId = this.#generateCorrelationId();
      const secretKey = this.#generateSecretKey();
      const callbackDomain = this.domainSuffix ? `${correlationId}.${this.domainSuffix}` : correlationId;
    
      const session = new InteractshSession({
        correlationId,
        secretKey,
        privateKey,
        publicKeyB64,
        callbackDomain,
        serverUrl: this.baseUrl,
      });
    
      await this.#register(session);
      this.sessions.set(correlationId, session);
      return session;
    }
  • InteractshSession class used to hold session data and provide JSON serialization for the tool output.
    export class InteractshSession {
      constructor({ correlationId, secretKey, privateKey, publicKeyB64, callbackDomain, serverUrl }) {
        this.correlationId = correlationId;
        this.secretKey = secretKey;
        this.privateKey = privateKey;
        this.publicKeyB64 = publicKeyB64;
        this.callbackDomain = callbackDomain;
        this.serverUrl = serverUrl;
      }
    
      toJSON() {
        return {
          correlation_id: this.correlationId,
          secret_key: this.secretKey,
          private_key_pem: this.privateKey.export({ type: 'pkcs8', format: 'pem' }),
          callback_domain: this.callbackDomain,
          server_url: this.serverUrl,
        };
      }
    }
Behavior2/5

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

With no annotations, the description carries the full burden. It mentions generating credentials and registering, which implies a write operation, but lacks details on permissions, rate limits, or what happens if registration fails. This is a mutation tool with significant behavioral gaps in disclosure.

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 a single, efficient sentence that front-loads the key actions without unnecessary words. Every part ('generates credentials', 'registers', 'returns connection details') contributes directly to understanding the tool's purpose.

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 mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'connection details' include, error handling, or dependencies on other tools like 'deregister_interactsh_session', leaving gaps in contextual understanding.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately adds no parameter details, focusing on the tool's action, which aligns with the baseline for zero parameters.

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 tool's purpose with specific verbs ('generates credentials', 'registers', 'returns connection details') and identifies the resource ('interactsh session'). It distinguishes from siblings like 'deregister_interactsh_session' and 'list_interactsh_sessions' by focusing on creation, though it doesn't explicitly contrast them.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description implies usage for creating a new session but doesn't mention prerequisites, when not to use it, or refer to sibling tools like 'poll_interactsh_session' for related actions.

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/tachote/mcp-interactsh'

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