#!/bin/bash
###############################################################################################################################################
#This tool provide network range that is allocated to an organization. The result is stored in output file that gets created in the same folder.
###############################################################################################################################################

echo Please input organization name
read organization
curl -k https://www.ultratools.com/tools/asnInfoResult?domainName=$organization | grep -Eo "(AS)([0-9][0-9][0-9][0-9][0-9])" > result

filename=result
declare -a myarray
myarray=( `cat "$filename"`)

for ((i=0;i< ${#myarray[@]};i++))
do
echo ${myarray[$i]}
whois -h whois.radb.net -- -i origin ${myarray[$i]} | grep -Eo "([0-9.]+){4}/[0-9]+" >> output
done




