Documentation
¶
Index ¶
- Constants
- func ApplyQuickStrategy(o *Options)
- func ApplyQuickestStrategy(o *Options)
- func BuildStagePorts(rankedPorts []int) (s1 []int, s2 []int, s3 []int, s4 []int)
- func ChunkPorts(ports []int, chunkSize int) [][]int
- func DiscoverAliveHosts(ctx context.Context, opt *Options, hosts []string) ([]string, error)
- func LoadRankedPortsFile(filePath string) ([]int, error)
- func ParseRankedPorts(s string) []int
- type HostIterator
- type Options
- type PortIterator
- type PortState
- type ScanMode
- type ScanResult
- type Scanner
- type ServiceFingerprint
Constants ¶
View Source
const BuiltinPortRankingVersion = "builtin-2026-01-02"
Variables ¶
This section is empty.
Functions ¶
func ApplyQuickStrategy ¶
func ApplyQuickStrategy(o *Options)
func ApplyQuickestStrategy ¶
func ApplyQuickestStrategy(o *Options)
func BuildStagePorts ¶
func ChunkPorts ¶
func DiscoverAliveHosts ¶
func LoadRankedPortsFile ¶
func ParseRankedPorts ¶
Types ¶
type HostIterator ¶
type HostIterator struct {
// contains filtered or unexported fields
}
HostIterator iterates over a list of hosts/IPs
func NewHostIterator ¶
func NewHostIterator(targets []string) *HostIterator
NewHostIterator creates a new iterator from a list of targets
func (*HostIterator) GetHosts ¶
func (hi *HostIterator) GetHosts() []string
func (*HostIterator) Next ¶
func (hi *HostIterator) Next() (string, bool)
func (*HostIterator) Reset ¶
func (hi *HostIterator) Reset()
func (*HostIterator) Shuffle ¶
func (hi *HostIterator) Shuffle()
func (*HostIterator) Total ¶
func (hi *HostIterator) Total() int
type Options ¶
type Options struct {
Targets []string // List of IPs, CIDRs, or ranges
Ports string // Port range string (e.g., "80,443,1000-2000" or "top")
S4ChunkSize int
RateLimit int // Packets per second (approx) or concurrency limit
Timeout time.Duration
Retries int
ScanMode ScanMode
ServiceDB string // Path to nmap-services or custom fingerprints
OnResult func(*ScanResult)
OnProgress func(phase string, status string, finished int, total int, percent int)
OnDiscoveredHost func(host string)
Debug bool
LiveStats bool
Quiet bool
SkipDiscovery bool // Skip host discovery phase
DiscoveryPorts []int
DiscoveryFallback bool
DiscoveryFallbackPorts []int
DiscoveryMethod string
IcmpConcurrency int
PingConcurrency int
DiscoveryTop int
DiscoveryRetries int
LogDiscoveredHosts bool
}
Options configuration for the port scanner
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns a safe default configuration
type PortIterator ¶
type PortIterator struct {
// contains filtered or unexported fields
}
PortIterator iterates over a range of ports
func NewPortIterator ¶
func NewPortIterator(portStr string) (*PortIterator, error)
NewPortIterator creates a new iterator from a string definition Supported formats: "80", "80,443", "100-200", "top", "full", "s1", "s2", "s3", "s4"
func (*PortIterator) Next ¶
func (pi *PortIterator) Next() (int, bool)
func (*PortIterator) Reset ¶
func (pi *PortIterator) Reset()
func (*PortIterator) Total ¶
func (pi *PortIterator) Total() int
type ScanResult ¶
type ScanResult struct {
Host string
Port int
State PortState
Service string
Version string
Banner string
Fingerprint *ServiceFingerprint
}
ScanResult holds the result of a single port scan
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is the main entry point for port scanning
func NewScanner ¶
NewScanner creates a new scanner instance
type ServiceFingerprint ¶
ServiceFingerprint represents detected service details
func IdentifyService ¶
func IdentifyService(banner string, port int) *ServiceFingerprint
IdentifyService tries to identify the service based on the banner
Click to show internal directories.
Click to hide internal directories.