forked from p34709852/monkey
GC-5050: skip timeouts fix and shorter timeout
This commit is contained in:
parent
6fe21a83e1
commit
0cd5d5aea3
|
@ -103,8 +103,9 @@ class ChaosMonkey(object):
|
||||||
|
|
||||||
machines = self._network.get_victim_machines(WormConfiguration.scanner_class,
|
machines = self._network.get_victim_machines(WormConfiguration.scanner_class,
|
||||||
max_find=WormConfiguration.victims_max_find)
|
max_find=WormConfiguration.victims_max_find)
|
||||||
|
is_empty = True
|
||||||
for machine in machines:
|
for machine in machines:
|
||||||
|
is_empty = False
|
||||||
for finger in self._fingerprint:
|
for finger in self._fingerprint:
|
||||||
LOG.info("Trying to get OS fingerprint from %r with module %s",
|
LOG.info("Trying to get OS fingerprint from %r with module %s",
|
||||||
machine, finger.__class__.__name__)
|
machine, finger.__class__.__name__)
|
||||||
|
@ -169,7 +170,7 @@ class ChaosMonkey(object):
|
||||||
else:
|
else:
|
||||||
self._fail_exploitation_machines.add(machine)
|
self._fail_exploitation_machines.add(machine)
|
||||||
|
|
||||||
if machines:
|
if not is_empty:
|
||||||
time.sleep(WormConfiguration.timeout_between_iterations)
|
time.sleep(WormConfiguration.timeout_between_iterations)
|
||||||
|
|
||||||
if self._keep_running and WormConfiguration.alive:
|
if self._keep_running and WormConfiguration.alive:
|
||||||
|
|
|
@ -17,7 +17,7 @@ MCAST_GROUP = '224.1.1.1'
|
||||||
MCAST_PORT = 5007
|
MCAST_PORT = 5007
|
||||||
BUFFER_READ = 1024
|
BUFFER_READ = 1024
|
||||||
DEFAULT_TIMEOUT = 10
|
DEFAULT_TIMEOUT = 10
|
||||||
QUIT_TIMEOUT = 1200 # 20 minutes
|
QUIT_TIMEOUT = 60 * 10 # 10 minutes
|
||||||
|
|
||||||
|
|
||||||
def _set_multicast_socket(timeout=DEFAULT_TIMEOUT):
|
def _set_multicast_socket(timeout=DEFAULT_TIMEOUT):
|
||||||
|
|
Loading…
Reference in New Issue