Skip to main content

ScanSettings

Struct ScanSettings 

Source
#[non_exhaustive]
pub struct ScanSettings {
Show 24 fields pub send_mode: SendMode, pub tcp_technique: TcpScanTechnique, pub sctp_technique: SctpScanTechnique, pub retry: RetryConfig, pub max_probe_rate: Option<NonZeroU32>, pub min_probe_rate: Option<NonZeroU32>, pub host_probe_interval: Option<Duration>, pub probe_interval: Option<Duration>, pub host_timeout: Option<Duration>, pub scan_timeout: Option<Duration>, pub dns_enabled: bool, pub redact: bool, pub os_detection: OsDetection, pub service_detection: ServiceDetection, pub detection: DetectionEnvelope, pub traceroute: bool, pub characterise: bool, pub ip_protocols: Vec<u8>, pub tls_enumeration: bool, pub listen_only_ports: Vec<u16>, pub excluded_ports: PortSet, pub evasion: Option<EvasionRecord>, pub idle_scan: Option<IdleScan>, pub icmp_evidence: bool,
}
Expand description

The settings that shaped what a phase did.

The ZondConfig fields that change which packets went out and how long the engine waited, which are what is needed to interpret or reproduce a result. A separate type, so a new config field does not silently join every exported report.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§send_mode: SendMode

How raw probes were placed on the wire.

§tcp_technique: TcpScanTechnique

Which segment each TCP port probe carried, and so what its answers mean.

Two Closed ports differ by this: one refused a connection attempt, the other reset a segment that was not one.

§sctp_technique: SctpScanTechnique

Which chunk each SCTP port probe carried, and so what its answers mean.

An OpenOrNoReply SCTP port came from a COOKIE-ECHO scan, which cannot report open; an INIT scan would have settled it.

§retry: RetryConfig

The retransmission budget and patience in force.

§max_probe_rate: Option<NonZeroU32>

The probe-rate ceiling, or None if the scanner’s own default applied.

§min_probe_rate: Option<NonZeroU32>

The probe-rate floor, or None if the scan was free to settle wherever it liked.

A scan that emitted more than its targets answered may have been told to finish; compare floors before concluding a network got noisier.

§host_probe_interval: Option<Duration>

The shortest gap kept between two probes at one host, or None if none was asked for.

Bounds how long a phase took: a thousand addresses a tenth of a second apart take at least a hundred seconds.

§probe_interval: Option<Duration>

The shortest gap kept between any two probes the scan sent, or None if none was asked for.

Like host_probe_interval: a thousand ports a second apart take at least a quarter of an hour.

§host_timeout: Option<Duration>

The wall-clock budget each host was given, or None if none was set.

Bounds what a host’s entry can say; which hosts ran out is ScanPhase::timed_out.

§scan_timeout: Option<Duration>

The wall-clock budget the whole phase was given, or None if none was set.

Like host_timeout, one level up: a phase stopped by it covered less than asked.

§dns_enabled: bool

Whether name resolution was permitted to generate traffic.

§redact: bool

Whether the caller asked for identifying detail to be masked.

§os_detection: OsDetection

How far the phase went to identify the operating system behind each host.

At OsDetection::Off nothing looked; at other levels something looked and found nothing conclusive. Also bounds the traffic the engine originated; see OsDetection::is_active.

§service_detection: ServiceDetection

How far the phase went to identify what was listening behind each open port.

At ServiceDetection::Off nothing asked; at other levels something asked and could not tell. Also says whether connections were completed, which a target’s application logs would record.

§detection: DetectionEnvelope

How intrusive a detection the phase was permitted to run over the services it identified.

Decides which findings could appear, so a clean port can be read as probed or spared.

§traceroute: bool

Whether the phase measured the route to each host that answered.

Tells a host with no path because nobody looked from one where nothing came back.

§characterise: bool

Whether the phase characterised the filter in front of each host that answered.

As with traceroute, tells not looking from finding nothing.

§ip_protocols: Vec<u8>

Which IP protocols the phase asked each host that answered about, ascending.

Per protocol, so a host with no verdict for 47 can be read as never asked.

§tls_enumeration: bool

Whether the phase established what each TLS port accepts.

Tells a port that was never enumerated from one that refused every offer.

§listen_only_ports: Vec<u16>

The TCP ports the phase connected to and listened on and sent nothing, ascending.

An open port here with only its number’s name was left unprobed on purpose. See ZondConfig::listen_only_ports and listened_only_to.

§excluded_ports: PortSet

The ports the phase sent nothing to on any target, empty where none were excluded.

Recorded as the policy, since the scope cannot tell a port never named from one excluded, and it also covers ports a phase picked itself. See ZondConfig::excluded_ports.

§evasion: Option<EvasionRecord>

What the scan changed about the packets it sent, or None if nothing; see EvasionRecord.

§idle_scan: Option<IdleScan>

The zombie a TCP port scan read its verdicts through, or None. Its presence means the ports were inferred from a third party’s counter. See IdleScan.

§icmp_evidence: bool

Whether the capture kept ICMP errors for a technique that did not need them for its verdict.

Without it, a NoReply port may be one a filter refused; with it, that port would read Blocked.

Implementations§

Source§

impl ScanSettings

Source

pub fn listened_only_to(&self, number: u16, protocol: Protocol) -> bool

Whether the phase only listened on number over protocol, sending it nothing, so that what the port reports is what it volunteered and no more.

use zond_engine::ZondConfig;
use zond_engine::model::port::Protocol;
use zond_engine::report::ScanSettings;

let settings = ScanSettings::from(&ZondConfig::default());
assert!(settings.listened_only_to(9100, Protocol::Tcp));
assert!(!settings.listened_only_to(9100, Protocol::Udp));
assert!(!settings.listened_only_to(80, Protocol::Tcp));

Trait Implementations§

Source§

impl Clone for ScanSettings

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 ScanSettings

Source§

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

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

impl From<&ScanSettings> for SettingsRecord

Source§

fn from(settings: &ScanSettings) -> Self

Converts to this type from the input type.
Source§

impl From<&SettingsRecord> for ScanSettings

Source§

fn from(record: &SettingsRecord) -> Self

Converts to this type from the input type.
Source§

impl From<&ZondConfig> for ScanSettings

Source§

fn from(cfg: &ZondConfig) -> Self

What a phase records about the request behind it.

Destructured with every field named, as for ProbeTuning, so a new ZondConfig field fails to compile here until it is handled.

Source§

impl PartialEq for ScanSettings

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ScanSettings

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