import os import subprocess print "Give websites file" ifile="sites" fp=open(ifile,'r') for l in fp: print "Website: "+l comm1="host -t ns "+l[4:-1]+"> 1.txt" os.system(comm1) t1=open("1.txt",'r') for l1 in t1: a=l1.split(" ") print "Website: "+l+" Nameserver: "+a[3][:-1] comm2="host "+ a[3][:-1]+"> 2.txt" #print comm2 os.system(comm2) t2=open("2.txt",'r') for l2 in t2: p=l2[:-1].split(" ") if(len(p)==5): comm3="nmap --script dns-ip6-arpa-scan --script-args=\'prefix="+p[4]+"/48"+"\'" #print comm3 os.system(comm3) #p=subprocess.Popen(comm.split(), stdout=subprocess.PIPE,shell=True) #op,err=p.communicate() #print op #subprocess.call("host -t ns "+line[4:-1]) #print "host -t ns "+line[4:-1]