From 0dbf44a681040f2bd2f8e1722a42d3b1e43c55c3 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 22 May 2019 08:24:59 +0100 Subject: [PATCH] Default taget_str in send.stdout/send.stderr to target.name --- modules/commands/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py index 912743e3..f007e3c8 100644 --- a/modules/commands/__init__.py +++ b/modules/commands/__init__.py @@ -461,8 +461,9 @@ class Module(ModuleManager.BaseModule): @utils.hook("send.stdout") def send_stdout(self, event): + target = event["target"] stdout = outs.StdOut(event["server"], event["module_name"], - event["target"], event.get("target_str", ""), {}) + target, event.get("target_str", target.name), {}) if event.get("hide_prefix", False): stdout.hide_prefix() @@ -473,8 +474,9 @@ class Module(ModuleManager.BaseModule): event["target"].last_stdout = stdout @utils.hook("send.stderr") def send_stderr(self, event): + target = event["target"] stderr = outs.StdErr(event["server"], event["module_name"], - event["target"], event.get("target_str", ""), {}) + target, event.get("target_str", target.name), {}) if event.get("hide_prefix", False): stderr.hide_prefix()