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.

!/bin/bash

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

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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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