Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xKoda WireMCP tshark kerberos credential fields

From Leeroopedia
Knowledge Sources
Domains Networking, Security, Credential_Extraction
Last Updated 2026-10-28 00:00 GMT

Overview

Concrete tool for extracting Kerberos credential fields (CNameString, realm, cipher, type, msg_type) from a PCAP file into tab-separated rows provided by the tshark CLI, invoked via `execAsync` within the `extract_credentials` tool handler.

Description

The tshark Kerberos credential field extraction pattern runs `tshark -r <file> -T fields -e kerberos.CNameString -e kerberos.realm -e kerberos.cipher -e kerberos.type -e kerberos.msg_type -e frame.number` to output tab-separated rows, one per Kerberos-bearing packet. The fields capture the client name, realm, encrypted ciphertext, message type code, Kerberos message type (AS-REQ `10`, AS-REP `11`, TGS-REQ `30`), and frame number. WireMCP iterates these rows to format hashcat-ready Kerberos hash strings.

Usage

Use this pattern when you need to extract Kerberos authentication artifacts from a capture for offline hash-cracking preparation (hashcat mode 7500 or 18200).

Code Reference

Source Location

  • Repository: WireMCP
  • File: index.js
  • Lines: L386-389

Signature

const { stdout: kerberosOut } = await execAsync(
  `${tsharkPath} -r "${pcapPath}" -T fields ` +
  `-e kerberos.CNameString -e kerberos.realm -e kerberos.cipher ` +
  `-e kerberos.type -e kerberos.msg_type -e frame.number`,
  { env: { ...process.env, PATH: `${process.env.PATH}:/usr/bin:/usr/local/bin:/opt/homebrew/bin` } }
);

Import

const { exec } = require('child_process');
const { promisify } = require('util');
const execAsync = promisify(exec);

I/O Contract

Inputs

Name Type Required Description
tsharkPath string Yes Absolute path to tshark
pcapPath string Yes Path to the PCAP file to analyze

Outputs

Name Type Description
kerberosOut string Tab-separated rows, one per Kerberos-bearing packet

Usage Examples

Extract Kerberos Credential Fields

const tsharkPath = await findTshark();
const pcapPath = './auth_capture.pcap';

await fs.access(pcapPath);

// Extract Kerberos fields
const { stdout: kerberosOut } = await execAsync(
  `${tsharkPath} -r "${pcapPath}" -T fields ` +
  `-e kerberos.CNameString -e kerberos.realm -e kerberos.cipher ` +
  `-e kerberos.type -e kerberos.msg_type -e frame.number`,
  { env: { ...process.env, PATH: `${process.env.PATH}:/usr/bin:/usr/local/bin:/opt/homebrew/bin` } }
);

// Parse rows
const kerberosLines = kerberosOut.split('\n').filter(line => line.trim());
kerberosLines.forEach(line => {
  const [cname, realm, cipher, type, msgType, frameNumber] = line.split('\t');
  // msgType 10/30 = AS-REQ/TGS-REQ, 11 = AS-REP
  console.log(`Kerberos: ${cname}@${realm} msgType=${msgType} frame=${frameNumber}`);
});

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment