Python Hacking Tools

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:

相信未来 - 该面对的绝不逃避,该执著的永不怨悔,该舍弃的不再留念,该珍惜的好好把握。
原文地址:https://www.cnblogs.com/keepmoving1113/p/11330072.html