Advertisement
Guest User

Nmap IP Bash

a guest
Dec 7th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. input=$1
  3. output=$2
  4. nmap_result=$3
  5.  
  6. echo "[*] Script started"
  7.  
  8. cat "$input" | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" > "$output"
  9.  
  10. # Add /24 cidr to end of each IP
  11. sed -e 's,$,/24,' -i "$output"
  12. cat "$output"
  13. sudo nmap -sV -A -Pn -v -oN "$nmap_result" -iL "$output"
  14. echo "[*] Done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement