usr bin env python coding cp1251 import socket HOST towap info host po

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
# -*- coding: cp1251 -*-
import socket
HOST = "towap.info" # host
ports = [21, 22, 23, 25, 38, 43, 80, 109, 110, 115, 118, 119, 143,
194, 220, 443, 540, 585, 591, 1112, 1433, 1443, 3128, 3197,
3306, 4000, 4333, 5100, 5432, 6669, 8000, 8080, 9014, 9200]
for i in ports:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((HOST, i))
sock.settimeout(0.5)
result = sock.recv(1024)
except:
continue
print "Getting", i, "port: ", result
sock.close()