scanner

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConnectionError  = errors.New("connection error")
	ReadTimeoutError = errors.New("read data error")
	WriteDataError   = errors.New("write data error")
)
View Source
var PortRequest = map[int]string{
	80:    "GetRequest",
	110:   "NULL",
	443:   "GetRequest",
	445:   "SMBProgNeg",
	554:   "RTSPRequest",
	25:    "NULL",
	22:    "NULL",
	587:   "NULL",
	3389:  "TerminalServerCookie",
	6379:  "GetRequest",
	8008:  "GetRequest",
	8080:  "GetRequest",
	61616: "NULL",
}

Functions

This section is empty.

Types

type ExecuteOptions

type ExecuteOptions struct {
	Options *types.Options
	// 单个端口识别最大超时时间
	MaxTimeout time.Duration
	// 超时时间 单个探针
	Timeout time.Duration
	// 版本检测强度(0-9)
	VersionIntensity int
	// 最大并行扫描数
	MaxParallelism int
	// 指定要使用的端口
	Ports []int
	// 是否使用所有探针
	UseAllProbes bool
	// 是否打印请求数据
	DebugRequest bool
	// 是否打印响应数据
	DebugResponse bool
	// 是否打印详细的调试信息
	Verbose bool
	Proxy   *url.URL
}

ExecuteOptions 扫描选项

func DefaultScanOptions

func DefaultScanOptions() *ExecuteOptions

DefaultScanOptions 返回默认扫描选项

type PortObserverEntry

type PortObserverEntry struct {
	Close int // 连接失败总次数

	ReadOk int // 读取到数据的次数

	ConsecutiveOpen      int    // 连续成功次数
	LastFailureType      string // 最后一次失败类型(timeout, refused等)
	ReadTimeout          int    // 读取超时次数
	WriteTimeout         int    // 写入超时次数
	FailuresSinceSuccess int    // 上次成功后的失败次数

	NotMatch  int  // 未匹配上次数
	Terminate bool // 是否可以判断端口已经关闭
	// contains filtered or unexported fields
}

PortObserverEntry 表示一个端口状态观测记录

func NewPortObserverEntry

func NewPortObserverEntry(target *types.ScanTarget) *PortObserverEntry

func (*PortObserverEntry) IsTerminate

func (p *PortObserverEntry) IsTerminate() (bool, string)

IsTerminate 判断是否需要停止扫描

func (*PortObserverEntry) Reset

func (p *PortObserverEntry) Reset()

type ServiceScanner

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

ServiceScanner 默认扫描器实现

func NewServiceScanner

func NewServiceScanner(options *types.Options) (*ServiceScanner, error)

NewServiceScanner 创建新的扫描器

func (*ServiceScanner) Scan

func (s *ServiceScanner) Scan(target *types.ScanTarget) (*types.ScanResult, error)

Scan 扫描单个目标

func (*ServiceScanner) ScanWithContext

func (s *ServiceScanner) ScanWithContext(ctx context.Context, target *types.ScanTarget) (*types.ScanResult, error)

ScanWithContext 带上下文的扫描

Jump to

Keyboard shortcuts

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