feat(kerberos): native KerberosClient + ASREPRoast (no external Kerberos library)#78
Open
0xbbuddha wants to merge 5 commits intoTheManticoreProject:mainfrom
Open
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/messagespackageAll Kerberos ASN.1 message types with
Marshal/Unmarshalper DG.02:ASReq,ASRep,TGSReq,TGSRep,KRBError,Ticket,APReq,Authenticator,PAEncTSEnc,ETypeInfo2,EncASRepPart,EncTGSRepPartNew
network/kerberos/cryptopackageKey derivation and encryption for all supported etypes:
StringToKeyvia NT hash, per RFC 4757network/kerberos— rewrittentransport.go— raw TCP transport to KDC with 4-byte length prefix (RFC 4120 §7.2.2)asreproast.go—ASREPRoast(): sends AS-REQ without PA-DATA, returns rawEncryptedDatacipher from AS-REP for offline crackingclient.go—KerberosClientwith:WithPassword— derive key + PA-ENC-TIMESTAMP pre-auth (probes KDC for etype/salt via ETYPE-INFO2)GetTGT— full AS-REQ/AS-REP exchange, decryptsEncASRepPart, stores session keyGetTGS— builds AP-REQ from TGT, sends TGS-REQ, decryptsEncTGSRepPartDestroy— zeroes key material