goudpscan

package
v0.0.0-...-ab4d1c7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EchoReply              = 0
	DestinationUnreachable = 3
)
View Source
const MaxBufferSize = 65565

Variables

This section is empty.

Functions

func BreakUPPort

func BreakUPPort(portRange []byte) ([]uint16, error)

BreakUPPort breaks up a port range into ports.

func BreakUpIP

func BreakUpIP(segments [][]byte) ([][]byte, error)

BreakUpIP breaks up an IP address into subnets.

func Hosts

func Hosts(cidr []byte) ([][]byte, error)

Hosts generates all host IP addresses within a CIDR range.

func ParseSubnet

func ParseSubnet(subnet []byte) ([][]byte, error)

ParseSubnet parses a subnet into subnets.

func Segmentation

func Segmentation(subnet []byte) [][]byte

Segmentation splits a subnet into segments.

Types

type Options

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

func NewOptions

func NewOptions(
	fast bool,
	timeout uint,
	recheck uint8,
	maxConcurrency int,
) *Options

type Scanner

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

Scanner is a UDP scanner.

func New

func New(
	opts *Options,
	hosts []string,
	ports []string,
	payloads map[uint16][]string,
) *Scanner

New creates a new Scanner instance. opts: Scanning options. hosts: List of target hosts. ports: List of target ports. payloads: Custom payloads for specific ports. Returns a pointer to the Scanner instance.

func (*Scanner) Scan

func (s *Scanner) Scan(
	errors chan<- ScannerError, seed int64,
) map[string][]byte

Scan scans the hosts and ports and returns the results.

func (*Scanner) SendRequests

func (s *Scanner) SendRequests(
	errors chan<- ScannerError,
	wgAll *sync.WaitGroup,
	opts *Options,
	throttleConc chan struct{},
	ips [][]byte,
	port uint16,
	payloads map[uint16][]string,
)

SendRequests sends UDP requests with a dedicated payloads to the specified targets.

func (*Scanner) SniffICMP

func (s *Scanner) SniffICMP(ctx context.Context, wg *sync.WaitGroup) error

SniffICMP listens for ICMP packets and writes the results to the scanData map.

type ScannerError

type ScannerError struct {
	OrigError      error
	CustomErrorMsg string
	Metadata       map[string]interface{}
}

ScannerError is a custom error structure to handle goroutine errors.

func (ScannerError) Error

func (se ScannerError) Error() string

Jump to

Keyboard shortcuts

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