scanner

package
v0.0.0-...-ab5292c Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDialer *defaultDialer

DefaultDialer is the default dialer.

View Source
var DefaultTimeoutPerPort = time.Second * 5

DefaultTimeoutPerPort is the default timeout per-port for Run

Functions

func Run

func Run(d Dialer, ip string, firstPort, lastPort int, timeoutPerPort time.Duration) <-chan PortScanResult

Run will perform a port scan for the given IP, starting at the firstPort to the lastPort

Types

type Dialer

type Dialer interface {
	DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)
	Close() error
}

Dialer implents an interface to allow for multiple network connection types

func NewSSHBastionScanner

func NewSSHBastionScanner(addr string, config *ssh.ClientConfig) (Dialer, error)

NewSSHBastionScanner creates a new SSHBastionScanner Dialer type

type PortScanResult

type PortScanResult struct {
	IP    string
	Port  int
	Open  bool
	Error error
}

PortScanResult is the type returned by the Run func result chan

type SSHBastionScanner

type SSHBastionScanner struct {
	Conn   net.Conn
	Client *ssh.Client
	// contains filtered or unexported fields
}

SSHBastionScanner is a Dialer that uses an SSH bastion to establish connections for the port scan.

func (*SSHBastionScanner) Close

func (b *SSHBastionScanner) Close() error

Close implements the Dialer interface

func (*SSHBastionScanner) DialTimeout

func (b *SSHBastionScanner) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)

DialTimeout implements the Dialer interface

Jump to

Keyboard shortcuts

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