Documentation ¶
Index ¶
- Constants
- func EncodeDERTCredentials(domain, username, password []byte) []byte
- func EncodeDERTRequest(msgs []Message, authInfo []byte, pubKeyAuth []byte) []byte
- func HMAC_MD5(key, data []byte) []byte
- func LMOWFv2(password, user, domain string) []byte
- func MD4(data []byte) []byte
- func MD5(data []byte) []byte
- func MIC(exportedSessionKey []byte, ...) []byte
- func NTOWFv2(password, user, domain string) []byte
- func RC4K(key, src []byte) []byte
- type AVPair
- type AuthenticateMessage
- type ChallengeMessage
- type Message
- type NTLMv2
- type NTLMv2Security
- type NVersion
- type NegoToken
- type NegotiateMessage
- type TSCredentials
- type TSCspDataDetail
- type TSPasswordCreds
- type TSRequest
- type TSSmartCardCreds
Constants ¶
View Source
const ( WINDOWS_MINOR_VERSION_0 = 0x00 WINDOWS_MINOR_VERSION_1 = 0x01 WINDOWS_MINOR_VERSION_2 = 0x02 WINDOWS_MINOR_VERSION_3 = 0x03 WINDOWS_MAJOR_VERSION_5 = 0x05 WINDOWS_MAJOR_VERSION_6 = 0x06 NTLMSSP_REVISION_W2K3 = 0x0F )
View Source
const ( MsvAvEOL = 0x0000 MsvAvNbComputerName = 0x0001 MsvAvNbDomainName = 0x0002 MsvAvDnsComputerName = 0x0003 MsvAvDnsDomainName = 0x0004 MsvAvDnsTreeName = 0x0005 MsvAvFlags = 0x0006 MsvAvTimestamp = 0x0007 MsvAvSingleHost = 0x0008 MsvAvTargetName = 0x0009 MsvChannelBindings = 0x000A )
View Source
const ( NTLMSSP_NEGOTIATE_56 = 0x80000000 NTLMSSP_NEGOTIATE_KEY_EXCH = 0x40000000 NTLMSSP_NEGOTIATE_128 = 0x20000000 NTLMSSP_NEGOTIATE_VERSION = 0x02000000 NTLMSSP_NEGOTIATE_TARGET_INFO = 0x00800000 NTLMSSP_REQUEST_NON_NT_SESSION_KEY = 0x00400000 NTLMSSP_NEGOTIATE_IDENTIFY = 0x00100000 NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY = 0x00080000 NTLMSSP_TARGET_TYPE_SERVER = 0x00020000 NTLMSSP_TARGET_TYPE_DOMAIN = 0x00010000 NTLMSSP_NEGOTIATE_ALWAYS_SIGN = 0x00008000 NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED = 0x00002000 NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED = 0x00001000 NTLMSSP_NEGOTIATE_NTLM = 0x00000200 NTLMSSP_NEGOTIATE_LM_KEY = 0x00000080 NTLMSSP_NEGOTIATE_DATAGRAM = 0x00000040 NTLMSSP_NEGOTIATE_SEAL = 0x00000020 NTLMSSP_NEGOTIATE_SIGN = 0x00000010 NTLMSSP_REQUEST_TARGET = 0x00000004 NTLM_NEGOTIATE_OEM = 0x00000002 NTLMSSP_NEGOTIATE_UNICODE = 0x00000001 )
Variables ¶
This section is empty.
Functions ¶
func EncodeDERTCredentials ¶ added in v0.2.0
func EncodeDERTRequest ¶
Types ¶
type AuthenticateMessage ¶
type AuthenticateMessage struct { Signature [8]byte MessageType uint32 `struc:"little"` LmChallengeResponseLen uint16 `struc:"little"` LmChallengeResponseMaxLen uint16 `struc:"little"` LmChallengeResponseBufferOffset uint32 `struc:"little"` NtChallengeResponseLen uint16 `struc:"little"` NtChallengeResponseMaxLen uint16 `struc:"little"` NtChallengeResponseBufferOffset uint32 `struc:"little"` DomainNameLen uint16 `struc:"little"` DomainNameMaxLen uint16 `struc:"little"` DomainNameBufferOffset uint32 `struc:"little"` UserNameLen uint16 `struc:"little"` UserNameMaxLen uint16 `struc:"little"` UserNameBufferOffset uint32 `struc:"little"` WorkstationLen uint16 `struc:"little"` WorkstationMaxLen uint16 `struc:"little"` WorkstationBufferOffset uint32 `struc:"little"` EncryptedRandomSessionLen uint16 `struc:"little"` EncryptedRandomSessionMaxLen uint16 `struc:"little"` EncryptedRandomSessionBufferOffset uint32 `struc:"little"` NegotiateFlags uint32 `struc:"little"` Version NVersion `struc:"little"` MIC [16]byte `struc:"little"` Payload []byte `struc:"skip"` }
func NewAuthenticateMessage ¶
func NewAuthenticateMessage(negFlag uint32, domain, user, workstation []byte, lmchallResp, ntchallResp, enRandomSessKey []byte) *AuthenticateMessage
func (*AuthenticateMessage) BaseLen ¶
func (m *AuthenticateMessage) BaseLen() uint32
func (*AuthenticateMessage) Serialize ¶
func (m *AuthenticateMessage) Serialize() []byte
type ChallengeMessage ¶
type ChallengeMessage struct { Signature []byte `struc:"[8]byte"` MessageType uint32 `struc:"little"` TargetNameLen uint16 `struc:"little"` TargetNameMaxLen uint16 `struc:"little"` TargetNameBufferOffset uint32 `struc:"little"` NegotiateFlags uint32 `struc:"little"` ServerChallenge [8]byte `struc:"little"` Reserved [8]byte `struc:"little"` TargetInfoLen uint16 `struc:"little"` TargetInfoMaxLen uint16 `struc:"little"` TargetInfoBufferOffset uint32 `struc:"little"` Version NVersion `struc:"skip"` Payload []byte `struc:"skip"` }
func NewChallengeMessage ¶
func NewChallengeMessage() *ChallengeMessage
func (*ChallengeMessage) BaseLen ¶
func (m *ChallengeMessage) BaseLen() uint32
total len - payload len
func (*ChallengeMessage) Serialize ¶
func (m *ChallengeMessage) Serialize() []byte
type NTLMv2 ¶
type NTLMv2 struct {
// contains filtered or unexported fields
}
func (*NTLMv2) ComputeResponseV2 ¶ added in v0.2.0
func (n *NTLMv2) ComputeResponseV2(respKeyNT, respKeyLM, serverChallenge, clientChallenge, timestamp, serverInfo []byte) (ntChallResp, lmChallResp, SessBaseKey []byte)
process NTLMv2 Authenticate hash
func (*NTLMv2) GetAuthenticateMessage ¶
func (n *NTLMv2) GetAuthenticateMessage(s []byte) (*AuthenticateMessage, *NTLMv2Security)
func (*NTLMv2) GetEncodedCredentials ¶ added in v0.2.0
func (*NTLMv2) GetNegotiateMessage ¶
func (n *NTLMv2) GetNegotiateMessage() *NegotiateMessage
generate first handshake messgae
type NTLMv2Security ¶ added in v0.2.0
type NTLMv2Security struct { EncryptRC4 *rc4.Cipher DecryptRC4 *rc4.Cipher SigningKey []byte VerifyKey []byte SeqNum uint32 }
func (*NTLMv2Security) GssDecrypt ¶ added in v0.2.0
func (n *NTLMv2Security) GssDecrypt(s []byte) []byte
func (*NTLMv2Security) GssEncrypt ¶ added in v0.2.0
func (n *NTLMv2Security) GssEncrypt(s []byte) []byte
type NVersion ¶
type NVersion struct { ProductMajorVersion uint8 `struc:"little"` ProductMinorVersion uint8 `struc:"little"` ProductBuild uint16 `struc:"little"` Reserved [3]byte `struc:"little"` NTLMRevisionCurrent uint8 `struc:"little"` }
func NewNVersion ¶ added in v0.2.0
func NewNVersion() NVersion
type NegotiateMessage ¶
type NegotiateMessage struct { Signature [8]byte `struc:"little"` MessageType uint32 `struc:"little"` NegotiateFlags uint32 `struc:"little"` DomainNameLen uint16 `struc:"little"` DomainNameMaxLen uint16 `struc:"little"` DomainNameBufferOffset uint32 `struc:"little"` WorkstationLen uint16 `struc:"little"` WorkstationMaxLen uint16 `struc:"little"` WorkstationBufferOffset uint32 `struc:"little"` Version NVersion `struc:"little"` Payload [32]byte `struc:"skip"` }
func NewNegotiateMessage ¶
func NewNegotiateMessage() *NegotiateMessage
func (*NegotiateMessage) Serialize ¶
func (m *NegotiateMessage) Serialize() []byte
type TSCredentials ¶
type TSCredentials struct { CredType int `asn1:"explicit,tag:0"` Credentials []byte `asn1:"explicit,tag:1"` }
func DecodeDERTCredentials ¶ added in v0.2.0
func DecodeDERTCredentials(s []byte) (*TSCredentials, error)
type TSCspDataDetail ¶
type TSPasswordCreds ¶
type TSRequest ¶
type TSRequest struct { Version int `asn1:"explicit,tag:0"` NegoTokens []NegoToken `asn1:"optional,explicit,tag:1"` AuthInfo []byte `asn1:"optional,explicit,tag:2"` PubKeyAuth []byte `asn1:"optional,explicit,tag:3"` }
func DecodeDERTRequest ¶
type TSSmartCardCreds ¶
type TSSmartCardCreds struct { Pin string `asn1:"explicit,tag:0"` CspData []TSCspDataDetail `asn1:"explicit,tag:1"` UserHint string `asn1:"explicit,tag:2"` DomainHint string `asn1:"explicit,tag:3"` }
Click to show internal directories.
Click to hide internal directories.