forked from p34709852/monkey
Added parameter logging on monkey start, fixed bug where dropper launched monkey inproperly
This commit is contained in:
parent
30be271598
commit
436472b578
|
@ -116,11 +116,12 @@ class MonkeyDrops(object):
|
||||||
LOG.warning("Cannot set reference date to destination file")
|
LOG.warning("Cannot set reference date to destination file")
|
||||||
|
|
||||||
monkey_options = \
|
monkey_options = \
|
||||||
build_monkey_commandline_explicitly(self.opts.parent,
|
build_monkey_commandline_explicitly(parent=self.opts.parent,
|
||||||
self.opts.tunnel,
|
tunnel=self.opts.tunnel,
|
||||||
self.opts.server,
|
server=self.opts.server,
|
||||||
self.opts.depth,
|
depth=self.opts.depth,
|
||||||
self.opts.vulnerable_port)
|
location=None,
|
||||||
|
vulnerable_port=self.opts.vulnerable_port)
|
||||||
|
|
||||||
if OperatingSystem.Windows == SystemInfoCollector.get_os():
|
if OperatingSystem.Windows == SystemInfoCollector.get_os():
|
||||||
monkey_cmdline = MONKEY_CMDLINE_WINDOWS % {'monkey_path': self._config['destination_path']} + monkey_options
|
monkey_cmdline = MONKEY_CMDLINE_WINDOWS % {'monkey_path': self._config['destination_path']} + monkey_options
|
||||||
|
|
|
@ -74,6 +74,7 @@ class InfectionMonkey(object):
|
||||||
arg_parser.add_argument('-d', '--depth', type=int)
|
arg_parser.add_argument('-d', '--depth', type=int)
|
||||||
arg_parser.add_argument('-vp', '--vulnerable-port')
|
arg_parser.add_argument('-vp', '--vulnerable-port')
|
||||||
self._opts, self._args = arg_parser.parse_known_args(self._args)
|
self._opts, self._args = arg_parser.parse_known_args(self._args)
|
||||||
|
self.log_arguments()
|
||||||
|
|
||||||
self._parent = self._opts.parent
|
self._parent = self._opts.parent
|
||||||
self._default_tunnel = self._opts.tunnel
|
self._default_tunnel = self._opts.tunnel
|
||||||
|
@ -387,3 +388,7 @@ class InfectionMonkey(object):
|
||||||
def is_started_on_island(self):
|
def is_started_on_island(self):
|
||||||
island_ip = remove_port_from_ip_string(self._default_server)
|
island_ip = remove_port_from_ip_string(self._default_server)
|
||||||
return is_running_on_server(island_ip) and WormConfiguration.depth == WormConfiguration.max_depth
|
return is_running_on_server(island_ip) and WormConfiguration.depth == WormConfiguration.max_depth
|
||||||
|
|
||||||
|
def log_arguments(self):
|
||||||
|
arg_string = " ".join([f"{key}: {value}" for key, value in vars(self._opts).items()])
|
||||||
|
LOG.info(f"Monkey started with arguments: {arg_string}")
|
||||||
|
|
Loading…
Reference in New Issue