msrdp

package
v1.3.6-beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TPDU_CONNECTION_REQUEST                                 = 0xE0
	TPDU_CONNECTION_CONFIRM                                 = 0xD0
	TPDU_DISCONNECT_REQUEST                                 = 0x80
	TPDU_DATA                                               = 0xF0
	TPDU_ERROR                                              = 0x70
	TYPE_RDP_NEG_REQ                        NegotiationType = 0x01
	TYPE_RDP_NEG_RSP                                        = 0x02
	TYPE_RDP_NEG_FAILURE                                    = 0x03
	RESTRICTED_ADMIN_MODE_REQUIRED                          = 0x01
	REDIRECTED_AUTHENTICATION_MODE_REQUIRED                 = 0x02
	CORRELATION_INFO_PRESENT                                = 0x03
	PROTOCOL_RDP                            uint32          = 0x00000000
	PROTOCOL_SSL                                            = 0x00000001
	PROTOCOL_HYBRID                                         = 0x00000002
	PROTOCOL_RDSTLS                                         = 0x00000004
	PROTOCOL_HYBRID_EX                                      = 0x00000008
	PROTOCOL_RDSAAD                                         = 0x00000010
)
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
)
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
)

Variables

This section is empty.

Functions

func CalcNTLMHash

func CalcNTLMHash(password, user, domain string) ([]byte, []byte)

func CalcNetNTLMHash

func CalcNetNTLMHash(challengeData map[string]any, block []byte, nt, lm []byte) ([]byte, []byte, []byte)

func GenRdpSubProtocol

func GenRdpSubProtocol(data map[string]any, key string) ([]byte, error)

func MD4

func MD4(data []byte) []byte

func ParseRdpSubProtocol

func ParseRdpSubProtocol(reader io.Reader, key string) (any, error)

func UnicodeEncode

func UnicodeEncode(p string) []byte

Types

type GssSecurity

type GssSecurity interface {
	GssEncrypt([]byte) []byte
	GssDecrypt([]byte) []byte
}

type NTLMFieldBuilder

type NTLMFieldBuilder struct {
	// contains filtered or unexported fields
}

func NewNTLMFieldBuilder

func NewNTLMFieldBuilder() *NTLMFieldBuilder

func (*NTLMFieldBuilder) GetPayload

func (n *NTLMFieldBuilder) GetPayload() []byte

func (*NTLMFieldBuilder) WriteField

func (n *NTLMFieldBuilder) WriteField(data []byte) map[string]any

type NTLMv2Security

type NTLMv2Security struct {
	SeqNum uint32
	// contains filtered or unexported fields
}

func NewNTLMv2Security

func NewNTLMv2Security(sessionKey []byte) *NTLMv2Security

func (*NTLMv2Security) GssDecrypt

func (n *NTLMv2Security) GssDecrypt(data []byte) []byte

func (*NTLMv2Security) GssEncrypt

func (n *NTLMv2Security) GssEncrypt(data []byte) []byte

type NegoToken

type NegoToken struct {
	Data []byte `asn1:"explicit,tag:0"`
}

type NegotiationType

type NegotiationType byte

type RDPClient

type RDPClient struct {
	Host string
	Port int
	// contains filtered or unexported fields
}

func NewRDPClient

func NewRDPClient(addr string) (*RDPClient, error)

func (*RDPClient) BuildDataByProtocol

func (r *RDPClient) BuildDataByProtocol(data map[string]any, protocol string) ([]byte, error)

func (*RDPClient) Connect

func (r *RDPClient) Connect() (protocol uint32, e error)

func (*RDPClient) CsspAuthenticate

func (r *RDPClient) CsspAuthenticate(domain, user, password string) (bool, error)

func (*RDPClient) Login

func (r *RDPClient) Login(domain, user, password string) (err error)

func (*RDPClient) ParseProtocol

func (r *RDPClient) ParseProtocol(reader io.Reader, protocol string) (map[string]any, error)

func (*RDPClient) Read

func (r *RDPClient) Read(d []byte) (int, error)

func (*RDPClient) StartTLS

func (r *RDPClient) StartTLS() error

func (*RDPClient) Write

func (r *RDPClient) Write(d []byte) (int, error)

type TSCredentials

type TSCredentials struct {
	CredType    int    `asn1:"explicit,tag:0"`
	Credentials []byte `asn1:"explicit,tag:1"`
}

type TSCspDataDetail

type TSCspDataDetail struct {
	KeySpec       int    `asn1:"explicit,tag:0"`
	CardName      string `asn1:"explicit,tag:1"`
	ReaderName    string `asn1:"explicit,tag:2"`
	ContainerName string `asn1:"explicit,tag:3"`
	CspName       string `asn1:"explicit,tag:4"`
}

type TSPasswordCreds

type TSPasswordCreds struct {
	DomainName []byte `asn1:"explicit,tag:0"`
	UserName   []byte `asn1:"explicit,tag:1"`
	Password   []byte `asn1:"explicit,tag:2"`
}

type TSRemoteGuardCreds

type TSRemoteGuardCreds struct {
	LogonCred         TSRemoteGuardPackageCred   `asn1:"explicit,tag:0"`
	SupplementalCreds []TSRemoteGuardPackageCred `asn1:"explicit,tag:1"`
}

type TSRemoteGuardPackageCred

type TSRemoteGuardPackageCred struct {
	PackageName string `asn1:"explicit,tag:0"`
	CredBuffer  string `asn1:"explicit,tag:1"`
}

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"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL