finscan

package
v1.3.6-beta5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPEN_STATE = iota
	CLOSED_STATE
	FILTERED_STATE
	UNFILTERED_STATE
	OPEN_FILTERED_STATE
	CLOSED_FILTERED_STATE
)

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
	TcpSetter func(tcp *layers.TCP)
	TcpFilter func(tcp *layers.TCP) bool
	// 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 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

func WithTcpFilter

func WithTcpFilter(filter func(tcp *layers.TCP) bool) ConfigOption

func WithTcpSetter

func WithTcpSetter(setter func(tcp *layers.TCP)) ConfigOption

type FinScanResult

type FinScanResult struct {
	Host   string
	Port   int
	Status int
}

func (*FinScanResult) Show

func (s *FinScanResult) Show()

func (*FinScanResult) String

func (s *FinScanResult) String() string

type Scanner

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

func NewScanner

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

func (*Scanner) IsMacCached

func (s *Scanner) IsMacCached() bool

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) RegisterNoRspHandler

func (s *Scanner) RegisterNoRspHandler(tag string, handler noRspHandler) error

func (*Scanner) RegisterRstAckHandler

func (s *Scanner) RegisterRstAckHandler(tag string, handler rstAckHandler) 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) UnregisterNoRspHandler

func (s *Scanner) UnregisterNoRspHandler(tag string)

func (*Scanner) UnregisterRstAckHandler

func (s *Scanner) UnregisterRstAckHandler(tag string)

func (*Scanner) WaitChannelEmpty

func (s *Scanner) WaitChannelEmpty()

func (*Scanner) WaitOpenPort

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

func (*Scanner) WaitOpenPortAsync

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

func (*Scanner) WaitOpenPortWithTimeout

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

type TcpFlag

type TcpFlag string
const (
	SYN TcpFlag = "syn"
	FIN TcpFlag = "fin"
	RST TcpFlag = "rst"
	ACK TcpFlag = "ack"
)

Jump to

Keyboard shortcuts

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