Implementation:0xKoda WireMCP kerberos hash formatting
| Knowledge Sources | |
|---|---|
| Domains | Security, Credential_Extraction, Cryptography |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
Concrete tool for formatting Kerberos credential fields into hashcat-ready hash strings, implemented as a pattern within the `extract_credentials` tool handler.
Description
The Kerberos hash formatting pattern builds hashcat-compatible hash strings from tshark-extracted Kerberos fields. The format depends on the Kerberos message type (`kerberos.msg_type`):
- AS-REQ / TGS-REQ (msgType 10 or 30): Produces `$krb5pa$23$<cname>$<realm>$<cipher>` with hashcat mode `-m 7500` (Kerberos 5 AS-REQ Pre-Auth etype 23).
- AS-REP (msgType 11): Produces `$krb5asrep$23$<cname>@<realm>$<cipher>` with hashcat mode `-m 18200` (Kerberos 5 AS-REP etype 23).
The `23` in the format string refers to the RC4-HMAC encryption type (etype 23). This is a user-defined pattern (not a library API) that bridges raw tshark Kerberos dissection output to offline cracking tools.
Usage
Use this pattern when you have tshark-extracted Kerberos fields and need to produce hash strings for hashcat or John the Ripper.
Code Reference
Source Location
- Repository: WireMCP
- File: index.js
- Lines: L447-477
Signature
const kerberosLines = kerberosOut.split('\n').filter(line => line.trim());
kerberosLines.forEach(line => {
const [cname, realm, cipher, type, msgType, frameNumber] = line.split('\t');
if (cipher && type) {
let hashFormat = '';
if (msgType === '10' || msgType === '30') { // AS-REQ or TGS-REQ
hashFormat = '$krb5pa$23$';
if (cname) hashFormat += `${cname}$`;
if (realm) hashFormat += `${realm}$`;
hashFormat += cipher;
} else if (msgType === '11') { // AS-REP
hashFormat = '$krb5asrep$23$';
if (cname) hashFormat += `${cname}@`;
if (realm) hashFormat += `${realm}$`;
hashFormat += cipher;
}
if (hashFormat) {
credentials.encrypted.push({
type: 'Kerberos',
hash: hashFormat,
username: cname || 'unknown',
realm: realm || 'unknown',
frame: frameNumber,
crackingMode: msgType === '11' ? 'hashcat -m 18200' : 'hashcat -m 7500'
});
}
}
});
Import
// No import needed — string concatenation is built-in
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| kerberosOut | string | Yes | Tab-separated tshark output: `cname\trealm\tcipher\ttype\tmsgType\tframe` |
Outputs
| Name | Type | Description |
|---|---|---|
| credentials.encrypted | Array<Object> | `{ type: 'Kerberos', hash, username, realm, frame, crackingMode }` |
Usage Examples
Format AS-REQ Hash (msgType 10)
// tshark row: "admin\tEXAMPLE.COM\tciphertext123\t1\t10\t50"
const [cname, realm, cipher, type, msgType, frameNumber] =
"admin\tEXAMPLE.COM\tciphertext123\t1\t10\t50".split('\t');
let hashFormat = '$krb5pa$23$';
hashFormat += `${cname}$`; // admin$
hashFormat += `${realm}$`; // EXAMPLE.COM$
hashFormat += cipher; // ciphertext123
// Result: $krb5pa$23$admin$EXAMPLE.COM$ciphertext123
// Cracking: hashcat -m 7500 hash.txt
Format AS-REP Hash (msgType 11)
const [cname, realm, cipher, type, msgType, frameNumber] =
"svc_user\tDOMAIN.LOCAL\taabbccdd\t1\t11\t75".split('\t');
let hashFormat = '$krb5asrep$23$';
hashFormat += `${cname}@`; // svc_user@
hashFormat += `${realm}$`; // DOMAIN.LOCAL$
hashFormat += cipher; // aabbccdd
// Result: $krb5asrep$23$svc_user@DOMAIN.LOCAL$aabbccdd
// Cracking: hashcat -m 18200 hash.txt
Full Iteration
const kerberosLines = kerberosOut.split('\n').filter(line => line.trim());
kerberosLines.forEach(line => {
const [cname, realm, cipher, type, msgType, frameNumber] = line.split('\t');
if (!cipher || !type) return;
let hashFormat = '';
if (msgType === '10' || msgType === '30') {
hashFormat = `$krb5pa$23$${cname}$${realm}$${cipher}`;
} else if (msgType === '11') {
hashFormat = `$krb5asrep$23$${cname}@${realm}$${cipher}`;
}
if (hashFormat) {
credentials.encrypted.push({
type: 'Kerberos', hash: hashFormat,
username: cname || 'unknown', realm: realm || 'unknown',
frame: frameNumber,
crackingMode: msgType === '11' ? 'hashcat -m 18200' : 'hashcat -m 7500'
});
}
});