H1 Programming

the art of programming

Port Scanner (Minor Version/Python)

This is unfinished, and is going to be completed with much more features to the request of sOwL.

#! /usr/bin/env python

#H1 Simple Python Port Scanner v1
#Written by Brad Smith

import socket
import sys

portList = "-"

mySocket = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
print "Enter Host IP"
hostIP = raw_input()
print "Start Port?"
portStart = int(raw_input())
print "End Port?"
portEnd = int(raw_input())
print "Scanning ports, please be patient..."

for a in range(portStart, portEnd + 1):
try:
mySocket.connect ( ( hostIP, a ) )
print a, "-open"
except:
print a, "-closed"