scan

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 40 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialTCP

func DialTCP(ip string, port uint16) (net.Conn, error)

func DialTLS

func DialTLS(ip string, port uint16) (net.Conn, error)

func DialUDP

func DialUDP(ip string, port uint16) (net.Conn, error)

Types

type Config

type Config struct {
	//// Target to fingerprint (IP and port pair)
	// deprecated
	Target netip.AddrPort

	// IP, UDP, TCP, or TCPTLS
	TargetProtocol plugins.Protocol

	// UDP scan
	UDP bool

	// deprecated
	Speed Speed

	FastlaneMode bool

	// The timeout value should be positive.
	// The behavior for non positive timeout values is undefined.
	// The timeout specifies how long certain tasks should wait during the scanning process.
	// This may include the timeouts set on the handshake process and the time to wait for a response to return.
	// However, the exact use of the timeout is not defined.
	DefaultTimeout time.Duration

	// deprecated
	// Specify the maximum number of conncurent connections made at a time during the scan.
	// This value must be at least 1.
	MaxConcurrentConnections uint

	// If the service is not in the map, the default timeout is used.
	TimeoutOverride map[plugins.PluginID]time.Duration

	// deprecated
	// If true, errors occurred during plugin runs are reported in the results returned
	ReportPluginErrors bool

	// deprecated
	// Only allow using unicast addresses.
	// This flag does not exclude IPv4 directed broadcast addresses.
	GlobalUnicastOnly bool

	// Prints logging messages to stderr
	Verbose bool

	// deprecated
	// This value allows limiting the rate of packets sent by the scanner.
	// This value is an approximation and does not apply to all protocols.
	// This value must be at least 1.
	// deprecated
	PacketsPerSecond int
	// This value allows limiting the rate of packets sent by the scanner.
	// This value is an approximation and does not apply to all protocols.
	// This value must be at least 1.
	BitsPerSecond int
}

func (Config) GeneratePluginConfig

func (c Config) GeneratePluginConfig(p plugins.Plugin) plugins.PluginConfig

func (*Config) UDPScanTarget

func (c *Config) UDPScanTarget(target netip.AddrPort) (ReportedResult, error)

UDP Scan of the target

type ReportedResult

type ReportedResult struct {
	Addr    netip.AddrPort
	Plugin  plugins.Plugin
	Results *plugins.PluginResults
	Error   error
}

either Results or Error will be nil

func ScanTargets

func ScanTargets(targets []netip.AddrPort, config Config) ([]ReportedResult, error)

ScanTargets fingerprints service(s) running given a list of targets.

func UDPScan

func UDPScan(targets []netip.AddrPort, config Config) ([]ReportedResult, error)

type Speed

type Speed int
const (
	Slow    Speed = -1
	Default Speed = 0
	Fast    Speed = 1
)

Jump to

Keyboard shortcuts

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