Scan confidence and scans that keep going

  • Port, SMB, ARP and DHCP scan detections work the same way:

    1. keep the exact list of targets until the scan is confirmed (100% confidence).

    2. then drop the list and keep a small counter instead.

  • ICMP scans use the counts given by Zeek, so Slips keeps no list for them.

What the confidence means:

  • It says how sure Slips is that the traffic is that kind of scan.

  • 100% means all the conditions of that scan were met.

  • It doesn’t mean that the device is infected, that the scan was not allowed, or that an attack worked.

  • The threat level is separate. For example an ARP scan stays low, and access to SMB shares on many servers stays medium.

How the confidence grows

For each detection:

  • N is the minimum number of different targets in its settings.

  • C is how many different targets were seen.

  • Q is the share of the targets that look like scanning: failed connections, or unfamiliar IPs for ARP. Not every detection uses it.

Confidence

Needs

the start value of the detection

the rule of the detection passed

at least 95%

C >= max(20, 2 × N) and Q >= 90%

100%

C >= max(100, 10 × N) and Q >= 95%

  • The other checks of the detection must still pass. A lot of traffic alone never gives 100% when:

    • the packet history is missing.

    • the network may be down.

    • only a few ACK/FIN packets were seen.

    • the ARP targets are familiar.

  • Repeated packets and retries to the same target or port count once.

Scan

What is counted

What else is needed, and the default count for 100%

Horizontal SYN scan

Destination IPs on one port

New SYNs from the source, enough failed targets, and either repeated rejections or targets close to each other. 100 targets in the fast check, 250 in the slow one.

Horizontal scan with empty connections

Destination IPs on one port

Completed handshake, no data, closed by the source within 3 seconds, targets close to each other. 100 targets in the fast check.

Horizontal UDP scan

Destination IPs on one port

No answers, targets close to each other, enough failed targets. 100 targets in the fast check.

Vertical SYN/UDP scan

Failed ports on one host

SYN attempts or UDP with no answer. 100 ports. A port that later works is not counted anymore. Missing history and ACK/FIN only traffic keep a lower confidence.

SMB host scan

Destination hosts

At least 95% failed SYNs from the source. 200 hosts. Without SYN history the confidence stays at its start value.

SMB share sweep

Server IPs or share names

Shares that were really opened, in the configured time. 100 servers or 100 share names. This can be normal admin work.

ARP scan

Unfamiliar target IPs

The usual ARP scan checks. 100 unfamiliar IPs, and at least 95% of the IPs unfamiliar. Not raised when the limit of IPs was reached or the device had normal connections with most targets.

DHCP scan

IPs requested by one client

Different requested IPs, per client MAC, interface and Slips time window. 100 IPs. Renewing the same IP counts once.

ICMP scan

Number of hosts in a Zeek scan notice

Zeek counts the hosts and decides when to send a notice. Slips can’t report growth if Zeek sends no more notices.

  • If a memory limit in the settings is lower than the count needed for 100%, the scan can’t reach 100%.

  • A warning about a limit means that older records were dropped. The records that are still there are valid.

What happens while a scan keeps going

At 100% the detection drops its list of targets and keeps:

  • a counter of different values that always takes 1 KB.

  • at most 20 flow IDs to link to the evidence.

  • for horizontal port scans, up to 31 flows that wait to be checked. They are checked 32 at a time against Slips P2P connections.

New evidence for a scan that keeps going:

  • is set when the count reaches around 1,000, then 10,000, 100,000 and so on, not every few packets.

  • keeps the confidence and the threat level of the confirmed scan.

  • says that its count is approximate, and its time covers the whole scan so far.

  • A vertical scan can’t count more than 65,535 ports, and retries don’t count.

The counter:

  • uses HyperLogLog with 1,024 registers. See the algorithm paper.

  • is usually off by around 3.25%. This is not a guaranteed limit.

  • is only used after a scan is confirmed, never to decide if something is a scan.

  • takes the same small amount of work for each update and each read.

When a scan is over:

  • After the cooldown of the detection without new probes, the next probes are checked from zero.

  • ARP: familiar IPs don’t make the scan longer or bigger.

  • DHCP: a new Slips time window also starts from zero.

  • ICMP: a notice with a lower number of hosts than the previous one starts from zero.

SMB:

  • The SMB module still keeps what it needs to link scans to file transfers, logins, share paths and file operations.

  • Confirming a host scan drops its list of probes. Confirming a share sweep drops its list of shares. Nothing else is deleted.

  • A confirmed SMB scan is still used by the suspicious upload and spreading checks.

  • The confidence in the SMB settings is the start value of SMB_SCAN and SMB_SHARE_SWEEP. It doesn’t change for the other SMB detections.

Performance

  • All counters live inside the detection modules. Nothing was added to capturing, parsing, profiling or passing flows to the modules.

  • No new Redis keys are added.

  • Slips doesn’t write the old vertical port scan keys to Redis anymore. The code that reads them is kept for older runs.

  • Vertical port scan and DHCP detections don’t ask Redis for totals anymore.

  • Slips doesn’t look up the service name of failed and non-TCP connections anymore. The check for connections to several unknown ports works as before.

  • Everything kept in memory has a maximum size.

  • The vertical port scan detection only starts following a source and destination pair after a second different port.

    • Contacts on one port only go to a separate small list.

    • So a large horizontal scan can’t push out the vertical scans being followed, or cause wrong warnings about limits.

See also

  • Port scans, SMB detection and ARP scans for the settings and limits of each detection.

  • Restart Slips, or run the analysis again, after changing the code or the settings.

  • Stored evidence keeps the confidence it had when it was set. --view doesn’t compute it again.