Versions in this module Expand all Collapse all v1 v1.1.1 Nov 2, 2024 v1.1.0 Nov 2, 2024 Changes in this version + const DefaultBackoffLimit + const DefaultDelayRetry + const DefaultTimeout + const IncDelayRetry + const LastPort + const NumberOfScans + const UDPMaxBufferSize + var DefaultConfig = Config + var ErrAtLeastOneProtocolMustBeUsed = errors.New("use at least one protocol tpc/udp") + var ErrHostUnavailable = errors.New("host can not be pinged") + var ErrICMPResponseDontMatchEchoReply = errors.New("host did not response with echo reply") + var ErrSynTimedOut = errors.New("syn scan timed out") + func GetFreePort() (uint16, error) + func GetLocalIP() (string, string) + func PortToService(descriptivePort string) string + type Config struct + BackoffLimit int + DelayRetry int + Ping bool + SYN bool + TCP bool + Timeout int + UDP bool + type ReadPacket struct + Err error + TCPPacket []byte + type ScanExecutor interface + PingHost func(host string) (*ping.Stats, error) + Scan func(host string, ports []string) ([]*ScanResult, *Stats, []error) + SweepScan func(hosts []string, port string) ([]*SweepScanResult, float64) + SynScan func(ip string, port string) (*ScanResult, error) + TCPScan func(ip, port string) (*ScanResult, error) + UDPScan func(ip, port string) (*ScanResult, error) + VanillaScan func(host string) ([]*ScanResult, *Stats, []error) + func NewScanExecutor(c *Config, privilegedPing bool) ScanExecutor + type ScanResult struct + Port string + Rtt float64 + Service string + State State + type ScanType string + const SYN + const TCP + const UDP + type Scanner struct + Cfg *Config + Pg ping.Pinger + func (s *Scanner) PingHost(host string) (*ping.Stats, error) + func (s *Scanner) Scan(host string, ports []string) ([]*ScanResult, *Stats, []error) + func (s *Scanner) SweepScan(hosts []string, port string) ([]*SweepScanResult, float64) + func (s *Scanner) SynScan(ip, port string) (*ScanResult, error) + func (s *Scanner) TCPScan(ip, port string) (*ScanResult, error) + func (s *Scanner) UDPScan(ip, port string) (*ScanResult, error) + func (s *Scanner) VanillaScan(host string) ([]*ScanResult, *Stats, []error) + type State string + const Closed + const Filtered + const Open + type Stats struct + DNS *dns.DNSInfo + Ping *ping.Stats + Rtt float64 + type SweepScanResult struct + Errs []error + Host string + IP string + ScanResults []*ScanResult + Stats *Stats