Assignment 2.1 - Robertsegee/SEC335 GitHub Wiki

In this assignment we used various techniques to scan hosts on a given ip range.

The first method we used was a standard ping command which was run by ping 10.0.5.2 -c 1. The next step was to output the hosts that were up using the ping command then outputting the results to a text file by running
for ip in $seq(2-50) ; do (ping -c 1 10.0.5.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &) >> sweep.txt
The issue I was having with this was using only outputting the hosts that were up to the text file. This was done by using the grep command to detect which ones had 64 bytes detected. With help from a classmate I was able to complete this command with ease.
The next step was to use fping in order to achieve the same thing> I had trouble with a couple things with fping, one being that the way it scans ranges is by putting in both ips which you want to scan between, also I had trouble with the flags but with assistance form others I was able to get it and run the command
fping -g -a -q -s 10.0.5.2 10.0.5.50 >sweep.txt
The final step was to use nmap to achieve effectively the same thing. Something interesting I found is that you need to run nmap as a sudo user or else you may not get the results that you are looking for. So the command I ran was
sudo nmap -sn 10.0.5.2-50 > sweep.txt
The main things I had trouble with in this assignment was using flags with the commands I was running, even now I still did not fully get the nmap command. For the future I need to review these things as well as touch up on my bash because I am a little rusty.