mirror of https://github.com/n1nj4sec/pupy.git
Rework scanner to scan by constant sized chunks
This commit is contained in:
parent
04937b3b74
commit
a8ea7a4824
|
@ -11,12 +11,12 @@ import logging
|
||||||
def create_socket(host, port):
|
def create_socket(host, port):
|
||||||
sock = socket.socket()
|
sock = socket.socket()
|
||||||
sock.setblocking(0)
|
sock.setblocking(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print 'Try: {}:{}'.format(host, int(port))
|
|
||||||
r = sock.connect_ex((host, int(port)))
|
r = sock.connect_ex((host, int(port)))
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "Exception: {}/{}".format(e, type(e))
|
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
return sock, r
|
return sock, r
|
||||||
|
|
||||||
def scan(hosts, ports, abort=None, timeout=10, portion=32, on_complete=None, on_open_port=None):
|
def scan(hosts, ports, abort=None, timeout=10, portion=32, on_complete=None, on_open_port=None):
|
||||||
|
|
Loading…
Reference in New Issue