Info BackTrack

Linux & Security Tutorial

Scaning Port Tanpa Nmap Dengan Scanport.py


Ada suatu Script yang bisa memblocking IP kita pada saat melakukan Nmap di suatu web, sebut saja indonesianbacktrack.or.id =)) . Nah kebetulan googling jadi ketemu nih script yang bisa melacak port terbuka tanpa harus melakukan autoping dari si Nmap =)) .


#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"

—done.

Kalo belum mengerti cara mengaplikasikannya ke Linux anda silahkan di komen ya. Semoga dapat berguna buat teman-teman.

Artikel Terkait:

One response to “Scaning Port Tanpa Nmap Dengan Scanport.py

  1. ede February 17, 2013 at 4:12 am

    gimana caranya ini bt aku gx bisa operasi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: