Introduction
In this challenge, you'll be using Nmap to discover active hosts on a network by performing a ping sweep on a list of IP addresses specified in the targets.txt
file. The goal is to identify which hosts are online and save their IP addresses to a new file named online_hosts.txt
, with each IP address on a new line.
This task requires you to leverage Nmap's -iL
option to read target IP addresses from the input file, and then use tools like grep
and awk
to extract the online host IP addresses from the Nmap output. Finally, you'll redirect the extracted IP addresses to the online_hosts.txt
file, ensuring the correct format for verification.