scan

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blacklist

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

Blacklist manages blacklisted IP network.

func (*Blacklist) Add

func (b *Blacklist) Add(cidr string) error

Add adds a network to blacklist from CIDR notation.

func (*Blacklist) Contains

func (b *Blacklist) Contains(ip net.IP) bool

Contains returns true/false if blacklist contains IP.

func (*Blacklist) Parse

func (b *Blacklist) Parse(path string) error

Parse parses file containing lines of CIDR notation into blacklist.

type Result

type Result struct {
	IP      net.IP `json:"ip"`
	Port    int    `json:"port"`
	Headers string `json:"headers"`
}

Result represents one scan result.

type Scanner

type Scanner struct {
	Port        int
	Request     []byte
	Threads     int
	DialTimeout time.Duration
	ReadTimeout time.Duration
	Blacklist   *Blacklist
	Dialer      proxy.ContextDialer
}

Scanner manages TCP scanning.

func NewScanner

func NewScanner(threads int) *Scanner

NewScanner returns new Scanner with threads count.

func (*Scanner) SetProxy

func (s *Scanner) SetProxy(proxyURL string) error

SetProxy sets a proxy for the scanner by URL.

func (*Scanner) Start

func (s *Scanner) Start() chan *Result

Start workers concurrently and return result channel.

Jump to

Keyboard shortcuts

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