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
#!/usr/bin/env python
# -*- coding: cp1251 -*-
import socket
HOST = "towap.info" # host
ports = [80, 443] # порты для скана
for i in ports:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((HOST, i))
except:
continue
sock.settimeout(0.5)
result = sock.recv(1024)
print "Getting", i, "port: ", result
sock.close()