scanner

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithParallelRunners

func WithParallelRunners(max int) func(*Scanner)

WithParallelRunners is used as an option in NewScanner to the maximum number af parallel probes to use

func WithPorts

func WithPorts(ports []int) func(*Scanner)

WithPorts is used as an option in NewScanner to set the ports to scan

func WithProtocols

func WithProtocols(protocols []string) func(*Scanner)

WithProtocols is used as an option in NewScanner to set the protocols to test the ports with

func WithTimeout

func WithTimeout(timeout time.Duration) func(*Scanner)

WithTimeout is used as an option in NewScanner to set the timeout for the port dial

Types

type AddressSet

type AddressSet struct {
	IP       net.IP
	Port     int
	Protocol string
}

AddressSet is a set of the IP port and protocol of a responding service

type Scanner

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

Scanner allows to port scan multiple IPs for multiple ports

func NewScanner

func NewScanner(options ...func(*Scanner)) *Scanner

NewScanner gives a new Scanner instance

func (*Scanner) AddCIDR

func (s *Scanner) AddCIDR(cidr string) error

AddCIDR adds all IPs in a CIDR notation to the list of IPs to be scanned

func (*Scanner) AddIP

func (s *Scanner) AddIP(ip string) error

AddIP adds a single IP to the list of IPs to be scanned

func (*Scanner) Scan

func (s *Scanner) Scan() []AddressSet

Scan performs a network scan and returns the responding addressses

func (*Scanner) ScanToLogger

func (s *Scanner) ScanToLogger(log logger)

ScanToLogger perforn a scan and outputs the results to a logger interface

func (*Scanner) SetPorts

func (s *Scanner) SetPorts(ports []int)

SetPorts sets the port to be scanned

Jump to

Keyboard shortcuts

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