scanner

package
v0.0.0-...-c24ae90 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ALL_SCANS = map[string]Scans{
	"tls":       &scans.TLSScan{},
	"http":      &scans.HTTPScan{},
	"ssh":       &scans.SSHScan{},
	"scvs":      &scans.SCSVScan{},
	"dissectls": &scans.DissecTLSScan{},
	"jarm":      &scans.JARMScan{},
}

Functions

func LineCounter

func LineCounter(filename string) (int64, error)

LineCounter returns the number of lines in a file Adapted from: http://stackoverflow.com/questions/24562942/golang-how-do-i-determine-the-number-of-lines-in-a-file-efficiently

func ReadTargetsToChannel

func ReadTargetsToChannel(opts misc.Options, targetChan chan *scans.Target)

ReadIPsFromTxt reads IP addresses separated by newlines from an input file and sends them to the channel

Types

type CsvProcessor

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

func NewCsvProcessor

func NewCsvProcessor(outputDir string, skipErrors bool, cacheFunc func([]byte) []byte) *CsvProcessor

func (*CsvProcessor) Finish

func (p *CsvProcessor) Finish()

func (*CsvProcessor) Prepare

func (p *CsvProcessor) Prepare()

func (*CsvProcessor) ProcessResult

func (p *CsvProcessor) ProcessResult(result *results.ScanResult)

func (*CsvProcessor) ProcessSubResult

func (p *CsvProcessor) ProcessSubResult(parent *results.ScanResult, subResultIndex int)

func (*CsvProcessor) StartOutputWriter

func (p *CsvProcessor) StartOutputWriter(fileName string, header []string)

type Processor

type Processor struct {
	ResultProcessor
	OutputChan <-chan *results.ScanResult
}

Processor is the base result processing struct, embedding a ResultProcessor

func (Processor) Process

func (p Processor) Process()

Process is the result processing loop which calls the functions of the embedded ResultProcessor

type ResultProcessor

type ResultProcessor interface {
	Prepare()
	ProcessResult(*results.ScanResult)
	Finish()
}

func NewSSHHostKeyHostProcessor

func NewSSHHostKeyHostProcessor(hostkeyfile, hostfile, relfile string, skipErrors bool) *ResultProcessor

NewSSHHostKeyHostProcessor returns a new processor for results of scanned SSH hosts

type SSHHostKeyHostProcessor

type SSHHostKeyHostProcessor struct {
	Processor
	// contains filtered or unexported fields
}

SSHHostKeyHostProcessor implements the processing of SSH scanning results

func (SSHHostKeyHostProcessor) Finish

func (t SSHHostKeyHostProcessor) Finish()

Finish is called after the results have been processed

func (SSHHostKeyHostProcessor) Prepare

func (t SSHHostKeyHostProcessor) Prepare()

Prepare is called before the results are being processed

func (SSHHostKeyHostProcessor) ProcessResult

func (t SSHHostKeyHostProcessor) ProcessResult(result *results.ScanResult)

ProcessResult dumps the hostKey

type Scanner

type Scanner struct {
	NumRoutines int
	QPS         int
	ConnTimeout time.Duration
	SynTimeout  time.Duration
	SourceIP    *net.TCPAddr
	InputFile   string

	Input  chan *scans.Target
	Output chan *results.ScanResult
	// contains filtered or unexported fields
}

Scanner is the base struct that handles the scanning loop

func NewScanner

func NewScanner(opts *misc.Options, addr *net.TCPAddr, activatedScans []string) Scanner

func (*Scanner) Interrupt

func (s *Scanner) Interrupt()

func (*Scanner) PrintStatus

func (s *Scanner) PrintStatus()

func (*Scanner) Scan

func (s *Scanner) Scan()

Scan executes the scanning loop. It is non-blocking.

type Scans

type Scans interface {
	Init(opts *misc.Options, keylogFile io.Writer)
	GetDefaultPort() int
	Scan(conn net.Conn, target *scans.Target, result *results.ScanResult, timeout time.Duration, synStart time.Time, synEnd time.Time, limiter *rate.Limiter) (net.Conn, error)
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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