Versions in this module Expand all Collapse all v1 v1.2.1 May 6, 2021 v1.2.0 May 4, 2021 v1.1.0 Jul 21, 2020 v1.0.1 Jun 14, 2020 Changes in this version + const BytesPayload + const OemStringPayload + const UnicodeStringPayload + func FlagsToString(flags uint32) 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 uint32 + 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 + 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 + func ReadAvPairs(data []byte) *AvPairs + func (p *AvPairs) AddAvPair(avId AvPairType, bytes []byte) + 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) String() string + func (p *AvPairs) StringValue(avType AvPairType) (result string) + type ChallengeMessage struct + MessageType uint32 + NegotiateFlags uint32 + Payload []byte + Reserved []byte + ServerChallenge []byte + Signature []byte + TargetInfo *AvPairs + TargetInfoPayloadStruct *PayloadStruct + 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) + GenerateNegotiateMessage func() (*NegotiateMessage, error) + Mac func(message []byte, sequenceNumber int) ([]byte, error) + ProcessChallengeMessage func(*ChallengeMessage) error + Seal func(message []byte) ([]byte, error) + SetMode func(mode Mode) + SetUserInfo func(username string, password string, domain string) + Sign 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 + func (l *LmV1Response) String() string + type LmV2Response struct + ChallengeFromClient []byte + Response []byte + func ReadLmV2Response(bytes []byte) *LmV2Response + 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 uint32) bool + func (f NegotiateFlag) Set(flags uint32) uint32 + func (f NegotiateFlag) String() string + func (f NegotiateFlag) Unset(flags uint32) uint32 + type NegotiateMessage struct + Bytes []byte + DomainNameFields *PayloadStruct + MessageType uint32 + NegotiateFlags uint32 + Payload []byte + PayloadOffset int + Signature []byte + Version *VersionStruct + WorkstationFields *PayloadStruct + 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 ReadPayloadStruct(startByte int, bytes []byte, PayloadType int) (*PayloadStruct, error) + func ReadStringPayload(startByte int, bytes []byte) (*PayloadStruct, error) + func (p *PayloadStruct) Bytes() []byte + func (p *PayloadStruct) String() string + 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, error) + SetMode func(mode Mode) + SetServerChallenge func(challenge []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 uint32 + ServerSealingKey []byte + ServerSigningKey []byte + type V1ClientSession struct + func (n *V1ClientSession) GenerateAuthenticateMessage() (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) GetUserInfo() (string, string, string) + func (n *V1Session) Seal(message []byte) ([]byte, error) + func (n *V1Session) SetMode(mode Mode) + func (n *V1Session) SetUserInfo(username string, password string, domain string) + func (n *V1Session) Sign(message []byte) ([]byte, error) + func (n *V1Session) Version() int + type V2ClientSession struct + func (n *V2ClientSession) GenerateAuthenticateMessage() (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) GetUserInfo() (string, string, string) + func (n *V2Session) Seal(message []byte) ([]byte, error) + func (n *V2Session) SetMode(mode Mode) + func (n *V2Session) SetUserInfo(username string, password string, domain string) + func (n *V2Session) Sign(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