port

package
v0.0.0-...-722fbe6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TopTcpPorts = []uint16{}/* 3552 elements not displayed */

TopTcpPorts 常见端口 ref https://github.com/robertdavidgraham/masscan/blob/master/src/main-conf.c

Functions

func IsInPortRange

func IsInPortRange(port uint16, portRanges [][]uint16) bool

IsInPortRange 判断port是否在端口范围里

func ParsePortRangeStr

func ParsePortRangeStr(portStr string) (out [][]uint16, err error)

ParsePortRangeStr 解析端口字符串

func ShuffleParseAndMergeTopPorts

func ShuffleParseAndMergeTopPorts(portStr string) (ports []uint16, err error)

ShuffleParseAndMergeTopPorts shuffle parse portStr and merge TopTcpPorts

Types

type HttpInfo

type HttpInfo struct {
	StatusCode int      // 状态码
	ContentLen int      // 相应包大小
	Url        string   // Url
	Location   string   // 302、301重定向路径
	Title      string   // 标题
	Server     string   // 服务名
	TlsCN      string   // tls使用者名称
	TlsDNS     []string // tlsDNS列表
	Fingers    []string // 识别到的web指纹
}

HttpInfo Http服务基础信息

func (*HttpInfo) String

func (hi *HttpInfo) String() string

type IpOption

type IpOption struct {
	FingerPrint bool        // 探测服务
	Httpx       bool        // 探测 HttpInfo
	Ext         interface{} // 扩展属性
}

IpOption 对开放端口进一步处理参数

type OpenIpPort

type OpenIpPort struct {
	Ip       net.IP
	Port     uint16
	Service  string
	Banner   []byte
	HttpInfo *HttpInfo
	IpOption
}

OpenIpPort retChan

func (OpenIpPort) String

func (op OpenIpPort) String() string

type Scanner

type Scanner interface {
	Close()
	Wait()
	Scan(ip net.IP, dst uint16, ipOption IpOption) error
	WaitLimiter() error
}

type ScannerOption

type ScannerOption struct {
	Rate    int    // 每秒速度限制, 单位: s, 会在1s内平均发送, 相当于每个包之间的延迟
	Timeout int    // TCP连接响应延迟, 单位: ms
	NextHop string // pcap dev name
	Debug   bool
}

ScannerOption 扫描器初始化参数

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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