Documentation
¶
Overview ¶
Index ¶
- Constants
- func ComputeLMResponse(challenge []byte, lmhash []byte) []byte
- func ComputeLMv2Response(challenge []byte, usernameWithDomainOrServer []byte, nthash []byte, ...) []byte
- func ComputeNTLMv1Response(challenge []byte, nthash []byte) []byte
- func ComputeNTLMv2Response(challenge []byte, usernameWithDomainOrServer []byte, nthash []byte, ...) []byte
- func ComputeNTLMv2SessionResponse(challenge []byte, clientNonce []byte, nthash []byte) []byte
- func DisplayNegotiateFlags(ui uint32)
- func LmHash(pwd []byte) []byte
- func NtHash(pwd []byte) []byte
- func ParseAVPair(bs []byte) map[string]interface{}
- func ParseNegotiateFlags(ui uint32) *[32][2]string
- type AVPair
- type AnonymousResponse
- type AuthenticateMsg
- func (am AuthenticateMsg) Display()
- func (am AuthenticateMsg) DomainName() string
- func (am AuthenticateMsg) DomainNameBytes() []byte
- func (am AuthenticateMsg) EncryptedRandomSessionKey() []byte
- func (am AuthenticateMsg) LmChallengeResponse() []byte
- func (am AuthenticateMsg) Marshal(endian byte) []byte
- func (am AuthenticateMsg) NtChallengeResponse() interface{}
- func (am AuthenticateMsg) NtChallengeResponseBytes() []byte
- func (am *AuthenticateMsg) Reset()
- func (am *AuthenticateMsg) SetDomainName(dname []byte)
- func (am *AuthenticateMsg) SetLmResponse(version int, challenge []byte, pwd []byte)
- func (am *AuthenticateMsg) SetNTLMResponse(version int, challenge []byte, pwd []byte)
- func (am *AuthenticateMsg) SetNtResponse(version int, challenge []byte, pwd []byte)
- func (am *AuthenticateMsg) SetUserName(uname []byte)
- func (am *AuthenticateMsg) SetWorkstation(ws []byte)
- func (am *AuthenticateMsg) UnMarshal(bs []byte)
- func (am AuthenticateMsg) UserName() string
- func (am AuthenticateMsg) UserNameBytes() []byte
- func (am AuthenticateMsg) Version() []byte
- func (am AuthenticateMsg) Workstation() string
- func (am AuthenticateMsg) WorkstationBytes() []byte
- type AvPair
- type AvPairType
- type 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 ChallengeMsg
- func (cm ChallengeMsg) Display()
- func (cm ChallengeMsg) Marshal(endian byte) []byte
- func (cm *ChallengeMsg) Reset()
- func (cm *ChallengeMsg) SetServerChallenge(challenge []byte)
- func (cm *ChallengeMsg) SetTargetInfo(tinfo map[string]interface{})
- func (cm *ChallengeMsg) SetTargetName(tname []byte)
- func (cm *ChallengeMsg) String(bs []byte) string
- func (cm ChallengeMsg) TargetInfo() []byte
- func (cm ChallengeMsg) TargetName() string
- func (cm *ChallengeMsg) UnMarshal(bs []byte)
- func (cm ChallengeMsg) Version() []byte
- type LMResponse
- type LMv2Response
- type NTLMResponse
- type NTLMv2ClientChallenge
- type NTLMv2Response
- type NTLMv2SessionResponse
- type NegotiateMsg
- func (nm NegotiateMsg) Display()
- func (nm NegotiateMsg) DomainName() string
- func (nm NegotiateMsg) Marshal(endian byte) []byte
- func (nm *NegotiateMsg) Reset()
- func (nm *NegotiateMsg) SetDomainName(dname []byte)
- func (nm *NegotiateMsg) SetWorkstation(ws []byte)
- func (nm *NegotiateMsg) UnMarshal(bs []byte)
- func (nm NegotiateMsg) Version() []byte
- func (nm NegotiateMsg) Workstation() string
- type VersionStruct
Constants ¶
View Source
const ( NEGOTIATE_56BIT_ENCRYPTION = 0x80000000 NEGOTIATE_EXPLICIT_KEY_EXCHANGE = 0x40000000 NEGOTIATE_128BIT_SESSION_KEY = 0x20000000 NEGOTIATE_R1_UNUSED = 0x10000000 NEGOTIATE_R2_UNUSED = 0x8000000 NEGOTIATE_R3_UNUSED = 0x4000000 NEGOTIATE_VERSION = 0x2000000 NEGOTIATE_R4_UNUSED = 0x1000000 NEGOTIATE_TARGET_INFO = 0x800000 NEGOTIATE_REQUEST_NON_NT_SESSION_KEY = 0x400000 NEGOTIATE_R5_UNUSED = 0x200000 NEGOTIATE_IDENTITY_LEVEL_TOKEN = 0x100000 NEGOTIATE_EXTENDED_SESSION_SECURITY = 0x80000 NEGOTIATE_R6_UNUSED = 0x40000 NEGOTIATE_TARGET_TYPE_SERVER = 0x20000 NEGOTIATE_TARGET_TYPE_DOMAIN = 0x10000 NEGOTIATE_ALWAYS_SIGN = 0x8000 NEGOTIATE_R7_UNUSED = 0x4000 NEGOTIATE_OEM_WORKSTATION_SUPPLIED = 0x2000 NEGOTIATE_OEM_DOMAIN_SUPPLIED = 0x1000 NEGOTIATE_ANONYMOUS = 0x800 NEGOTIATE_R8_UNUSED = 0x400 NEGOTIATE_NTLM = 0x200 NEGOTIATE_R9_UNUSED = 0x100 NEGOTIATE_LM_SESSION_KEY = 0x80 NEGOTIATE_DATAGRAM_CONNECTIONLESS = 0x40 NEGOTIATE_SEAL = 0x20 NEGOTIATE_SIGN = 0x10 NEGOTIATE_R10_UNUSED = 0x8 NEGOTIATE_REQUEST_TARGET_NAME = 0x4 NEGOTIATE_OEM_CHARSET = 0x2 NEGOTIATE_UNICODE_CHARSET = 0x1 )
View Source
const AuthenticateMsgPayloadOffset = 64
View Source
const ChallengeMsgPayloadOffset = 48
View Source
const (
LmSalt = "KGS!@#$%"
)
View Source
const NegotiateMsgPayloadOffset = 32
Variables ¶
This section is empty.
Functions ¶
func ComputeLMResponse ¶
func ComputeLMv2Response ¶
func ComputeNTLMv1Response ¶
func ComputeNTLMv2Response ¶
func DisplayNegotiateFlags ¶
func DisplayNegotiateFlags(ui uint32)
func ParseAVPair ¶
func ParseNegotiateFlags ¶
Types ¶
type AnonymousResponse ¶
type AnonymousResponse struct { }
type AuthenticateMsg ¶
type AuthenticateMsg struct { Signature [8]byte MessageType uint32 LmChallengeResponseLen uint16 LmChallengeResponseMaxLen uint16 LmChallengeResponseBufferOffset uint32 NtChallengeResponseLen uint16 NtChallengeResponseMaxLen uint16 NtChallengeResponseBufferOffset uint32 DomainNameLen uint16 DomainNameMaxLen uint16 DomainNameBufferOffset uint32 UserNameLen uint16 UserNameMaxLen uint16 UserNameBufferOffset uint32 WorkstationLen uint16 WorkstationMaxLen uint16 WorkstationBufferOffset uint32 EncryptedRandomSessionKeyLen uint16 EncryptedRandomSessionKeyMaxLen uint16 EncryptedRandomSessionKeyBufferOffset uint32 NegotiateFlags uint32 // The MIC field is omitted in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. // MIC [16]byte Payload []byte // contains filtered or unexported fields }
func NewAuthenticateMsg ¶
func NewAuthenticateMsg(bs []byte) *AuthenticateMsg
func (AuthenticateMsg) Display ¶
func (am AuthenticateMsg) Display()
func (AuthenticateMsg) DomainName ¶
func (am AuthenticateMsg) DomainName() string
func (AuthenticateMsg) DomainNameBytes ¶
func (am AuthenticateMsg) DomainNameBytes() []byte
func (AuthenticateMsg) EncryptedRandomSessionKey ¶
func (am AuthenticateMsg) EncryptedRandomSessionKey() []byte
func (AuthenticateMsg) LmChallengeResponse ¶
func (am AuthenticateMsg) LmChallengeResponse() []byte
func (AuthenticateMsg) Marshal ¶
func (am AuthenticateMsg) Marshal(endian byte) []byte
func (AuthenticateMsg) NtChallengeResponse ¶
func (am AuthenticateMsg) NtChallengeResponse() interface{}
func (AuthenticateMsg) NtChallengeResponseBytes ¶
func (am AuthenticateMsg) NtChallengeResponseBytes() []byte
func (*AuthenticateMsg) Reset ¶
func (am *AuthenticateMsg) Reset()
func (*AuthenticateMsg) SetDomainName ¶
func (am *AuthenticateMsg) SetDomainName(dname []byte)
func (*AuthenticateMsg) SetLmResponse ¶
func (am *AuthenticateMsg) SetLmResponse(version int, challenge []byte, pwd []byte)
func (*AuthenticateMsg) SetNTLMResponse ¶
func (am *AuthenticateMsg) SetNTLMResponse(version int, challenge []byte, pwd []byte)
func (*AuthenticateMsg) SetNtResponse ¶
func (am *AuthenticateMsg) SetNtResponse(version int, challenge []byte, pwd []byte)
func (*AuthenticateMsg) SetUserName ¶
func (am *AuthenticateMsg) SetUserName(uname []byte)
func (*AuthenticateMsg) SetWorkstation ¶
func (am *AuthenticateMsg) SetWorkstation(ws []byte)
func (*AuthenticateMsg) UnMarshal ¶
func (am *AuthenticateMsg) UnMarshal(bs []byte)
func (AuthenticateMsg) UserName ¶
func (am AuthenticateMsg) UserName() string
func (AuthenticateMsg) UserNameBytes ¶
func (am AuthenticateMsg) UserNameBytes() []byte
func (AuthenticateMsg) Version ¶
func (am AuthenticateMsg) Version() []byte
func (AuthenticateMsg) Workstation ¶
func (am AuthenticateMsg) Workstation() string
func (AuthenticateMsg) WorkstationBytes ¶
func (am AuthenticateMsg) WorkstationBytes() []byte
type AvPair ¶
type AvPair struct { AvId AvPairType AvLen uint16 Value []byte }
AvPair as described by MS-NLMP
func ReadAvPair ¶
func (*AvPair) UnicodeStringValue ¶
type AvPairType ¶
type AvPairType uint16
const ( // Indicates that this is the last AV_PAIR in the list. AvLen MUST be 0. This type of information MUST be present in the AV pair list. MsvAvEOL AvPairType = iota // The server's NetBIOS computer name. The name MUST be in Unicode, and is not null-terminated. This type of information MUST be present in the AV_pair list. MsvAvNbComputerName // The server's NetBIOS domain name. The name MUST be in Unicode, and is not null-terminated. This type of information MUST be present in the AV_pair list. MsvAvNbDomainName // The fully qualified domain name (FQDN (1)) of the computer. The name MUST be in Unicode, and is not null-terminated. MsvAvDnsComputerName // The FQDN (2) of the domain. The name MUST be in Unicode, and is not null-terminate. MsvAvDnsDomainName // The FQDN (2) of the forest. The name MUST be in Unicode, and is not null-terminated.<11> MsvAvDnsTreeName // A 32-bit value indicating server or client configuration. // 0x00000001: indicates to the client that the account authentication is constrained. // 0x00000002: indicates that the client is providing message integrity in the MIC field (section 2.2.1.3) in the AUTHENTICATE_MESSAGE.<12> // 0x00000004: indicates that the client is providing a target SPN generated from an untrusted source.<13> MsvAvFlags // A FILETIME structure ([MS-DTYP] section 2.3.1) in little-endian byte order that contains the server local time.<14> MsvAvTimestamp //A Restriction_Encoding (section 2.2.2.2) structure. The Value field contains a structure representing the integrity level of the security principal, as well as a MachineID created at computer startup to identify the calling machine.<15> MsAvRestrictions // The SPN of the target server. The name MUST be in Unicode and is not null-terminated.<16> MsvAvTargetName // annel bindings hash. The Value field contains an MD5 hash ([RFC4121] section 4.1.1.2) of a gss_channel_bindings_struct ([RFC2744] section 3.11). // An all-zero value of the hash is used to indicate absence of channel bindings.<17> MsvChannelBindings )
MS-NLMP - 2.2.2.1 AV_PAIR
type AvPairs ¶
type AvPairs struct {
List []AvPair
}
Helper struct that contains a list of AvPairs with helper methods for running through them
func ReadAvPairs ¶
func (*AvPairs) AddAvPair ¶
func (p *AvPairs) AddAvPair(avId AvPairType, bytes []byte)
func (*AvPairs) ByteValue ¶
func (p *AvPairs) ByteValue(avType AvPairType) (result []byte)
func (*AvPairs) Find ¶
func (p *AvPairs) Find(avType AvPairType) (result *AvPair)
func (*AvPairs) StringValue ¶
func (p *AvPairs) StringValue(avType AvPairType) (result string)
type ChallengeMsg ¶
type ChallengeMsg struct { Signature [8]byte MessageType uint32 TargetNameLen uint16 TargetNameMaxLen uint16 TargetNameBufferOffset uint32 NegotiateFlags uint32 ServerChallenge [8]byte Reserved [8]byte TargetInfoLen uint16 TargetInfoMaxLen uint16 TargetInfoBufferOffset uint32 // Version is variable, saved in Payload field // Version [8]byte Payload []byte // contains filtered or unexported fields }
func NewChallengeMsg ¶
func NewChallengeMsg(bs []byte) *ChallengeMsg
func (ChallengeMsg) Display ¶
func (cm ChallengeMsg) Display()
func (ChallengeMsg) Marshal ¶
func (cm ChallengeMsg) Marshal(endian byte) []byte
func (*ChallengeMsg) Reset ¶
func (cm *ChallengeMsg) Reset()
func (*ChallengeMsg) SetServerChallenge ¶
func (cm *ChallengeMsg) SetServerChallenge(challenge []byte)
func (*ChallengeMsg) SetTargetInfo ¶
func (cm *ChallengeMsg) SetTargetInfo(tinfo map[string]interface{})
func (*ChallengeMsg) SetTargetName ¶
func (cm *ChallengeMsg) SetTargetName(tname []byte)
func (*ChallengeMsg) String ¶
func (cm *ChallengeMsg) String(bs []byte) string
func (ChallengeMsg) TargetInfo ¶
func (cm ChallengeMsg) TargetInfo() []byte
func (ChallengeMsg) TargetName ¶
func (cm ChallengeMsg) TargetName() string
func (*ChallengeMsg) UnMarshal ¶
func (cm *ChallengeMsg) UnMarshal(bs []byte)
func (ChallengeMsg) Version ¶
func (cm ChallengeMsg) Version() []byte
type LMResponse ¶
type LMResponse struct {
Response [24]byte
}
type LMv2Response ¶
type NTLMResponse ¶
type NTLMResponse struct {
Response [24]byte
}
type NTLMv2ClientChallenge ¶
type NTLMv2ClientChallenge struct { RespType byte HiRespType byte Reserved1 uint16 Reserved2 uint32 TimeStamp uint64 ChallengeFromClient [8]byte Reserved3 uint32 AVPair map[string]interface{} }
func (NTLMv2ClientChallenge) Marshal ¶
func (cc NTLMv2ClientChallenge) Marshal() []byte
type NTLMv2Response ¶
type NTLMv2Response struct { Response [16]byte ClientChallenge NTLMv2ClientChallenge }
func ParseNTLMv2Response ¶
func ParseNTLMv2Response(bs []byte) *NTLMv2Response
type NTLMv2SessionResponse ¶
type NTLMv2SessionResponse struct {
Response [24]byte
}
type NegotiateMsg ¶
type NegotiateMsg struct { Signature [8]byte MessageType uint32 NegotiateFlags uint32 DomainNameLen uint16 DomainNameMaxLen uint16 DomainNameBufferOffset uint32 WorkstationLen uint16 WorkstationMaxLen uint16 WorkstationBufferOffset uint32 // Version is variable, saved in Payload field // Version [8]byte Payload []byte // contains filtered or unexported fields }
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-nlmp/
func NewNegotiateMsg ¶
func NewNegotiateMsg(bs []byte) *NegotiateMsg
func (NegotiateMsg) Display ¶
func (nm NegotiateMsg) Display()
func (NegotiateMsg) Marshal ¶
func (nm NegotiateMsg) Marshal(endian byte) []byte
func (*NegotiateMsg) Reset ¶
func (nm *NegotiateMsg) Reset()
func (*NegotiateMsg) SetDomainName ¶
func (nm *NegotiateMsg) SetDomainName(dname []byte)
func (*NegotiateMsg) SetWorkstation ¶
func (nm *NegotiateMsg) SetWorkstation(ws []byte)
func (*NegotiateMsg) UnMarshal ¶
func (nm *NegotiateMsg) UnMarshal(bs []byte)
func (NegotiateMsg) Version ¶
func (nm NegotiateMsg) Version() []byte
type VersionStruct ¶
type VersionStruct struct { ProductMajorVersion uint8 ProductMinorVersion uint8 ProductBuild uint16 Reserved []byte NTLMRevisionCurrent uint8 }
func ReadVersionStruct ¶
func ReadVersionStruct(structSource []byte) (*VersionStruct, error)
func (*VersionStruct) Bytes ¶
func (v *VersionStruct) Bytes() []byte
func (*VersionStruct) String ¶
func (v *VersionStruct) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.