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 ¶
- func ExecuteCommandsWithCredentials(ctx context.Context, host string, port int, username, password string, ...) ([]*commonprotocolfern.SshCommandExecution, error)
- func PerformAuthentication(target string, config *sshfern.PentestSshConfig) (*sshfern.AuthResult, error)
- func PerformAuthenticationWithContext(ctx context.Context, target string, config *sshfern.PentestSshConfig) (*sshfern.AuthResult, error)
- func PerformCommandExecution(ctx context.Context, target string, config *sshfern.PentestSshConfig) (*sshfern.ExecResult, error)
- func PerformFileTransfer(ctx context.Context, target string, config *sshfern.PentestSshConfig) (*sshfern.FileTransferResult, error)
- func RunPentest(ctx context.Context, config *sshfern.PentestSshConfig) (*sshfern.PentestSshReport, error)
- type ExecutionCredentials
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
func RunPentest(ctx context.Context, config *sshfern.PentestSshConfig) (*sshfern.PentestSshReport, error)
RunPentest performs SSH pentest operations for multiple targets
Types ¶
type ExecutionCredentials ¶ added in v0.0.104
ExecutionCredentials holds authenticated credentials for command execution