msrpc

package
v0.0.80 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseKerberosKeys

func ParseKerberosKeys(ctx context.Context, data []byte, username string) []*msrpcfern.KerberosKeyEntry

ParseKerberosKeys parses Kerberos keys from supplemental credentials

Types

type DRSUAPIClient

type DRSUAPIClient struct {
	Host        string
	Credentials credential.Credential
	// contains filtered or unexported fields
}

DRSUAPIClient provides functionality for interacting with the Directory Replication Service API

func NewDRSUAPIClient

func NewDRSUAPIClient(host string, creds credential.Credential) *DRSUAPIClient

NewDRSUAPIClient creates a new DRSUAPI client

func (*DRSUAPIClient) Bind

func (c *DRSUAPIClient) Bind(ctx context.Context) error

Bind performs the DRSBind operation to establish a session

func (*DRSUAPIClient) Close

func (c *DRSUAPIClient) Close(ctx context.Context) error

Close closes the connection to the DRSUAPI service

func (*DRSUAPIClient) Connect

func (c *DRSUAPIClient) Connect(ctx context.Context, drsuapiBinding dcerpc.StringBinding) error

Connect establishes a connection to the DRSUAPI service on the specified endpoint

func (*DRSUAPIClient) ExtractAllUserCredentials

func (c *DRSUAPIClient) ExtractAllUserCredentials(ctx context.Context, domain string, domainInfo *DomainInfo, config *msrpcfern.PentestMsrpcDcSyncConfig) ([]*msrpcfern.DcSyncUserEntry, int, int, error)

ExtractAllUserCredentials extracts credentials for all users in the domain using DRSUAPI

func (*DRSUAPIClient) ExtractUserCredentials

func (c *DRSUAPIClient) ExtractUserCredentials(ctx context.Context, username, domain string, resp *drsuapi.GetNCChangesResponse, config *msrpcfern.PentestMsrpcDcSyncConfig) (*msrpcfern.DcSyncUserEntry, error)

ExtractUserCredentials extracts credentials from DRSUAPI replication data

func (*DRSUAPIClient) Unbind

func (c *DRSUAPIClient) Unbind(ctx context.Context) error

Unbind closes the DRSUAPI session

type DomainInfo

type DomainInfo struct {
	DomainSID   *dtyp.SID
	UserEntries []UserEntry
}

DomainInfo represents domain information including SID and users

type EndpointMapper

type EndpointMapper struct {
	Host        string
	Credentials credential.Credential
}

EndpointMapper provides functionality for discovering RPC endpoints via EPM

func NewEndpointMapper

func NewEndpointMapper(host string, creds credential.Credential) *EndpointMapper

NewEndpointMapper creates a new endpoint mapper client

func (*EndpointMapper) DiscoverDRSUAPIEndpoints

func (m *EndpointMapper) DiscoverDRSUAPIEndpoints(ctx context.Context) ([]dcerpc.StringBinding, error)

DiscoverDRSUAPIEndpoints queries EPM for DRSUAPI TCP endpoints using the library

type SAMRClient

type SAMRClient struct {
	Host        string
	Credentials credential.Credential
}

SAMRClient provides functionality for interacting with the SAM Remote protocol

func NewSAMRClient

func NewSAMRClient(host string, creds credential.Credential) *SAMRClient

NewSAMRClient creates a new SAMR client

func (*SAMRClient) EnumerateDomainUsers

func (c *SAMRClient) EnumerateDomainUsers(ctx context.Context, domain string) (*DomainInfo, error)

EnumerateDomainUsers connects to SAMR and enumerates all users with RID info

type UserEntry

type UserEntry struct {
	Username string
	RID      uint32
}

UserEntry represents a domain user with RID information for SID construction

Jump to

Keyboard shortcuts

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