BScanner

package
v0.0.0-...-eedd94a Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ip2long

func Ip2long(ip string) uint32

func Long2ip

func Long2ip(proper uint32) string

Types

type Scanner

type Scanner struct {
	Timeout time.Duration
}

func New

func New() *Scanner

初始化一个扫描器

func (*Scanner) DoScanPort

func (s *Scanner) DoScanPort(target, portList string, callback func(net.Conn)) bool

func (*Scanner) DoScanPortRange

func (s *Scanner) DoScanPortRange(target string, portStart, portEnd int, callback func(net.Conn), finish chan bool) bool

func (*Scanner) ScanAllPort

func (s *Scanner) ScanAllPort(ip string, callback func(net.Conn)) error

扫描目标主机打开的端口列表

func (*Scanner) ScanIp

func (s *Scanner) ScanIp(startIp string, endIp string, port int, callback func(net.Conn)) error

异步TCP扫描网段及端口,如果扫描的端口是打开的,那么将链接给定给回调函数进行调用 注意startIp和endIp需要是同一个网段,否则会报错,并且回调函数不会执行

func (*Scanner) ScanIpPortList

func (s *Scanner) ScanIpPortList(portList, startIp string, mask uint, callback func(net.Conn)) error

注意startIp和endIp需要是同一个网段,否则会报错,并且回调函数不会执行

func (*Scanner) ScanPort

func (s *Scanner) ScanPort(ip, port string, callback func(net.Conn)) error

func (*Scanner) ScanPortSplit

func (s *Scanner) ScanPortSplit(portList string, startIplong, endIplong uint32, callback func(net.Conn), finish chan bool)

func (*Scanner) SetTimeout

func (s *Scanner) SetTimeout(t time.Duration) *Scanner

设置超时时间,注意这个时间是每一次扫描的超时时间,而不是总共的超时时间

Jump to

Keyboard shortcuts

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