rpce

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPC_C_AUTHN_NONE          = SecurityProviders(0)
	RPC_C_AUTHN_GSS_NEGOTIATE = SecurityProviders(0x09) //SPNEGO
	RPC_C_AUTHN_WINNT         = SecurityProviders(0x0a) //NTLM
	RPC_C_AUTHN_GSS_SCHANNEL  = SecurityProviders(0x0e) //TLS
	RPC_C_AUTHN_GSS_KERBEROS  = SecurityProviders(0x10) //Kerberos
	RPC_C_AUTHN_NETLOGON      = SecurityProviders(0x44)
	RPC_C_AUTHN_DEFAULT       = SecurityProviders(0xff)
)
View Source
const (
	AccessDenied uint32 = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlterContextReq

type AlterContextReq struct {
	CommonHead              CommonHead
	MaxXmitFrag             uint16
	MaxRecvFrag             uint16
	AssocGroup              uint32
	PresentationContextList *PContextList
	AuthVerifier            *AuthVerifier //Optional
}

func NewAlterContextReq

func NewAlterContextReq(callID, assgroup uint32, ctxList *PContextList, auth *AuthVerifier) AlterContextReq

func (AlterContextReq) Bytes

func (b AlterContextReq) Bytes() []byte

type Auth3Req

type Auth3Req struct {
	CommonHead CommonHead
	Pad        [4]byte
	SecTrailer AuthVerifier
}

func NewAuth3Req

func NewAuth3Req(callID uint32, authLevel AuthLevel, authData []byte) Auth3Req

func (Auth3Req) Bytes

func (a Auth3Req) Bytes() []byte

type AuthLevel

type AuthLevel uint8
const (
	RPC_C_AUTHN_LEVEL_DEFAULT       AuthLevel = iota //0x00 Same as RPC_C_AUTHN_LEVEL_CONNECT
	RPC_C_AUTHN_LEVEL_NONE                           // 0x01 No authentication.
	RPC_C_AUTHN_LEVEL_CONNECT                        // 0x02 Authenticates the credentials of the client and server.
	RPC_C_AUTHN_LEVEL_CALL                           //0x03 Same as RPC_C_AUTHN_LEVEL_PKT.
	RPC_C_AUTHN_LEVEL_PKT                            //0x04 Same as RPC_C_AUTHN_LEVEL_CONNECT but also prevents replay attacks.
	RPC_C_AUTHN_LEVEL_PKT_INTEGRITY                  //0x05 Same as RPC_C_AUTHN_LEVEL_PKT but also verifies that none of the data transferred between the client and server has been modified.
	RPC_C_AUTHN_LEVEL_PKT_PRIVACY                    // 0x06 Same as RPC_C_AUTHN_LEVEL_PKT_INTEGRITY but also ensures that the data transferred can only be
)

type AuthVerifier

type AuthVerifier struct {
	Align         []byte // must be 4-byte aligned!!
	AuthType      SecurityProviders
	AuthLevel     AuthLevel
	AuthPadLength byte
	Reserved      byte
	ContextID     uint32
	AuthValue     []byte
}

func NewAuthVerifier

func NewAuthVerifier(authType SecurityProviders, authLevel AuthLevel, contextID uint32, value []byte) AuthVerifier

func (AuthVerifier) Bytes

func (a AuthVerifier) Bytes() []byte

func (AuthVerifier) SizeOf

func (a AuthVerifier) SizeOf() int

func (*AuthVerifier) UpdatePadding

func (a *AuthVerifier) UpdatePadding(v int)

func (AuthVerifier) ValueSize

func (a AuthVerifier) ValueSize() int

type BindAckResp

type BindAckResp struct {
	CommonHead   CommonHead
	MaxXmitFrag  uint16
	MaxRecvFrag  uint16
	AssocGroupID uint32
	SecAddr      PortAny
	Pad2         []byte //idk what happened to pad1 ?
	PResultList  PResultList
	AuthVerifier AuthVerifier
}

func ParseBindAck

func ParseBindAck(b []byte) BindAckResp

type BindReq

type BindReq struct {
	CommonHead              CommonHead
	MaxXmitFrag             uint16
	MaxRecvFrag             uint16
	AssocGroupID            uint32
	PresentationContextList *PContextList
	AuthVerifier            *AuthVerifier //Optional
}

func NewBindReq

func NewBindReq(callID uint32, ctxList *PContextList, auth *AuthVerifier) BindReq

func (BindReq) Bytes

func (b BindReq) Bytes() []byte

type CommonHead

type CommonHead struct {
	Version            byte // 00:01 =5. RPC Version
	VersionMinor       byte
	PacketType         byte
	PFCFlags           PFCFlags
	DataRepresentation [4]byte
	FragLength         uint16
	AuthLength         uint16
	CallID             uint32
}

CommonHead appears in all PDU types. Alignment etc in comments. (page 590)

func NewCommonHeader

func NewCommonHeader(ptype byte, flags PFCFlags, callID uint32) CommonHead

type ContextID

type ContextID uint16

type ErrorStatus

type ErrorStatus uint32

type FaultResp

type FaultResp struct {
	CommonHead   CommonHead
	AllocHint    uint32
	PcontID      uint16
	CancelCount  byte
	Reserved     byte
	Status       uint32
	Reserved2    [4]byte
	StubData     []byte
	AuthVerifier AuthVerifier
}

func ParseFault

func ParseFault(b []byte) FaultResp

func (FaultResp) StatusString

func (pf FaultResp) StatusString() string

type NegRejectReason

type NegRejectReason short
const (
	NegRejectNotSpecified NegRejectReason = iota
	NegRejectAbSyntaxNotSpecified
	NegRejectProposedTransferSyntaxNotSupported
	NegRejectLocalLimitExceeded
)

type NegResult

type NegResult short
const (
	NegResultAccept NegResult = iota
	NegResultUserReject
	NegResultProviderReject
)

type PContextElem

type PContextElem struct {
	ContextID     uint16 // unclear if this should be 0 indexed per context?
	NumTransItems byte
	Unkown2       byte
	AbSyntax      PSyntaxID
	TfSyntax      []PSyntaxID //supposedly this can hold more than 1?

}

func NewPcontextElem

func NewPcontextElem(id uint16, abSyntax PSyntaxID, tfSyntax []PSyntaxID) PContextElem

func (PContextElem) Bytes

func (p PContextElem) Bytes() []byte

type PContextList

type PContextList struct {
	NumContexts   byte
	Reserved      byte
	Reserved2     uint16
	PContextElems []PContextElem
}

func NewPcontextList

func NewPcontextList() *PContextList

func (*PContextList) AddContext

func (p *PContextList) AddContext(c PContextElem)

func (PContextList) Bytes

func (p PContextList) Bytes() []byte

func (PContextList) SizeOf

func (p PContextList) SizeOf() int

SizeOf returns the total size in bytes of the Pcontextlist to be put on the wire

type PFCFlags

type PFCFlags byte
const (
	PFCFirstFrag PFCFlags = (iota + 1)
	PFCLastFrag  PFCFlags = iota << 1
	PFCCancelPending
	PFCReserved
	PFCMultiplex
	PFCDidNotExecute
	PFCMaybe
	PFCObject
)

type PResult

type PResult struct {
	NegResult       NegResult
	NegRejectReason NegRejectReason
	TransferSyntax  PSyntaxID //should be 0's if result not accepted
}

type PResultList

type PResultList struct {
	NResults  byte
	Reserved  byte
	Reserved2 uint16
	PResults  []PResult
}

type PSyntaxID

type PSyntaxID struct {
	UUID    uuid.UUID
	Version int32
}

func NewPSyntaxID

func NewPSyntaxID(uuid uuid.UUID, version int32) PSyntaxID

type P_rt_versions_supported_t

type P_rt_versions_supported_t struct {
	Protocols   uint8
	P_Protocols []Version_t
}

type PortAny

type PortAny struct {
	Length   uint16
	PortSpec []byte
}

type RPC_IF_ID

type RPC_IF_ID struct {
	UUID                 uuid.UUID
	VersMajor, VersMinor uint16
}

2.2.1.1.1 (same as rpc_if_id_t)

type RequestReq

type RequestReq struct {
	CommonHead   CommonHead
	AllocHint    uint32
	PContextID   uint16
	Opnum        uint16
	StubData     []byte
	AuthVerifier *AuthVerifier
}

func NewRequestReq

func NewRequestReq(callID uint32, ctxID uint16, opNum uint16, data []byte, auth *AuthVerifier) RequestReq

func (RequestReq) AuthBytes

func (r RequestReq) AuthBytes() []byte

func (RequestReq) Bytes

func (r RequestReq) Bytes() []byte

func (*RequestReq) UpdateLengths

func (r *RequestReq) UpdateLengths()

UpdateLengths sets the commonheader.fraglength and .authlength values based on the current state of the object.

type Response

type Response struct {
	CommonHead   CommonHead
	AllocHint    uint32
	PContID      uint16
	CancelCount  byte
	Reserved     byte
	StubData     []byte
	AuthVerifier *AuthVerifier
}

func ParseResponse

func ParseResponse(b []byte) Response

type SecurityProviders

type SecurityProviders byte

type Twr_t

type Twr_t struct {
	TowerLength uint32 //max of 2000
	Tower       []byte //or string?
}

type Version

type Version struct {
	Major uint8
	Minor uint8
}

type Version_t

type Version_t struct {
	Major, Minor uint16
}

Jump to

Keyboard shortcuts

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