pub struct ScanPhase { /* private fields */ }Expand description
One completed call into the engine.
Implementations§
Source§impl ScanPhase
impl ScanPhase
Sourcepub fn from_parts(parts: PhaseParts) -> Self
pub fn from_parts(parts: PhaseParts) -> Self
Rebuilds a phase from what was recorded of it.
For restoring an earlier sitting of a resumed scan. A running phase comes from
PhaseRecorder.
Sourcepub fn attribute(&mut self, origin: PhaseOrigin)
pub fn attribute(&mut self, origin: PhaseOrigin)
Attributes this phase to the document it was read from.
Used by merge, which knows the document’s name and producer.
Source§impl ScanPhase
impl ScanPhase
Sourcepub fn origin(&self) -> Option<&PhaseOrigin>
pub fn origin(&self) -> Option<&PhaseOrigin>
Which document this phase came from, for one folded into a merged report
from elsewhere. None for a phase this process measured.
Sourcepub fn attachments(&self) -> &[Attachment]
pub fn attachments(&self) -> &[Attachment]
Where the machine running this phase was plugged in, as the equipment on the far end of the cable announced itself.
Empty for a phase that heard no announcement, as on an unmanaged network.
Sourcepub fn started_at(&self) -> SystemTime
pub fn started_at(&self) -> SystemTime
When the phase began.
Sourcepub fn privilege(&self) -> Option<Privilege>
pub fn privilege(&self) -> Option<Privilege>
Whether the engine held the privileges its raw strategies need. An unprivileged phase reached its targets over plain TCP connect attempts, which see less and are more visible to the target.
None for a phase this engine did not measure, such as one imported from
another scanner’s report.
Sourcepub fn targets(&self) -> &TargetScope
pub fn targets(&self) -> &TargetScope
What the phase was asked to cover.
Sourcepub fn settings(&self) -> &ScanSettings
pub fn settings(&self) -> &ScanSettings
The settings the phase ran under.
Sourcepub fn unroutable(&self) -> &[IpAddr]
pub fn unroutable(&self) -> &[IpAddr]
Addresses this host could not reach, so no probe was sent to them, ascending: no route or source address led to them, or they are neighbours on a local segment that never answered address resolution.
Not failures, and not counted as partial. An address here was
never probed.
Sourcepub fn refused_by_route(&self) -> &[IpAddr]
pub fn refused_by_route(&self) -> &[IpAddr]
The addresses among unroutable that this host’s
own routing table refuses, ascending.
A prohibit, blackhole or unreachable route, or a VPN kill switch’s rules,
is host policy that every program honours, so the engine sends such an address
nothing. Named apart because the remedy is on this machine.
Named where the engine can tell: a neighbour on one of this host’s segments,
whose connected route only a policy overrides; and any address the kernel
refuses with an error only a policy produces (permission denied for prohibit,
invalid argument for blackhole, on Linux). An unreachable route elsewhere
looks like a missing route and is not named here.
Sourcepub fn timed_out(&self) -> &[IpAddr]
pub fn timed_out(&self) -> &[IpAddr]
Addresses the phase left before it had finished with them, because the
per-host budget in
ScanSettings::host_timeout ran out.
A host named here still carries every port the phase managed to ask.
Sourcepub fn icmp_rate_limited(&self) -> &[IpAddr]
pub fn icmp_rate_limited(&self) -> &[IpAddr]
Addresses whose ICMP errors this phase found rate-limited, ascending.
A closed UDP port is known only by its host’s ICMP port unreachable, which hosts
ration (Linux: a burst, then about one a second). On a host here most closed ports
read OpenOrNoReply, so its open-or-no-reply ports are mostly closed.
Inferred from the host’s answers: a port answered closed only when asked again, after others answered at once, while more ports stayed silent than answered, which a filter does not produce.
Needs a port asked more than once, so only raw-socket scans name hosts here.
Sourcepub fn reached_by_connect(&self) -> &[IpRange]
pub fn reached_by_connect(&self) -> &[IpRange]
Addresses this phase reached by TCP connect although it held the privilege its raw strategies need, ascending.
Some addresses are beyond a raw probe whatever the privilege: loopback, and
anything with no route. A process that can inject frames but holds no raw socket
(an unprivileged macOS run with BPF access) also cannot reach this host’s own
addresses, anything routed through a tunnel, or, for port probes, an IPv6
neighbour. Those were probed by connect, so their evidence is connect evidence
although privilege reads raw, and the configured technique
was not used.
An address no probe could leave for is unroutable instead.
Empty for most phases, and for every Privilege::Connect phase.
Sourcepub fn undecided(&self) -> &[IpRange]
pub fn undecided(&self) -> &[IpRange]
Addresses in this phase’s scope whose presence it reached no verdict on, ascending.
A discovery phase settles an address when something answers or the retry budget is spent. An address here is neither: the phase stopped before or while asking, had no strategy that could ask, was refused the range, or ran out the address’s time budget. None is a host found down; a port scan leaves their ports unsettled and a resumed job asks again. Without this list, an address never asked would look like one that stayed silent.
Disjoint from unroutable. An address can be here and in
timed_out, which says why.
A port phase standing in for a dropped liveness pass (see
LivenessSkip::PortsNoDearer) names here addresses it heard nothing from
without finishing asking; the report lists no host for them and a resumed job
asks their ports again. If such a phase never closed, it names every address it
had not yet decided.
Empty for other port scans, which settle ports rather than presence, and for listeners.
Sourcepub fn liveness_skipped(&self) -> Option<LivenessSkip>
pub fn liveness_skipped(&self) -> Option<LivenessSkip>
Why this port phase ran with no liveness pass in front of it.
None when a liveness pass preceded it (recorded as its own
Discovery phase), and for every phase that is not a
PortScan. The reasons differ in what the findings mean;
see LivenessSkip.
Sourcepub fn silent(&self) -> &[IpRange]
pub fn silent(&self) -> &[IpRange]
Addresses this port phase asked on every port it named and heard nothing from at all, ascending.
Filled only where the phase stood in for a dropped liveness pass; see
LivenessSkip::PortsNoDearer. An address that drew no open port, closed port
or ICMP error is named here, not listed as a host. Its ports were asked, so it is
not undecided, and a comparison reads it as covered and
quiet.
Empty for every other phase. With ZondConfig::assume_up every address is a
host.
Sourcepub fn stopped(&self) -> Option<StopReason>
pub fn stopped(&self) -> Option<StopReason>
Why the scan was stopped while this phase was running: the caller
asked (Aborted), or the scan’s own budget ran
out (TimedOut).
None for a phase that ended on its own, and for every
Listen phase, which always ends by being stopped.
A marker, not a verdict: what a stop cut shows as unreached
targets, unasked ports, undecided addresses and
passes_cut, which ScanReport::is_partial reads. This
adds the reason.
Sourcepub fn passes_cut(&self) -> &[Pass]
pub fn passes_cut(&self) -> &[Pass]
The passes over what the probes found that a stop skipped or cut short, in the order a scan runs them. Empty for a phase no stop cut, and for one stopped before any pass had work to do.
Only passes the scan was asked to run and had work for: with TLS enumeration
off, or no TLS port found, no TLS pass is named. ScanReport::is_partial
counts these.
A pass cut short on some ports by a detection’s budget or the file limit is a failure marked cut short, naming the port.
Sourcepub fn is_open(&self) -> bool
pub fn is_open(&self) -> bool
Whether this is the phase as it stood before it closed: a record kept as it ran, for a sitting killed outright.
From a journal, an open phase was killed or still running when read. It records
what the phase opened with, how long it ran and what failed, but nothing only its
close establishes (no stop, unreached target
or pass cut), so ScanReport::is_partial counts it.
Not a StopReason: nothing running names a kill.
Sourcepub fn unreached(&self) -> u128
pub fn unreached(&self) -> u128
How many of this port phase’s targets it never asked and holds on no
host: the ones its walk never reached because the scan was stopped
first, the ones it passed for an address its liveness pass reached no
verdict on, and the ones left unasked at an address it then listed no
host at, being undecided.
A count, since a permuted walk scatters what a stop leaves across every address,
and a /16 on every port stopped a minute in would list billions. Every target
the phase was handed was probed (counted by its hosts and
unheard_probes), is on its host
Unasked, is counted here, or was
settled without a probe (silent, unreachable, or excluded).
A resumed job asks every one of them. Zero for a phase that asked everything,
and for every non-PortScan phase. See
ScanReport::unreached for several sittings.
Sourcepub fn unheard_probes(&self) -> u128
pub fn unheard_probes(&self) -> u128
How many of this port phase’s targets it asked at the addresses it
lists no host at: every port of the ones it names
silent, and the ports it reached of the ones it names
undecided.
Those addresses’ records are dropped, so a count of probed ports read off the hosts comes up short by exactly this. The scope cannot supply it, since a mixed scope records a union and an undecided address was asked only part of its ports.
Each sitting of a resumed job counts its own, and the counts add up. A phase that never closed counts the probes of its silent addresses; the sitting that decides the undecided ones counts theirs. Zero for every phase that did not stand in for a liveness pass, and in a record without the count.
Sourcepub fn failures(&self) -> &[ScannerFailure]
pub fn failures(&self) -> &[ScannerFailure]
The strategies in this phase that could not do their job.
Sourcepub fn probe_stats(&self) -> &[ProbeStats]
pub fn probe_stats(&self) -> &[ProbeStats]
What each instrumented scanner observed about its own run.
Empty where no strategy carries instrumentation; the TCP-connect fallback has no capture to audit.
Trait Implementations§
Source§impl From<&PhaseRecord> for ScanPhase
impl From<&PhaseRecord> for ScanPhase
Source§fn from(record: &PhaseRecord) -> Self
fn from(record: &PhaseRecord) -> Self
Auto Trait Implementations§
impl Freeze for ScanPhase
impl RefUnwindSafe for ScanPhase
impl Send for ScanPhase
impl Sync for ScanPhase
impl Unpin for ScanPhase
impl UnsafeUnpin for ScanPhase
impl UnwindSafe for ScanPhase
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more