ssh

package
v0.0.192 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package ssh — FILE_TRANSFER action implementation.

Drives uploads + downloads over SFTP on top of the same authenticated ssh.Client that exec.go uses. Uploads stream local files to the remote path. Downloads read the remote file and base64-encode it into the SshFileTransfer.Content field so consumers (e.g., the ontology File-LOOT processor) can materialise an attachment without a second round trip.

Success contract per transfer entry: the SshFileTransfer's Success bool flips true only when the SFTP operation completed without error AND (for downloads) the remote file was readable end-to-end. A failure on one entry doesn't abort the rest — the operator gets a per-file success/message breakdown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommandsWithCredentials added in v0.0.104

func ExecuteCommandsWithCredentials(ctx context.Context, host string, port int, username, password string, commands []string, timeout int) ([]*commonprotocolfern.SshCommandExecution, error)

ExecuteCommandsWithCredentials executes commands on the remote SSH server using provided credentials

func PerformAuthentication

func PerformAuthentication(target string, config *sshfern.PentestSshConfig) (*sshfern.AuthResult, error)

PerformAuthentication performs authentication attempts against SSH service Returns auth results

func PerformAuthenticationWithContext

func PerformAuthenticationWithContext(ctx context.Context, target string, config *sshfern.PentestSshConfig) (*sshfern.AuthResult, error)

PerformAuthenticationWithContext performs authentication attempts against SSH service with context Returns auth results

func PerformCommandExecution added in v0.0.104

func PerformCommandExecution(ctx context.Context, target string, config *sshfern.PentestSshConfig) (*sshfern.ExecResult, error)

PerformCommandExecution executes commands on remote SSH target using authenticated credentials

func PerformFileTransfer added in v0.0.191

func PerformFileTransfer(ctx context.Context, target string, config *sshfern.PentestSshConfig) (*sshfern.FileTransferResult, error)

PerformFileTransfer authenticates and runs the configured uploads + downloads against the target via SFTP. Returns a FileTransferResult populated with one SshFileTransfer per attempted entry; transient errors land in result.Errors.

func RunPentest added in v0.0.154

RunPentest performs SSH pentest operations for multiple targets

Types

type ExecutionCredentials added in v0.0.104

type ExecutionCredentials struct {
	Username string
	Password string
}

ExecutionCredentials holds authenticated credentials for command execution

Jump to

Keyboard shortcuts

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