forked from p15670423/monkey
Merge pull request #370 from VakarisZ/tunneling_bugfix
Tunneling bugfix
This commit is contained in:
commit
31a20254fa
|
@ -178,8 +178,11 @@ class InfectionMonkey(object):
|
||||||
if monkey_tunnel:
|
if monkey_tunnel:
|
||||||
monkey_tunnel.set_tunnel_for_host(machine)
|
monkey_tunnel.set_tunnel_for_host(machine)
|
||||||
if self._default_server:
|
if self._default_server:
|
||||||
|
if self._network.on_island(self._default_server):
|
||||||
machine.set_default_server(get_interface_to_target(machine.ip_addr) +
|
machine.set_default_server(get_interface_to_target(machine.ip_addr) +
|
||||||
(':'+self._default_server_port if self._default_server_port else ''))
|
(':'+self._default_server_port if self._default_server_port else ''))
|
||||||
|
else:
|
||||||
|
machine.set_default_server(self._default_server)
|
||||||
LOG.debug("Default server: %s set to machine: %r" % (self._default_server, machine))
|
LOG.debug("Default server: %s set to machine: %r" % (self._default_server, machine))
|
||||||
|
|
||||||
# Order exploits according to their type
|
# Order exploits according to their type
|
||||||
|
|
|
@ -118,3 +118,6 @@ class NetworkScanner(object):
|
||||||
if NetworkRange.get_range_obj(subnet_str).is_in_range(ip_address):
|
if NetworkRange.get_range_obj(subnet_str).is_in_range(ip_address):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def on_island(self, server):
|
||||||
|
return bool([x for x in self._ip_addresses if x in server])
|
||||||
|
|
Loading…
Reference in New Issue