drive

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Masscan

type Masscan struct {
	// Args are masscan arguments placed before the target specs (e.g. "-p1-65535", "--rate=10000").
	Args []string
	// BinaryPath overrides the masscan binary location; empty uses $PATH.
	BinaryPath string
}

Masscan drives the masscan port scanner. masscan emits nmap-compatible XML (-oX), so its output folds into the model through the very same scan/nmap parser the Nmap driver's hosts flow through — the driver just execs masscan, appends `-oX <tmpfile>`, and on exit parses that file into per-host Results. Progress is read best-effort from masscan's stderr ("… N.NN% done").

Unlike Nmap (which drives the AIMS-native fork with a live host stream), masscan writes its XML only at completion, so hosts surface as one batch when the scan ends; the stderr percent keeps a foreground scan's display alive in the meantime.

func (Masscan) Scan

func (m Masscan) Scan(ctx context.Context, targets []*scanpb.Target, args ...string) (
	<-chan *scanpb.Result, <-chan *scanpb.TaskProgress, error,
)

type Nmap

type Nmap struct {
	// Args are nmap arguments placed before the target specs (e.g. "-sV", "-p1-1000").
	Args []string
	// BinaryPath overrides the nmap binary location; empty uses $PATH.
	BinaryPath string
}

Nmap is the reference Scanner, driving the AIMS-native nmap fork. Each host nmap reports is surfaced as a Result carrying that host (Result.Host) as it is found, so the downstream fold enriches the very objects the targets were derived from while the scan is still running.

func (Nmap) Scan

func (n Nmap) Scan(ctx context.Context, targets []*scanpb.Target, args ...string) (
	<-chan *scanpb.Result, <-chan *scanpb.TaskProgress, error,
)

type Scanner

type Scanner interface {
	// Scan runs the tool against targets (plus any extra tool arguments) and returns two
	// channels: Results to fold (Run.AddResult) and TaskProgress to display. Both are closed
	// when the scan ends; a nil error means the scan started, not that it succeeded.
	Scan(ctx context.Context, targets []*scanpb.Target, args ...string) (
		results <-chan *scanpb.Result,
		progress <-chan *scanpb.TaskProgress,
		err error,
	)
}

Scanner drives a tool against AIMS-selected targets and streams results back. It is the in-process form of the substrate; the server-side streaming RPC (SCAN.md Part C, Phase 4) puts the same surface behind the teamserver so foreground and detached scans share one path.

Jump to

Keyboard shortcuts

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