def portScanner(url,dosyaAdi):
raporIcerik=""
baslangic=int(raw_input("Start port: "))
bitis=int(raw_input("Finish port: "))
for port in range(baslangic, bitis, 1):
try:
i=str(port)
baglanti = telnetlib.Telnet(url, i)
baglanti.write("\n")
print "[+]", str(port), " - ", baglanti.read_all().splitlines()[0]
raporIcerik+="[+]", str(port), " - ", baglanti.read_all().splitlines()[0]+"\n"
baglanti.close()
except:
pass
rapor = open(dosyaAdi, "a")
rapor.write(raporIcerik)
rapor.close()
评论列表
文章目录