Implementation:0xKoda WireMCP tshark kerberos credential fields
| 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}`);
});