Table of Contents


Ping Sweep

Ping sweeping is useful for if we want to quickly try and find out what other ports might be accessable from the target/attack host.
Keep in mind that these ping sweeps use ICMP protocol. If it is blocked (and often that’s the case) then they won’t give as any feedback - so please don’t solely rely on them.

Ping Sweep For Loop on Linux Pivot Hosts

for i in {1..254} ;do (ping -c 1 172.16.5.$i | grep "bytes from" &) ;done

Ping Sweep For Loop Using CMD

for /L %i in (1 1 254) do ping 172.16.5.%i -n 1 -w 100 | find "Reply"

Ping Sweep Using PowerShell

1..254 | % {"172.16.5.$($_): $(Test-Connection -count 1 -comp 172.15.5.$($_) -quiet)"}

Note: It is possible that a ping sweep may not result in successful replies on the first attempt, especially when communicating across networks. This can be caused by the time it takes for a host to build it’s arp cache. In these cases, it is good to attempt our ping sweep at least twice to ensure the arp cache gets built.