Comments (8)
OK, that makes sense. If you've got a network where you expect N hosts to be reachable, and don't care about potentially missing any extra hosts, then it would be sensible to exit after N responses have been received and avoid the pointless retries.
I'll see if it's possible to add this, as it's a valid feature that could also be useful for other use cases. And even if it isn't, it won't bother anyone who doesn't want this functionality.
from arp-scan.
I was going to say that returning nonzero should indicate an error, but then I realised that diff does exactly this. So I've pasted your expression in and it seems to work as intended. Commit 29d8b91
I think the behaviour should work for your use case, and it won't affect anyone that doesn't use this option anyway.
from arp-scan.
I don't fully understand the suggestion.
You use the example of scanning 192.168.8.0/24 and stopping if a response is received from 192.168.1.10. But this is unlikely to occur as host address 192.168.1.10 isn't within network 192.168.8.0/24.
Are you suggesting that there should be an option to stop after N responses are received from any hosts within the scanned network? Could you expand on the use case where this is useful?
from arp-scan.
Thanks for the response.
I don't fully understand the suggestion.
Well I might be suggesting something not practically very useful. So you may ignore the suggestion :)
You use the example of scanning 192.168.8.0/24 and stopping if a response is received from 192.168.1.10. But this is unlikely to occur as host address 192.168.1.10 isn't within network 192.168.8.0/24.
Sorry for typo. I meant 192.168.8.10
.
Are you suggesting that there should be an option to stop after N responses are received from any hosts within the scanned network?
No. I'm suggesting that there should be an option to stop after any responses are received from N hosts within the scanned network.
Could you expand on the use case where this is useful?
For instance there are 5 hosts (with random DHCP assigned IPs) on a /24
network. And I want to periodically check if those are up. So if the 5 hosts respond within 500ms, arp-scan
should stop scanning and should not wait for timeout (e.g. 5 seconds) from the rest of 249 hosts. If timeout is reached but less than 5 hosts respond, an error should be returned.
Actually I have been using nmap
, nping
, fping
etc. until recently I found arp-scan
. And the good thing is it's quick. The only delaying factor is the unnecessary timeout when you are concerned with only a fixed number of hosts. What I'm asking for is partially offered by fping --reachable=N
, but that too doesn't stop scanning when --reachable=N
becomes true.
from arp-scan.
This would be a very useful feature.
from arp-scan.
Thank you for the reminder.
I've added a --limit option (short option -M) in commit 284eea5 which I think implements the feature you're looking for.
The documentation hasn't been updated, and I need to consider how duplicates should be handled, so I'm keeping this request open.
from arp-scan.
I've changed the handling of duplicate response packets in commit 686133f so now the number of responders reflects the number of hosts that responded not the number of packets that were received. This change makes the --limit option work correctly when duplicate responses are received.
from arp-scan.
Thank you.
How about return (host_limit == 0 || responders >= host_limit) ? 0 : 1;
from main()
?
from arp-scan.
Related Issues (20)
- Finding mac-vendor.txt HOT 6
- how do I set a custom subnet mask? HOT 2
- spec file contribution HOT 10
- get-oui from Fedora package arp-scan-1.9.7-7.fc37 fails with unhelpful message due to unmet dependency HOT 1
- Show MAC in arp-fingerprint HOT 6
- arp-scan does not look in /usr/share/arp-scan if trying to open ieee-oui.txt failes with EACCESS HOT 15
- Binary packaging status for version 1.10.0 HOT 2
- Potential memory leak in arp-scan/arp-scan.c HOT 2
- Command Line Argument for turning off Promiscuous Mode HOT 7
- Feature Request: Output options: Add sorting HOT 6
- "Target list from interface network X netmask Y" is displayed with --plain option HOT 1
- Parallel arp-scan missing devices HOT 2
- Will this reposity be moved to cmake? HOT 2
- how to update `ieee-oui.txt` on macOS? HOT 3
- Add windows support
- Find portable function to get interface MAC address
- Add support for Cisco ISL VLANs in addition to 802.1Q HOT 1
- Retaining IP address in the output when using `--resolve` HOT 2
- --format option passes NULL args to printf() if specified field is not present HOT 1
- arp-scan --quiet output format regression
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arp-scan.