I would like to know if there is a way to use "pipe viewer" with "Nmap" together.
Example:
pv | Nmap -sP 192.168.1.0/24
But I couldn't get the progress bar working properly. I mean it should be telling me the percentage of Nmap. Starts from 0%, when Namp is done, it will be 100%.
Pipe viewer is for reporting percentage completion of files, pipes, and other file-like things. Nmap's completion times depend on network latencies, bandwidth, responsiveness of targets, and the features used to scan.
You can get a periodic status update with the
--stats-every
flag, like so:nmap --stats-every 10s
, which gives an update every 10 seconds. You can get more verbose output from Nmap with the-v
flag.I doubt you could do a progress bar for NMap, as it scans for IPs and stuff, and that depends on network speeds, etc.
But you could do a simple bash script to send a notification when it has finished instead:
Save it to a file called
~/.nmap
or something.Make it executable with
chmod +x ~/.nmap
.Execute it with the options you normally give for
nmap
, but with~/.nmap
instead - for example:then it will do a notification to say it has finished:
I find this is useful after a network reset, and I need to find the new IP of the network printer in a hurry. This is probably not the answer you are looking for, but I though it may be of help and of interest.