hostprovider

package
v0.0.0-...-6c5db76 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerProvider

type DockerProvider struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

DockerProvider provides docker containers that run SSH servers that can serve attackers

func NewDockerProvider

func NewDockerProvider(hostt string, config container.Config, hostConfig container.HostConfig, networkConfig network.NetworkingConfig, platform specs.Platform, hostBuffer int) *DockerProvider

NewDockerProvider creates a new docker provider

func (*DockerProvider) GetHost

func (d *DockerProvider) GetHost(ctx context.Context) (string, string, error)

GetHost returns an available host in the format IP:PORT to connect to

func (*DockerProvider) GetScriptOutput

func (d *DockerProvider) GetScriptOutput(ctx context.Context, id string) (string, string, error)

GetScriptOutput gets the script output and timing files

func (*DockerProvider) Start

func (d *DockerProvider) Start(ctx context.Context) (err error)

func (*DockerProvider) Stop

func (d *DockerProvider) Stop(ctx context.Context) error

func (*DockerProvider) StopHost

func (d *DockerProvider) StopHost(ctx context.Context, id string) error

StopHost stops a managed host

type SSH

type SSH interface {
	Start(context.Context) error
	Stop(context.Context) error
	GetHost(context.Context) (IP string, id string, err error)
	StopHost(ctx context.Context, id string) error
	GetScriptOutput(ctx context.Context, id string) (string, string, error)
}

SSH provides SSH hosts

Jump to

Keyboard shortcuts

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