Last active
May 17, 2021 23:37
-
-
Save bluesku/7d2a8da8ce17678a4aac45ab8249f1ff to your computer and use it in GitHub Desktop.
Get Info From DNS Servers and Active Hosts
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/sh | |
mkdir /WHOIS-DB | |
mkdir Whois-$(date +'%F') || echo 'Folder Already Exist!' ; | |
cd /WHOIS-DB ; echo "WorkingDir.: $(pwd)" | |
apt install pv whois -y | |
echo -e 'inetnum:\ninetname:\ne-mail:\nnetname:\ndescr:\nrole:\nroute:\nnserver:\ndomain:' > matchfile | |
read -p 'Set Host List.: ' in_path | |
while read host | |
do | |
echo "Host: $host" | |
whois -adB $host > $host-whois-DNSrevadd-$(date +'%F-%R-hrs').txt | |
done < $in_path | |
# Working with data | |
mv -vi *.txt Whois-$(date +'%F') | |
cd Whois-$(date +'%F') ; | |
echo "WorkdingDir.: $(pwd)" ; sleep 3s | pv -t | |
#MAKES A FILTER TO THE WHOLE FILES CREATED | |
grep -H -f "../matchfile" *.txt > ../Datafilted-v$(date +'%R-hrs').xlsx | |
ls /WHOIS-DB/*.xlsx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment