zasset

package
v0.0.0-...-9c52186 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 海康威视SADP协议
	HikPort        = 37020
	HikListenPort  = 37020
	HikMulticastIP = "239.255.255.250"

	// 大华设备
	DahuaPort        = 37810
	DahuaListenPort  = 37809
	DahuaMulticastIP = "239.255.255.251"
)

Variables

This section is empty.

Functions

func GetLocalNetworks

func GetLocalNetworks() ([]string, error)

func InitMultiReporter

func InitMultiReporter(config *ReporterConfig) error

func MergeNodes

func MergeNodes(existing *stage.Node, new *stage.Node)

func ServiceInfoToString

func ServiceInfoToString(ports []*stage.ServiceInfo) string

ServiceInfoToString 将 ServiceInfo 数组转换为端口字符串

Types

type ARPDetector

type ARPDetector struct {
	BaseDetector
	// contains filtered or unexported fields
}

func NewARPDetector

func NewARPDetector(iface string) *ARPDetector

func (*ARPDetector) Detect

func (a *ARPDetector) Detect(target string) ([]stage.Node, error)

func (*ARPDetector) Name

func (a *ARPDetector) Name() string

type BaseDetector

type BaseDetector struct {
}

BaseDetector 基础探测器结构,包含共同的字段

type CameraDetector

type CameraDetector struct {
	BaseDetector
	// contains filtered or unexported fields
}

func NewCameraDetector

func NewCameraDetector() *CameraDetector

func (*CameraDetector) Detect

func (d *CameraDetector) Detect(target string) ([]stage.Node, error)

func (*CameraDetector) Name

func (d *CameraDetector) Name() string

type ConsoleReporter

type ConsoleReporter struct{}

func (*ConsoleReporter) Report

func (cr *ConsoleReporter) Report(node *stage.Node) error

func (*ConsoleReporter) ReportNodes

func (cr *ConsoleReporter) ReportNodes(nodes []*stage.Node) error

type DBReporter

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

func NewDBReporter

func NewDBReporter(db *sql.DB) *DBReporter

func (*DBReporter) Report

func (dr *DBReporter) Report(node *stage.Node) error

func (*DBReporter) ReportNodes

func (dr *DBReporter) ReportNodes(nodes []*stage.Node) error

type DCERPCDetector

type DCERPCDetector struct {
	BaseDetector
}

func NewDCERPCDetector

func NewDCERPCDetector() *DCERPCDetector

func (*DCERPCDetector) Detect

func (d *DCERPCDetector) Detect(target string) ([]stage.Node, error)

func (*DCERPCDetector) Name

func (d *DCERPCDetector) Name() string

type Detector

type Detector interface {
	Name() string
	Detect(target string) ([]stage.Node, error)
}

Detector 探测器接口

type HTTPReporter

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

func NewHTTPReporter

func NewHTTPReporter(endpoint string) *HTTPReporter

func (*HTTPReporter) Report

func (hr *HTTPReporter) Report(node *stage.Node) error

func (*HTTPReporter) ReportNodes

func (hr *HTTPReporter) ReportNodes(nodes []*stage.Node) error

type MultiReporter

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

MultiReporter 支持多种上报方式

func GetMultiReporter

func GetMultiReporter() (*MultiReporter, error)

GetMultiReporter 获取MultiReporter实例

func (*MultiReporter) AddReporter

func (mr *MultiReporter) AddReporter(r Reporter)

func (*MultiReporter) Report

func (mr *MultiReporter) Report(node *stage.Node) error

func (*MultiReporter) ReportNodes

func (mr *MultiReporter) ReportNodes(nodes []*stage.Node) error

ReportNodes reports multiple nodes at once

type OUIDatabase

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

func GetOUIDatabase

func GetOUIDatabase() *OUIDatabase

type PassiveDetector

type PassiveDetector struct {
	BaseDetector
	// contains filtered or unexported fields
}

func NewPassiveDetector

func NewPassiveDetector() *PassiveDetector

func (*PassiveDetector) Detect

func (p *PassiveDetector) Detect(target string) ([]stage.Node, error)

func (*PassiveDetector) Name

func (p *PassiveDetector) Name() string

type PingDetector

type PingDetector struct {
	BaseDetector
}

func NewPingDetector

func NewPingDetector() *PingDetector

func (*PingDetector) Detect

func (p *PingDetector) Detect(target string) ([]stage.Node, error)

func (*PingDetector) Name

func (p *PingDetector) Name() string

type Reporter

type Reporter interface {
	Report(node *stage.Node) error
	ReportNodes(nodes []*stage.Node) error
}

Reporter 接口定义了上报行为

type ReporterConfig

type ReporterConfig struct {
	EnableConsole bool
	HTTPEndpoint  string
	Driver        string
	DSN           string
}

type SNMPDetector

type SNMPDetector struct {
	BaseDetector
	// contains filtered or unexported fields
}

SNMPDetector SNMP探测器

func NewSNMPDetector

func NewSNMPDetector() *SNMPDetector

func (*SNMPDetector) Detect

func (s *SNMPDetector) Detect(target string) ([]stage.Node, error)

func (*SNMPDetector) Name

func (s *SNMPDetector) Name() string

type Scanner

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

func NewScanner

func NewScanner(config *ScannerConfig) *Scanner

func (*Scanner) GetDiscoveredHosts

func (s *Scanner) GetDiscoveredHosts() int

func (*Scanner) Start

func (s *Scanner) Start(targets []string) ([]stage.Node, error)

Start is the unified entry point for both active and passive scanning

func (*Scanner) Stop

func (s *Scanner) Stop()

type ScannerConfig

type ScannerConfig struct {
	ConfigPath     string
	TemplatesDir   string
	PassiveTimeout int
	NetworkCard    string
	Targets        []string
	ScannerType    ScannerType
}

type ScannerType

type ScannerType int
const (
	ActiveScanner ScannerType = iota
	PassiveScanner
)

type ZScanDetector

type ZScanDetector struct {
	BaseDetector
	// contains filtered or unexported fields
}

ZScanDetector zscan探测器

func NewZScanDetector

func NewZScanDetector(config *ScannerConfig) *ZScanDetector

NewZScanDetector 创建新的ZScan探测器

func (*ZScanDetector) Detect

func (z *ZScanDetector) Detect(target string) ([]stage.Node, error)

func (*ZScanDetector) Name

func (z *ZScanDetector) Name() string

Jump to

Keyboard shortcuts

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