Last active
September 1, 2016 23:42
-
-
Save phmullins/114fb9fb632b00c8790f5100a4b738c6 to your computer and use it in GitHub Desktop.
Discover hosts on a network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This bash script will output the IP addresses of all the live hosts on a network. Note: Hosts that filter ICMP | |
# are not included in this list. | |
# | |
# Usage: ./mapnet IP_RANGE Example: ./mapnet 192.168.1.1/24 | |
clear | |
if [ -z "$1" ]; then | |
exit "Input IP range to scan. Example: 192.168.1.0/24" | |
fi | |
nmap $1 -n -sP | grep report | awk '{print $5}' | |
echo "Mapnet return code: $?" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment