Advertisement
Guest User

Untitled

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