Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #If u like this
- #share it via facebook and twitter
- import httplib
- from socket import *
- print "\t################################################################"
- print "\t# www.teamopenfire.com #"
- print "\t# ############### ######## ############ #"
- print "\t# # # ## ## # # #"
- print "\t# ###### ###### ## ## # ######## #"
- print "\t# # # ## ## # # #"
- print "\t# # # ## ## # ##### #"
- print "\t# # # ## ## # ##### #"
- print "\t# # # ## ## # # #"
- print "\t# # # ## ## # # #"
- print "\t# ##### [#] ######## [#] ##### Port Scanner #"
- print "\t# #"
- print "\t# coded by Ajith KP #"
- print "\t# Greets to Coded32 and T.O.F members #"
- print "\t################################################################"
- try:
- site = raw_input("WebSite/IP: ")
- site = site.replace("http://","")
- print ("\t\nChecking website " + site + "...")
- conn = httplib.HTTPConnection(site)
- conn.connect()
- print "\t\n[OK] Server is Online.\n"
- except (httplib.HTTPResponse, socket.error) as Exit:
- print("\t [X] Oops Error occured")
- raw_input("\t [X] Possible problems: Server offline, Invalid URL,Internet offline\n")
- exit()
- ip = gethostbyname(site)
- print 'Scanning ', site, ip,'...\n\n'
- try:
- for port in range(20,2000): #change the port range here
- scan = socket(AF_INET, SOCK_STREAM)
- connect = scan.connect_ex((ip, port))
- if (connect == 0) :
- print "\tPort",port,": Open"
- else : #if you don't want scan closed ports erase from else: to....
- print "port",port,": Close" #.....print "Port,port,":Open" ...here
- scan.close()
- except (KeyboardInterrupt, SystemExit):
- print "\n\t[X] Session cancelled"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement