Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Do a quick nmap ping sweep and create list of hosts, change ip range here:
- echo -e "Generating list of live hosts, this could take a min..."
- nmap -sn 10.11.1.1-254 -oG - | awk '/Up$/{print $2}' > hosts.txt
- #Attempt a reverse lookup for each host:
- while read host; do
- #sleep 10echo -n "$host "
- dig -x $host @10.11.1.220 | grep ";; ANSWER" -A1 | tail -n1 | awk 'NF>1{print $NF}'
- done <hosts.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement