Python Port Scanner




#!/usr/bin/python

import socket

def PortScanner():


    gateway=raw_input("Please print router's gateway!")
    print  "Your gateway is "+str(gateway)
    
    for port in range(1,1024):

        try:
            socket.setdefaulttimeout(2)

            s=socket.socket()

            s.connect((gateway,port))
   
            #banner=s.recv(1024)

            print '%d:OPEN' %port
            s.close
           
        except: continue

PortScanner()

Comments

Popular posts from this blog

Basic Pivoting with Cobaltstrike and Metasploit

Hiding Data Using White Space (Steganography)

Unhide a Hidden GPO