Skip to content

feat(kerberos): native KerberosClient + ASREPRoast (no external Kerberos library)#78

Open
0xbbuddha wants to merge 5 commits intoTheManticoreProject:mainfrom
0xbbuddha:feat/kerberos-client-asreproast
Open

feat(kerberos): native KerberosClient + ASREPRoast (no external Kerberos library)#78
0xbbuddha wants to merge 5 commits intoTheManticoreProject:mainfrom
0xbbuddha:feat/kerberos-client-asreproast

Conversation

@0xbbuddha
Copy link
Copy Markdown

@0xbbuddha 0xbbuddha commented Mar 29, 2026

Summary

Implements Kerberos protocol support natively in Manticore, without relying on
an external Kerberos library for authentication primitives.

New crypto primitives

  • crypto/nfold — N-FOLD function (RFC 3961 §5.1)
  • crypto/aescts — AES-CTS encryption mode (RFC 3962)

New network/kerberos/messages package

All Kerberos ASN.1 message types with Marshal/Unmarshal per DG.02:
ASReq, ASRep, TGSReq, TGSRep, KRBError, Ticket, APReq,
Authenticator, PAEncTSEnc, ETypeInfo2, EncASRepPart, EncTGSRepPart

New network/kerberos/crypto package

Key derivation and encryption for all supported etypes:

  • RC4-HMAC (etype 23) — StringToKey via NT hash, per RFC 4757
  • AES-128/256-CTS-HMAC-SHA1-96 (etype 17/18) — PBKDF2 + N-FOLD + DK, per RFC 3962

network/kerberos — rewritten

  • transport.go — raw TCP transport to KDC with 4-byte length prefix (RFC 4120 §7.2.2)
  • asreproast.goASREPRoast(): sends AS-REQ without PA-DATA, returns raw
    EncryptedData cipher from AS-REP for offline cracking
  • client.goKerberosClient with:
    • WithPassword — derive key + PA-ENC-TIMESTAMP pre-auth (probes KDC for etype/salt via ETYPE-INFO2)
    • GetTGT — full AS-REQ/AS-REP exchange, decrypts EncASRepPart, stores session key
    • GetTGS — builds AP-REQ from TGT, sends TGS-REQ, decrypts EncTGSRepPart
    • Destroy — zeroes key material

  Implements a WinRM client library (MS-WSMV over HTTP, port 5985/5986)
  with full NTLMv2 message-level sealing (SIGN + SEAL + KEY_EXCH) as
  required by the Windows WinRM service.

  Public API:
    c := client.NewClient(host, port)
    c.Connect()
    err := c.SessionSetup(creds)

  Structure:
    network/winrm/types/       — protocol constants
    network/winrm/transport/   — raw TCP transport (NTLM connection-binding)
    network/winrm/client/      — Client, SessionSetup, NTLM sealing pipeline
@0xbbuddha 0xbbuddha changed the title Feat/kerberos client asreproast feat(kerberos): client asreproast Mar 29, 2026
  Add crypto/nfold (RFC 3961 N-FOLD), crypto/aescts (AES-CTS / RFC 3962),
  network/kerberos/messages (all ASN.1 types with Marshal/Unmarshal per DG.02),
  network/kerberos/crypto (RC4-HMAC etype 23, AES-128/256 etype 17/18 with
  PBKDF2 + N-FOLD key derivation), and a fully native KerberosClient and
  ASREPRoast that depend on no external Kerberos library.

  KerberosInit (gokrb5 config helper) is kept for LDAP GSSAPI binds in
  network/ldap.
@0xbbuddha 0xbbuddha changed the title feat(kerberos): client asreproast feat(kerberos): native KerberosClient + ASREPRoast (no external Kerberos library) Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant