Versions in this module Expand all Collapse all v0 v0.0.1 Apr 14, 2024 Changes in this version + const BytesPayload + const OemStringPayload + const UnicodeStringPayload + func FlagsToString(flags NegotiateFlags) string + func GetFlagName(flag NegotiateFlag) string + func MacsEqual(slice1, slice2 []byte) bool + func NtlmV2Mac(message []byte, sequenceNumber int, handle *rc4P.Cipher, ...) []byte + func NtlmVCommonMac(message []byte, sequenceNumber int, sealingKey, signingKey []byte, ...) []byte + type AuthenticateMessage struct + DomainName *PayloadStruct + EncryptedRandomSessionKey *PayloadStruct + LmChallengeResponse *PayloadStruct + LmV1Response *LmV1Response + LmV2Response *LmV2Response + MessageType uint32 + Mic []byte + NegotiateFlags NegotiateFlags + NtChallengeResponseFields *PayloadStruct + NtlmV1Response *NtlmV1Response + NtlmV2Response *NtlmV2Response + Payload []byte + Signature []byte + UserName *PayloadStruct + Version *VersionStruct + Workstation *PayloadStruct + func ParseAuthenticateMessage(body []byte, ntlmVersion int) (*AuthenticateMessage, error) + func (a *AuthenticateMessage) Bytes() []byte + func (a *AuthenticateMessage) ClientChallenge() (response []byte) + func (a *AuthenticateMessage) String() string + type AvPair struct + AvId AvPairType + AvLen uint16 + Value []byte + func ReadAvPair(data []byte, offset int) (*AvPair, error) + func (a *AvPair) Bytes() (result []byte) + func (a *AvPair) String() string + func (a *AvPair) UnicodeStringValue() string + type AvPairType uint16 + const MsAvRestrictions + const MsvAvDnsComputerName + const MsvAvDnsDomainName + const MsvAvDnsTreeName + const MsvAvEOL + const MsvAvFlags + const MsvAvNbComputerName + const MsvAvNbDomainName + const MsvAvTargetName + const MsvAvTimestamp + const MsvChannelBindings + type AvPairs struct + List []AvPair + Reserved []byte + func ReadAvPairs(data []byte) (*AvPairs, error) + func (p *AvPairs) AddAvPair(avId AvPairType, bytes []byte) + func (p *AvPairs) AddAvPairPos(pos int, avId AvPairType, bytes []byte) + func (p *AvPairs) AddAvPairString(avId AvPairType, value string) + func (p *AvPairs) ByteValue(avType AvPairType) (result []byte) + func (p *AvPairs) Bytes() (result []byte) + func (p *AvPairs) Find(avType AvPairType) (result *AvPair) + func (p *AvPairs) PrependAvPair(avId AvPairType, bytes []byte) + func (p *AvPairs) PrependAvPairString(avId AvPairType, value string) + func (p *AvPairs) String() string + func (p *AvPairs) StringValue(avType AvPairType) (result string) + type ChallengeMessage struct + MessageType uint32 + NegotiateFlags NegotiateFlags + Payload []byte + Reserved []byte + ServerChallenge []byte + Signature []byte + TargetInfo *AvPairs + TargetName *PayloadStruct + Version *VersionStruct + func ParseChallengeMessage(body []byte) (*ChallengeMessage, error) + func (c *ChallengeMessage) Bytes() []byte + func (c *ChallengeMessage) String() string + type ClientSession interface + GenerateAuthenticateMessage func() (*AuthenticateMessage, error) + GenerateAuthenticateMessageAV func() (*AuthenticateMessage, error) + GenerateNegotiateMessage func() (*NegotiateMessage, error) + GetSequenceNumber func() uint32 + Mac func(message []byte, sequenceNumber int) ([]byte, error) + ProcessChallengeMessage func(*ChallengeMessage) error + Seal func(message []byte) ([]byte, []byte, error) + SealV2 func(message []byte, messageToSign []byte) ([]byte, []byte, error) + SetMode func(mode Mode) + SetNTHash func(nthash []byte) + SetSequenceNumber func(sequence uint32) + SetTarget func(target string) + SetUserInfo func(username string, password string, domain string) + Sign func(message []byte) ([]byte, error) + UnSeal func(message []byte) ([]byte, error) + VerifyMac func(message, expectedMac []byte, sequenceNumber int) (bool, error) + func CreateClientSession(version Version, mode Mode) (n ClientSession, err error) + type LmV1Response struct + Response []byte + func ReadLmV1Response(bytes []byte) (*LmV1Response, error) + func (l *LmV1Response) String() string + type LmV2Response struct + ChallengeFromClient []byte + Response []byte + func ReadLmV2Response(bytes []byte) (*LmV2Response, error) + func (l *LmV2Response) String() string + type Mode int + const ConnectionOrientedMode + const ConnectionlessMode + type NegotiateFlag uint32 + const NTLMSSP_ANONYMOUS + const NTLMSSP_NEGOTIATE_128 + const NTLMSSP_NEGOTIATE_56 + const NTLMSSP_NEGOTIATE_ALWAYS_SIGN + const NTLMSSP_NEGOTIATE_DATAGRAM + const NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY + const NTLMSSP_NEGOTIATE_IDENTIFY + const NTLMSSP_NEGOTIATE_KEY_EXCH + const NTLMSSP_NEGOTIATE_LM_KEY + const NTLMSSP_NEGOTIATE_NTLM + const NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED + const NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED + const NTLMSSP_NEGOTIATE_SEAL + const NTLMSSP_NEGOTIATE_SIGN + const NTLMSSP_NEGOTIATE_TARGET_INFO + const NTLMSSP_NEGOTIATE_UNICODE + const NTLMSSP_NEGOTIATE_VERSION + const NTLMSSP_R1 + const NTLMSSP_R10 + const NTLMSSP_R2 + const NTLMSSP_R3 + const NTLMSSP_R4 + const NTLMSSP_R5 + const NTLMSSP_R6 + const NTLMSSP_R7 + const NTLMSSP_R8 + const NTLMSSP_R9 + const NTLMSSP_REQUEST_NON_NT_SESSION_KEY + const NTLMSSP_REQUEST_TARGET + const NTLMSSP_TARGET_TYPE_DOMAIN + const NTLMSSP_TARGET_TYPE_SERVER + const NTLM_NEGOTIATE_OEM + func (f NegotiateFlag) IsSet(flags NegotiateFlags) bool + func (f NegotiateFlag) Set(flags NegotiateFlags) NegotiateFlags + func (f NegotiateFlag) String() string + func (f NegotiateFlag) Unset(flags NegotiateFlags) NegotiateFlags + type NegotiateFlags uint32 + func ReadNegotiateFlags(bytes []byte) NegotiateFlags + func (f NegotiateFlags) Bytes() []byte + func (f NegotiateFlags) String() string + func (f NegotiateFlags) Uint32() uint32 + type NegotiateMessage struct + DomainNameFields *PayloadStruct + MessageType uint32 + NegotiateFlags NegotiateFlags + Payload []byte + Signature []byte + Version *VersionStruct + WorkstationFields *PayloadStruct + func ParseNegotiateMessage(body []byte) (*NegotiateMessage, error) + func (nm *NegotiateMessage) Bytes() []byte + type NtlmV1Response struct + Response []byte + func ReadNtlmV1Response(bytes []byte) (*NtlmV1Response, error) + func (n *NtlmV1Response) String() string + type NtlmV2ClientChallenge struct + AvPairs *AvPairs + ChallengeFromClient []byte + HiRespType byte + Reserved1 uint16 + Reserved2 uint32 + Reserved3 uint32 + RespType byte + TimeStamp []byte + func (n *NtlmV2ClientChallenge) String() string + type NtlmV2Response struct + NtlmV2ClientChallenge *NtlmV2ClientChallenge + Response []byte + func ReadNtlmV2Response(bytes []byte) (*NtlmV2Response, error) + func (n *NtlmV2Response) String() string + type NtlmsspMessageSignature struct + ByteData []byte + CheckSum []byte + RandomPad []byte + SeqNum []byte + Version []byte + func (n *NtlmsspMessageSignature) Bytes() []byte + func (n *NtlmsspMessageSignature) String() string + type PayloadStruct struct + Len uint16 + MaxLen uint16 + Offset uint32 + Payload []byte + Type int + func CreateBytePayload(bytes []byte) (*PayloadStruct, error) + func CreateStringPayload(value string) (*PayloadStruct, error) + func ReadBytePayload(startByte int, bytes []byte) (*PayloadStruct, error) + func ReadOemPayload(startByte int, bytes []byte) (*PayloadStruct, error) + func ReadPayloadStruct(startByte int, bytes []byte, PayloadType int) (*PayloadStruct, error) + func ReadUnicodePayload(startByte int, bytes []byte) (*PayloadStruct, error) + func (p *PayloadStruct) Bytes() []byte + func (p *PayloadStruct) String() string + type ServerData struct + func (s *ServerData) SetComputerName(name string) + func (s *ServerData) SetDnsComputerName(name string) + func (s *ServerData) SetDnsDomainName(domain string) + func (s *ServerData) SetDnsTreeName(tree string) + func (s *ServerData) SetDomainName(domain string) + func (s *ServerData) SetRequireNtHash(requireNt bool) + type ServerSession interface + GenerateChallengeMessage func() (*ChallengeMessage, error) + GetSessionData func() *SessionData + GetUserInfo func() (string, string, string) + Mac func(message []byte, sequenceNumber int) ([]byte, error) + ProcessAuthenticateMessage func(*AuthenticateMessage) error + ProcessNegotiateMessage func(*NegotiateMessage) error + Seal func(message []byte) ([]byte, []byte, error) + SetComputerName func(name string) + SetDnsComputerName func(name string) + SetDnsDomainName func(domain string) + SetDnsTreeName func(tree string) + SetDomainName func(domain string) + SetMode func(mode Mode) + SetRequireNtHash func(requireNt bool) + SetServerChallenge func(challege []byte) + SetUserInfo func(username string, password string, domain string) + Sign func(message []byte) ([]byte, error) + VerifyMac func(message, expectedMac []byte, sequenceNumber int) (bool, error) + Version func() int + func CreateServerSession(version Version, mode Mode) (n ServerSession, err error) + type SessionData struct + ClientSealingKey []byte + ClientSigningKey []byte + NegotiateFlags NegotiateFlags + ServerSealingKey []byte + ServerSigningKey []byte + type SingleHostData struct + CustomData []byte + MachineID []byte + Size uint32 + Z4 uint32 + func (shd *SingleHostData) Bytes() []byte + type V1ClientSession struct + func (n *V1ClientSession) GenerateAuthenticateMessage() (am *AuthenticateMessage, err error) + func (n *V1ClientSession) GenerateAuthenticateMessageAV() (am *AuthenticateMessage, err error) + func (n *V1ClientSession) GenerateNegotiateMessage() (nm *NegotiateMessage, err error) + func (n *V1ClientSession) Mac(message []byte, sequenceNumber int) ([]byte, error) + func (n *V1ClientSession) ProcessChallengeMessage(cm *ChallengeMessage) (err error) + func (n *V1ClientSession) VerifyMac(message, expectedMac []byte, sequenceNumber int) (bool, error) + type V1ServerSession struct + func (n *V1ServerSession) GenerateChallengeMessage() (cm *ChallengeMessage, err error) + func (n *V1ServerSession) GetSessionData() *SessionData + func (n *V1ServerSession) Mac(message []byte, sequenceNumber int) ([]byte, error) + func (n *V1ServerSession) ProcessAuthenticateMessage(am *AuthenticateMessage) (err error) + func (n *V1ServerSession) ProcessNegotiateMessage(nm *NegotiateMessage) (err error) + func (n *V1ServerSession) SetServerChallenge(challenge []byte) + func (n *V1ServerSession) VerifyMac(message, expectedMac []byte, sequenceNumber int) (bool, error) + type V1Session struct + func (n *V1Session) GetSequenceNumber() uint32 + func (n *V1Session) GetUserInfo() (string, string, string) + func (n *V1Session) Seal(message []byte) ([]byte, []byte, error) + func (n *V1Session) SealV2(message []byte, messageToSign []byte) ([]byte, []byte, error) + func (n *V1Session) SetMode(mode Mode) + func (n *V1Session) SetNTHash(nthash []byte) + func (n *V1Session) SetSequenceNumber(sequence uint32) + func (n *V1Session) SetTarget(target string) + func (n *V1Session) SetUserInfo(username string, password string, domain string) + func (n *V1Session) Sign(message []byte) ([]byte, error) + func (n *V1Session) UnSeal(message []byte) ([]byte, error) + func (n *V1Session) Version() int + type V2ClientSession struct + func (n *V2ClientSession) GenerateAuthenticateMessage() (am *AuthenticateMessage, err error) + func (n *V2ClientSession) GenerateAuthenticateMessageAV() (am *AuthenticateMessage, err error) + func (n *V2ClientSession) GenerateNegotiateMessage() (nm *NegotiateMessage, err error) + func (n *V2ClientSession) Mac(message []byte, sequenceNumber int) ([]byte, error) + func (n *V2ClientSession) ProcessChallengeMessage(cm *ChallengeMessage) (err error) + func (n *V2ClientSession) VerifyMac(message, expectedMac []byte, sequenceNumber int) (bool, error) + type V2ServerSession struct + func (n *V2ServerSession) GenerateChallengeMessage() (cm *ChallengeMessage, err error) + func (n *V2ServerSession) GetSessionData() *SessionData + func (n *V2ServerSession) Mac(message []byte, sequenceNumber int) ([]byte, error) + func (n *V2ServerSession) ProcessAuthenticateMessage(am *AuthenticateMessage) (err error) + func (n *V2ServerSession) ProcessNegotiateMessage(nm *NegotiateMessage) (err error) + func (n *V2ServerSession) SetServerChallenge(challenge []byte) + func (n *V2ServerSession) VerifyMac(message, expectedMac []byte, sequenceNumber int) (bool, error) + type V2Session struct + func (n *V2Session) GetSequenceNumber() uint32 + func (n *V2Session) GetUserInfo() (string, string, string) + func (n *V2Session) Seal(message []byte) ([]byte, []byte, error) + func (n *V2Session) SealV2(messageToSeal []byte, messageToSign []byte) ([]byte, []byte, error) + func (n *V2Session) SetMode(mode Mode) + func (n *V2Session) SetNTHash(nthash []byte) + func (n *V2Session) SetSequenceNumber(sequence uint32) + func (n *V2Session) SetTarget(target string) + func (n *V2Session) SetUserInfo(username string, password string, domain string) + func (n *V2Session) Sign(message []byte) ([]byte, error) + func (n *V2Session) UnSeal(message []byte) ([]byte, error) + func (n *V2Session) Version() int + type Version int + const Version1 + const Version2 + type VersionStruct struct + NTLMRevisionCurrent uint8 + ProductBuild uint16 + ProductMajorVersion uint8 + ProductMinorVersion uint8 + Reserved []byte + func ReadVersionStruct(structSource []byte) (*VersionStruct, error) + func (v *VersionStruct) Bytes() []byte + func (v *VersionStruct) String() string