scan

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ProtocolICMP = 1
)

Some constants

Variables

This section is empty.

Functions

func Ips added in v1.1.2

func Ips(cidr string) ([]string, error)

Ips of a cidr

func IsCidr added in v1.1.2

func IsCidr(ip string) bool

IsCidr determines if the given ip is a cidr range

func IsIP added in v1.1.2

func IsIP(ip string) bool

IsIP determines if the given string is a valid ip

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, debug bool) (*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) ScanConnect added in v1.1.2

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

ScanConnect a single host and returns the results

func (*Scanner) ScanSyn added in v1.1.2

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

ScanSyn 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