smb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientName = "SMB"

	DefaultPort    = 445
	DefaultDialect = smb2.SMB311
)

Variables

View Source
var (
	DefaultOutputPollInterval = 1 * time.Second
	DefaultOutputPollTimeout  = 60 * time.Second
)

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientOptions
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close(ctx context.Context) (err error)

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) (err error)

func (*Client) Logger

func (c *Client) Logger(ctx context.Context) zerolog.Logger

func (*Client) Mount

func (c *Client) Mount(ctx context.Context, share string) (err error)

func (*Client) Parse

func (c *Client) Parse(ctx context.Context) (err error)

func (*Client) Session

func (c *Client) Session() (sess *smb2.Session)

func (*Client) String

func (c *Client) String() string

type ClientOptions

type ClientOptions struct {
	goexec.ClientOptions
	goexec.AuthOptions

	// NoSign disables packet signing
	NoSign bool `json:"no_sign" yaml:"no_sign"`

	// NoSeal disables packet encryption
	NoSeal bool `json:"no_seal" yaml:"no_seal"`

	// Dialect sets the SMB dialect to be passed to smb2.WithDialect()
	Dialect msrpcSMB2.Dialect `json:"dialect" yaml:"dialect"`
	// contains filtered or unexported fields
}

ClientOptions holds configuration settings for an SMB client

type FileStager

type FileStager struct {
	goexec.Cleaner

	Client *Client

	Share     string
	SharePath string
	File      string

	ForceReconnect bool
	DeleteStage    bool
	// contains filtered or unexported fields
}

func (*FileStager) Stage

func (o *FileStager) Stage(ctx context.Context, reader io.Reader) (err error)

type OutputFileFetcher

type OutputFileFetcher struct {
	goexec.Cleaner

	Client *Client

	Share            string
	SharePath        string
	File             string
	DeleteOutputFile bool
	ForceReconnect   bool
	PollInterval     time.Duration
	PollTimeout      time.Duration
	// contains filtered or unexported fields
}

func (*OutputFileFetcher) GetOutput

func (o *OutputFileFetcher) GetOutput(ctx context.Context, writer io.Writer) (err error)

Jump to

Keyboard shortcuts

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