synscan

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// 发包必须的几个字段
	Iface     *net.Interface
	GatewayIP net.IP
	SourceIP  net.IP

	// Fetch Gateway Hardware Address TimeoutSeconds
	FetchGatewayHardwareAddressTimeout time.Duration
}

func NewConfig

func NewConfig(options ...ConfigOption) (*Config, error)

func NewDefaultConfig

func NewDefaultConfig(extra ...ConfigOption) (*Config, error)

type ConfigOption

type ConfigOption func(config *Config)

func CreateConfigOptionsByIfaceName added in v1.3.1

func CreateConfigOptionsByIfaceName(ifaceName string) ([]ConfigOption, error)

func CreateConfigOptionsByTargetNetworkOrDomain

func CreateConfigOptionsByTargetNetworkOrDomain(targetRaw string, duration time.Duration) ([]ConfigOption, error)

func WithDefaultSourceIP

func WithDefaultSourceIP(ip net.IP) ConfigOption

func WithFetchGatewayHardwareAddressTimeout

func WithFetchGatewayHardwareAddressTimeout(timeout time.Duration) ConfigOption

func WithGatewayIP

func WithGatewayIP(ip net.IP) ConfigOption

func WithIntervalMilliseconds

func WithIntervalMilliseconds(interval int) ConfigOption

func WithNetInterface

func WithNetInterface(iface *net.Interface) ConfigOption

func WithPacketsPerSeconds

func WithPacketsPerSeconds(count int) ConfigOption

type Scanner

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

func NewScanner

func NewScanner(ctx context.Context, config *Config) (*Scanner, error)

func (*Scanner) OnSubmitTask

func (s *Scanner) OnSubmitTask(i func(addr string, port int))

func (*Scanner) RandomScan

func (s *Scanner) RandomScan(host string, port string, noWait bool) error

func (*Scanner) RegisterARPHandler

func (s *Scanner) RegisterARPHandler(dst string, handler arpHandler) error

func (*Scanner) RegisterSynAckHandler

func (s *Scanner) RegisterSynAckHandler(tag string, handler synAckHandler) error

func (*Scanner) Scan

func (s *Scanner) Scan(host string, port string, noWait bool) error

func (*Scanner) SetRateLimit

func (s *Scanner) SetRateLimit(ms float64, count int)

func (*Scanner) UnregisterARPHandler

func (s *Scanner) UnregisterARPHandler(dst string)

func (*Scanner) UnregisterSynAckHandler

func (s *Scanner) UnregisterSynAckHandler(tag string)

func (*Scanner) WaitChannelEmpty

func (s *Scanner) WaitChannelEmpty()

func (*Scanner) WaitOpenPort

func (s *Scanner) WaitOpenPort(ctx context.Context, handler synAckHandler) error

func (*Scanner) WaitOpenPortAsync

func (s *Scanner) WaitOpenPortAsync(ctx context.Context, handler synAckHandler) error

func (*Scanner) WaitOpenPortWithTimeout

func (s *Scanner) WaitOpenPortWithTimeout(timeout time.Duration, handler synAckHandler) error

type SynScanResult

type SynScanResult struct {
	Host string
	Port int
}

func (*SynScanResult) Show

func (s *SynScanResult) Show()

func (*SynScanResult) String

func (s *SynScanResult) String() string

Jump to

Keyboard shortcuts

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