Assignment 2.1: Host Discovery - squatchulator/Tech-Journal GitHub Wiki

Technical

Scripts are also viewable/downloadable here

ping_sweep.sh

for suf in $(seq 2 50);
	do
	ping -W 2 -c 1 10.0.5.$suf | grep '64 bytes from' | cut -d " " -f 4 | tr -d ":"
done > sweep.txt

fping_sweep.sh

for suf in $(seq 2 50);
	do
	fping -a -t 1 10.0.5.$suf
done  > sweep2.txt

nmap_sweep.sh

sudo nmap -n -vv -sn 10.0.5.2-50 -oG - | grep Up | cut -d ' ' -f 2 > sweep3.txt

Reflection

In this activity, I got stuck on creating the script for doing a ping sweep. Mostly this was an issue regarding how best to cut the IPs out from the output of valid pings. To solve this, I used a mix of grep, cut, and tr to separate IPs from the ping output, and append them to a file. I found that this was an issue when writing the NMAP scan script as well, especially considering the output was split between two lines; the line with the IP address I needed to identify, and the line saying that the host resolved OK.