Skip to content

internal/target

import "github.com/nuqs-org/nuqs/internal/target"

Package target checks what the user asked us to scan before it ever reaches Nmap.

We accept single IPs, CIDR blocks ("10.0.0.0/24"), last-octet ranges ("10.0.0.1-50") and hostnames. Anything else is rejected, which also stops tricks like passing "-oN file" as a target.

Constants

DefaultLimit is how many addresses one scan may cover unless the user forces it.

const DefaultLimit = 1024

Defined in internal/target/target.go:19

Variables

ErrTooMany is returned when the targets add up to more addresses than allowed.

var ErrTooMany = errors.New("too many targets")

Defined in internal/target/target.go:22

Functions

Parse

Parse validates every spec and returns them cleaned up and de-duplicated, along with how many addresses they cover. A hostname counts as one address. If limit is 0 or less there is no limit.

func Parse(specs []string, limit int64) ([]string, int64, error)

Defined in internal/target/target.go:27