port

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTcpOption = Option{
	Rate:    1000,
	Timeout: 800,
}
View Source
var TopTcpPorts = []uint16{}/* 1000 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 NewTcpScanner

func NewTcpScanner(retChan chan OpenIpPort, option Option) (ts *tcpScanner, err error)

NewTcpScanner Tcp扫描器

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 OpenIpPort

type OpenIpPort struct {
	Ip   net.IP
	Port uint16
}

OpenIpPort retChan

type Option

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

Option ...

type Scanner

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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