What is a ping sweep?
A ping sweep (also known as an ICMP sweep) is a basic network scanning technique used to determine which of a range of IP addresses map to live hosts (computers). Whereas a single ping will tell you whether one specified host computer exists on the network.
How does ping sweep work?
A ping sweep consists of ICMP (Internet Control Message Protocol) ECHO requests sent to multiple hosts. If a given address is live, it will return an ICMP ECHO reply.
Scripting
Here, you can found a bash script that runs a for loop for the hosts that found reachable, and on those hosts runs against another for loop and scans the hosts using the Nmap command.
Requirements
If you want run the script over local, you must have the package nmap already installed. If you wan’t install it, you may be should use the Dockerfile. So the entire requeriments should be:
1. Bash Shell or another
2. Docker
3. Git
4. Nmap
Run script locally
git clone https://github.com/danielitogomez/bash.git
cd $PWD/bash/netadmin-tools/NetworkScan
./network-scan-local.sh
Using Docker Alpine image
git clone https://github.com/danielitogomez/bash.git
cd $PWD/bash/netadmin-tools/NetworkScan
docker build .