ARP scan detection
ARP is how a computer asks which MAC address has a given IP in the local network.
A computer that reconnects to the network and goes back to talking to its neighbours sends many normal ARP requests.
So the number of ARP requests alone doesn’t prove a scan.
The
arpmodule tells normal requests apart from scans using:which IPs the device already talked to before.
how the IPs are asked about: in order, or a lot of them.
No training or machine learning is used.
When is an evidence set
With the default settings of the arp section in config/slips.yaml:
Slips counts the different IPs a device asks about in the last 30 seconds.
Asking about the same IP again counts once.
5 different IPs make Slips take a closer look.
Slips waits 3 seconds for ARP replies and connections to show up, then decides.
It doesn’t need another ARP packet to decide.
A low threat level
ARP_SCANevidence is set when all of these are true:at least 10 of the IPs are unfamiliar to the device. See what “familiar” means.
at least 80% of all the IPs are unfamiliar.
either 70% of the requests ask about the IP right before or after the previous one, or at least 32 of the IPs are unfamiliar. So a large scan is detected even when it goes through the IPs in a random order.
if Slips never saw this device have a successful connection before, at least 10 of the IPs must also be IPs that Slips never saw sending traffic in this network.
If the device asked about 32 IPs or more and the conditions above are not met, an info
ARP_DISCOVERYevidence is set.Info evidence adds nothing to the alert score and can’t cause an alert.
Fewer requests that don’t look like a scan set no evidence.
Requests that are not counted:
the source IP is
0.0.0.0.the target is a multicast or broadcast IP.
the source and the target IPs are the same.
so address conflict checks and address announcements are not counted.
requests from the gateway, when Slips runs on an interface and knows the gateway IP.
How often an evidence is set:
The 30 seconds don’t depend on Slips time windows. They can cover the end of one and the start of the next.
One device gets at most one evidence every 300 seconds, even if it keeps scanning.
An
ARP_SCANcan still be set during these 300 seconds if only anARP_DISCOVERYwas set before.Each evidence links to at most 20 of the requests.
Example |
Result |
|---|---|
A device asks about 15 IPs it used before, after reconnecting |
No evidence |
12 unfamiliar IPs in a row, with few familiar ones |
|
40 unfamiliar IPs in a random order |
|
40 familiar IPs |
|
The same familiar IP asked about 200 times |
One target, no evidence |
An IP that other devices use, but this device never did |
Still unfamiliar to this device |
What “familiar” means
An IP is familiar to a device when the device had two TCP or UDP connections to it, with data sent in both directions, at least scan_familiar_min_interval_seconds (300 seconds) apart.
These don’t make an IP familiar:
an empty TCP connection.
a connection that got no answer.
an ARP request or an ARP reply.
The same connection seen twice counts once.
Familiar means “this device used this IP before”. It doesn’t mean the device or its traffic is safe.
The two connections must have happened before the ARP requests being checked. Requests can’t make their own targets familiar.
Only connections inside the local IPv4 network are learned:
both IPs must be in the local subnet.
if Slips doesn’t know the subnet, both IPs must have been seen sending ARP before.
both sides need a MAC address. A missing MAC is filled from what Slips saw before.
Asking about an IP in an ARP request doesn’t prove that the IP exists.
What a device knows is kept per source MAC, destination IP and MAC, gateway MAC and subnet.
Another device, another network, or a destination that changed its MAC starts from zero.
A familiar IP can still be part of a scan. A device can’t hide a scan by adding a few familiar IPs to it.
What the evidence says about replies and connections:
It shows how many targets sent an ARP reply, and how many the device then had a normal connection with.
Normal connections to most of the targets lower the confidence. Replies alone don’t.
Missing replies or connections are treated as unknown, not as a failure:
Slips may see the broadcast ARP request but not the traffic between two other devices.
Zeek logs a connection only when it ends.
Limits:
A device joining a new network, and inventory tools, can still look like a scan.
The evidence explains what was seen. ARP alone can’t tell why the device did it.
Checking which rule set an evidence
Each new ARP evidence stores the numbers it is based on: how many targets, how many were unfamiliar, and the settings used.
The default minimum is 10 unfamiliar IPs. 7 linked requests alone can’t reach it.
The web interface shows these numbers.
Evidence from older Slips versions doesn’t have them and is labeled Legacy ARP scan evidence.
It is kept as is. The number of flows linked to it doesn’t say how many IPs were unfamiliar.
Restarts, changing networks and storage
Where the learned connections are saved:
On an interface:
<permanent_dir>/arp/contacts.sqlite.After a restart they are loaded again for the same network (same gateway and subnet) and the same devices.
So Slips doesn’t need a quiet period after starting.
If Slips can’t tell which network it’s on, what it learns is only used in the current run.
PCAPs and Zeek logs:
<output_dir>/arp/contacts.sqlite.They always start from zero.
They never read or change what was learned on an interface, even if they use the same private IPs.
Configuration
Put these options in the
arp:section of your Slips YAML config file.Restart Slips after changing them.
Option |
Default |
What it does |
|---|---|---|
|
30 |
Seconds of ARP requests that Slips looks at together. |
|
5 |
Different IPs a device has to ask about before Slips takes a closer look. This number alone sets no evidence. |
|
10 |
How many of the IPs have to be unfamiliar for a scan. |
|
0.8 |
Share of the IPs that has to be unfamiliar. Stops a few new IPs among many familiar ones from being reported. |
|
32 |
With this many unfamiliar IPs, the order of the requests doesn’t matter. This many IPs without the other signs of a scan set an |
|
0.7 |
Share of requests that ask about the IP right before or after the previous one. Catches smaller scans that go in order. |
|
3 |
Seconds to wait for replies and connections before deciding. 0 decides right away. |
|
300 |
Minimum seconds between two evidence about the same device. A scan with a higher confidence is still reported right away. A confirmed scan is over after this many seconds without requests to unfamiliar IPs. |
|
300 |
Minimum seconds between the two connections that make an IP familiar. Stops one short burst from making its own targets familiar. |
|
30 |
Days without a connection before a familiar IP is forgotten. |
|
120 |
Seconds between saves to disk. A higher number writes less, and loses more if Slips crashes. |
|
256 |
Maximum devices followed at the same time. The one that was quiet the longest is dropped first. |
|
512 |
Maximum IPs remembered per device. When reached, the evidence says its numbers are partial. |
|
8192 |
Maximum “device knows IP” records. A higher number remembers more and uses more memory and disk. |
The numbers must follow
scan_min_targets ≤ scan_min_unfamiliar_targets ≤ scan_broad_targets ≤ scan_max_targets.With invalid settings the
arpmodule doesn’t start, and prints an error that says which setting is wrong.
Evidence in the web interface
Evidence and Hosts show
ARP_SCANorARP_DISCOVERYwith its threat level, confidence, description and the requests that caused it.The investigation pane shows how many targets there were, how many were familiar and unfamiliar, how many replied, and how many had normal connections.
These numbers, and the settings used in that run, are stored in
detection_details.arp_scanof the evidence.Old evidence without these numbers keeps its old description (5 targets rule). Upgrading Slips never changes old evidence or scores.
Scans that keep going
ARP scans use the same rules as the other scans, see scan confidence and scans that keep going.
The confidence goes up with the number of unfamiliar IPs (default settings):
Confidence |
Needs |
|---|---|
95% |
at least 20 unfamiliar IPs (twice |
100% |
at least 100 unfamiliar IPs (10 times |
The confidence is not raised when:
the source MAC is missing.
the limit of IPs per device was reached.
the device had normal connections with 80% or more of the targets.
ARP_DISCOVERYstays info, however many IPs are asked about.
Once a scan reaches 100%:
Slips stops keeping every target, and keeps a small counter (1 KB) and at most 20 request IDs instead.
Only unfamiliar IPs are counted. Familiar IPs don’t make the scan bigger or longer.
A new evidence is set when the count reaches around 1,000, then 10,000 and so on. Its count is marked as approximate.
The web interface labels this evidence as a continuing scan, and doesn’t show the reply and connection numbers of the first evidence as if they were new.
The threat level stays low.
After
scan_alert_cooldown_secondswithout requests to unfamiliar IPs the scan is over, and the next requests are checked from zero. What Slips learned about familiar IPs is kept.