Assignment 1.2 - zacharylongo/Tech-Journals GitHub Wiki

Commands and Overview

  • The main goals of the assignment were to create simple scripts to ping hosts (and analyze the outputs in WireShark).

Example 1

  • The following script pings the IP range and if a response is received it will pipe the IP address to a text file titled "sweep.txt"
for i in {2..50}; do
    if response=$(ping -c 1 -W 1 10.0.5.$i | grep -oE 'from [0-9.]+' | awk '{print $2}'); then
        echo "$response" >> sweep.txt
    fi
done

Tech journal #1

Example 2

  • The following script does something similar utilizing the fping command. (Whilst also piping to a new document called "sweep2.txt"

image


Reflection:

  • Overall I encountered little to no errors in the completion of this assignment. In the future I should spend more time looking into regular expressions as I have been chronically underexposed to them.