# Y.A.W.N - Yet Another Windows Netstat # Coded by Luigi I. in August 2k3 (w/bare hands & IDLE for Windows) # Released under GNU GPL License. # This scripts puts in a small GUI the results of a normal netstat. # Works on any Windows System that has the python interpreter, soon i'll make a stand alone binary. # There's a GNU/Linux version, too! import os,string,webbrowser from Tkinter import * from time import sleep def creanetstat(): os.system("netstat > sux.txt") global f f = open("sux.txt",'r') def legginetstat(): global conn conn = 1 f.seek(0) if len(f.readlines()) < 5: f.seek(0) Label(app,text="No Established Connection").grid() else: f.seek(0) for linea in f.readlines()[4:]: getdata(string.strip(linea)) conn = conn + 1 def labelconnessione(host,porta,status,conn): conntext = " HOST: %s PORT: %s : STATUS: %s " % (host,porta,status) tracetext = "Trace" pingtext = "Ping" whoistext = "Whois" Label(app,text=conntext).grid(row=conn,column=0) Button(app,text=tracetext,command=lambda: tracehost(host)).grid(row=conn,column=1) Button(app,text=pingtext,command=lambda: ping(host)).grid(row=conn,column=2) Button(app,text=whoistext,command=lambda: whois(host)).grid(row=conn,column=3) def tracehost(host): tracecmd = "tracert -h 5 %s > tracert.txt" % (host) os.system(tracecmd) sleep(5) os.system("start tracert.txt") def ping(host): pingcmd = "ping %s > ping.txt" % (host) os.system(pingcmd) sleep(5) os.system("start ping.txt") def whois(host): webbrowser.open('http://www.ripe.net/perl/whois?form_type=simple&full_query_string=&searchtext=' + host + '&do_search=Search') def getdata(linea): global host,port,status host = linea.split()[2][:string.find(linea.split()[2],":")] port = linea.split()[2][string.find(linea.split()[2],":")+1:] status = linea.split()[3] labelconnessione(host,port,status,conn) app = Tk() app.title("YAWN") Label(app,text="Yet Another Win Netstat").grid(row=0,column=0) creanetstat() legginetstat() app.mainloop()