Ping sweep script

A ping sweep is a network scanning technique used to discover which IP addresses are active and can be reached by a particular device or network.

During a ping sweep, a device sends a series of Internet Control Message Protocol (ICMP) echo requests to a range of IP addresses. If an IP address is active and able to receive messages, it will respond to the echo request with an ICMP echo reply.

By analyzing the responses to the ICMP echo requests, a network administrator can determine which IP addresses are active and which are not. This information can be useful for troubleshooting network issues, identifying potential security threats, or mapping out the network topology.

However, it’s worth noting that some network configurations may block or filter ICMP traffic, which can make a ping sweep less effective or even completely ineffective.

**This is a simple bash script to ping an entire /24 network.


if [ "$1" == " " ]
echo "Input an IP address"
echo "Syntax : ./ <x.x.x>"

for ip in `seq 1 254`; do
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s