Python Hacking Tools - Port Scanner

Socket Programming

1.  Scan the target Vulnerable Server. And test it by telnet.

2. Write the scanner source code.

import socket

ip = "10.0.0.32"

for port in range(1,10000):
    try:
        s = socket.socket()
        s.connect((ip,port))
        s.close()
        print "%d/tcp" %(port)
    except:
        pass

3. Execute the code. And the result is as following:

 

posted @ 2019-08-09 23:22  晨风_Eric  阅读(211)  评论(0编辑  收藏  举报