Created
September 4, 2019 10:40
-
-
Save alvaro893/93c914259f785b9135ab9bea116d3384 to your computer and use it in GitHub Desktop.
Scan network to get all IP addresses with their hostname in a ordered manner
This file contains 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 | |
FILE=hosts.txt | |
sudo nmap -sP -PR 192.168.137.1/24 -oN $FILE | |
sed -i '/Host is/d' $FILE | |
sed -i '/MAC/d' $FILE | |
sed -i 's/Nmap scan report for//g' $FILE | |
sort $FILE -o $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment