while read arr do nmap -sP arr grep -B5 Host is up grep -E -o 25 0-5 0

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
i=1
while read arr;
do
nmap -sP $arr | grep -B5 "Host is up" |grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" >> tmp.txt
echo "host ping.. release"
nmap -iL tmp.txt -sV -O -T3 -Pn -A -max-rtt-timeout 15 --top-ports 50 -oX "$i".xml
i=&((i+1))
rm tmp.txt
done < /root/scanlogs/prague/inipdata.txt