Port Scanner Code
And here it is
#!/python24
import socket
host = raw_input(“What is the IP? “)
port0 = raw_input(“What is the starting port? “)
port1 = raw_input(“What is the finishing port? “)
output = raw_input(“What shall the log output file be called? “)
port = port0
print “Scanning ports…”
z = open(output + “.log”, “a”)
z.write(“Scan result: “)
z.close()
while int(port) <= int(port1):
try:
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((host, int(port)))
z = open(output + “.log”, “a”)
z.write(str(port) + ” is open. \n”)
z.close()
s.close()
print port
port = int(port) + 1
except socket.error:
z = open(output + “.log”, “a”)
z.write(“Port: ” + str(port) + ” is closed. “)
z.close()
s.close()
print port
port = int(port) + 1
.:|phr34k|:. ph34r_m3 said,
May 16, 2008 at 11:55 pm
Hey man… just showing some respect to you, i encourage you to get into perl… also, please check out the .:|phr34k|:. website, get active on our forums… you seem like you have what it takes to make an application, well yeah… peace.