Documentation ¶
Index ¶
- func Debug(v ...interface{})
- func DecodeData(s string) ([]byte, error)
- func DecodePattern(s string) ([]byte, error)
- func Error(v ...interface{})
- func Info(v ...interface{})
- func Warn(v ...interface{})
- type Config
- type Details
- type Directive
- type Extras
- type Match
- type Probe
- type ProbesRarity
- type Result
- type Service
- type Target
- type VScan
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeData ¶
func DecodePattern ¶
解析 nmap-service-probes 中匹配规则字符串,转换成 golang 中可以进行编译的字符串
e.g. (1) pattern: \0\xffHi decoded: []byte{0, 255, 72, 105} 4len (2) pattern: \\0\\xffHI decoded: []byte{92, 0, 92, 120, 102, 102, 72, 105} 8len (3) pattern: \x2e\x2a\x3f\x2b\x7b\x7d\x28\x29\x5e\x24\x7c\x5c decodedStr: \.\*\?\+\{\}\(\)\^\$\|\\
Types ¶
type Config ¶
type Config struct { Rarity int SendTimeout time.Duration ReadTimeout time.Duration NULLProbeOnly bool UseAllProbes bool SSLAlwaysTry bool }
VScan 探测时的参数配置
type Details ¶
type Details struct { ProbeName string `json:"probe_name"` ProbeData string `json:"probe_data"` MatchMatched string `json:"match_matched"` IsSoftMatched bool `json:"soft_matched"` }
详细的结果数据(包含具体的 Probe 和匹配规则信息)
type Extras ¶
type Extras struct { VendorProduct string `json:"vendor_product,omitempty"` Version string `json:"version,omitempty"` Info string `json:"info,omitempty"` Hostname string `json:"hostname,omitempty"` OperatingSystem string `json:"operating_system,omitempty"` DeviceType string `json:"device_type,omitempty"` CPE string `json:"cpe,omitempty"` }
对应 NMap versioninfo 信息
type Match ¶
type Match struct { IsSoft bool Service string Pattern string VersionInfo string PatternCompiled *regexp.Regexp }
nmap-service-probes 中每一条规则
func (*Match) MatchPattern ¶
对获取到的 Banner 进行匹配
func (*Match) ParseVersionInfo ¶
type Probe ¶
type Probe struct { Name string Data string Protocol string Ports string SSLPorts string TotalWaitMS int TCPWrappedMS int Rarity int Fallback string Matchs *[]Match }
探针规则,包含该探针规则下的服务匹配条目和其他探测信息
func (*Probe) ContainsPort ¶
func (*Probe) ContainsSSLPort ¶
type ProbesRarity ¶
type ProbesRarity []Probe
ProbesRarity 用于使用 sort 对 Probe 对象按 Rarity 属性值进行排序
func (ProbesRarity) Len ¶
func (ps ProbesRarity) Len() int
func (ProbesRarity) Less ¶
func (ps ProbesRarity) Less(i, j int) bool
func (ProbesRarity) Swap ¶
func (ps ProbesRarity) Swap(i, j int)
type Result ¶
type Result struct { Target Service `json:"service"` Timestamp int32 `json:"timestamp"` Error string `json:"error"` }
输出的结果数据
type Service ¶
type Service struct { Target Name string `json:"name"` Protocol string `json:"protocol"` Banner string `json:"banner"` BannerBytes []byte `json:"banner_bytes"` Extras `json:"extras"` Details `json:"details"` }
获取的端口服务信息
type Target ¶
type Target struct { IP string `json:"ip"` Port int `json:"port"` Protocol string `json:"protocol"` }
待探测的目标端口
func (*Target) GetAddress ¶
Click to show internal directories.
Click to hide internal directories.