From 8db4ba446aa9bcbb5601e85e6dd47e192d2ba36b Mon Sep 17 00:00:00 2001 From: Tiago Nunes Date: Tue, 1 Jul 2025 09:00:22 +0200 Subject: [PATCH] Fix winrm's ps_execute() to return output --- nxc/protocols/winrm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nxc/protocols/winrm.py b/nxc/protocols/winrm.py index 52140fbc..aa383abf 100644 --- a/nxc/protocols/winrm.py +++ b/nxc/protocols/winrm.py @@ -266,7 +266,9 @@ class winrm(connection): def ps_execute(self, payload=None, get_output=False): command = payload if payload else self.args.ps_execute - self.execute(payload=command, get_output=get_output, shell_type="powershell") + result = self.execute(payload=command, get_output=get_output, shell_type="powershell") + if get_output: + return result # Dos attack prevent: # if someboby executed "reg save HKLM\sam C:\windows\temp\sam" before, but didn't remove "C:\windows\temp\sam" file,