-2

I'm trying to do a network scan however scanning the entire network for any possible host consumes to many resources, then I found that you could use arp to find all ip address on your network.

arp -n > exampleOutput.txt

Now my issues is that the output has some unwanted information and other such things to improve readablity. My hope is to do an nmap scan using my output file so i don't have to scan entire network. Rather I know what IPs exist on the network so just scan those.

adjoth
  • 1
  • 2

1 Answers1

0

Umm ... no, arp -n will not find all ip addresses on your network; it will find any machine that has talked at your machine within a short time frame, typically 60 seconds.

That said (if you're happy with the limitation of the arp cache):

nmap $(arp -n | awk '$1 ~ /[0-9]+/{printf "%s ", $1}')

will do what you asked (not what you want!). What we do here is to just extract IP addresses from arp via awk, and using awks printf to put them on nmaps command line separated by space.

tink
  • 14,342
  • 4
  • 46
  • 50