scan

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolICMP = 1
)

Some constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Ping added in v1.1.1

type Ping struct {
	Type    PingResultType
	Latency time.Duration
	Error   error
	Host    string
}

Ping contains the results for ping on a single host

type PingResult added in v1.1.1

type PingResult struct {
	Hosts []Ping
}

PingResult contains the results for the Ping request

func PingHosts added in v1.1.1

func PingHosts(addresses []string) (*PingResult, error)

PingHosts pings the addresses given and returns the latencies of each host If the address returns an error, that address is marked as unusable.

func (*PingResult) GetFastestHost added in v1.1.1

func (p *PingResult) GetFastestHost() (Ping, error)

GetFastestHost gets the fastest host from the ping responses

type PingResultType added in v1.1.1

type PingResultType int

PingResultType contains the type of result for ping request on an address

const (
	HostInactive PingResultType = iota
	HostActive
)

Type of ping responses

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner is a scanner that scans for ports using SYN packets.

func NewScanner

func NewScanner(host net.IP, timeout time.Duration, retries, rate int) (*Scanner, error)

NewScanner creates a new full port scanner that scans all ports using SYN packets.

func (*Scanner) ConnectVerify

func (s *Scanner) ConnectVerify(host string, ports map[int]struct{}) map[int]struct{}

ConnectVerify is used to verify if ports are accurate using a connect request

func (*Scanner) Scan

func (s *Scanner) Scan(wordlist map[int]struct{}) (map[int]struct{}, error)

Scan scans a single host and returns the results

Jump to

Keyboard shortcuts

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