Skip to main content

ScanPhase

Struct ScanPhase 

Source
pub struct ScanPhase { /* private fields */ }
Expand description

One completed call into the engine.

Implementations§

Source§

impl ScanPhase

Source

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.

Source

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

Source

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.

Source

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.

Source

pub fn kind(&self) -> ScanKind

Which entry point this phase records.

Source

pub fn started_at(&self) -> SystemTime

When the phase began.

Source

pub fn elapsed(&self) -> Duration

How long the phase ran, measured monotonically.

Source

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.

Source

pub fn targets(&self) -> &TargetScope

What the phase was asked to cover.

Source

pub fn settings(&self) -> &ScanSettings

The settings the phase ran under.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn failures(&self) -> &[ScannerFailure]

The strategies in this phase that could not do their job.

Source

pub fn refusals(&self) -> &[Refusal]

Ground this phase declined to cover, and why.

With failures, everything the phase did not answer. See Refusal.

Source

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 Clone for ScanPhase

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScanPhase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&PhaseRecord> for ScanPhase

Source§

fn from(record: &PhaseRecord) -> Self

Converts to this type from the input type.
Source§

impl From<&ScanPhase> for PhaseRecord

Source§

fn from(phase: &ScanPhase) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more