Add small script for reverse dns enumeration of ipv4 subnets

This commit is contained in:
Jan Philipp Timme 2018-09-28 10:54:32 +02:00
parent 6ff18621ba
commit b9cb811c4d
1 changed files with 17 additions and 0 deletions

17
bin/reverse-subnet.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
IP4BLOCK="$1"
echo "Doing reverse lookup for $IP4BLOCK.0/24..."
ctr=1
while [ $ctr -le 255 ]; do
ipaddress="$IP4BLOCK.$ctr";
result=`dig +short -x $ipaddress`;
result=`echo $result | sed -e 's#\n##g'`
if [ "$result" != "" ]; then
echo "$ipaddress $result";
fi;
((ctr++));
done