Skip to content

Commit 8db4ba4

Browse files
committed
Fix winrm's ps_execute() to return output
1 parent 29a4379 commit 8db4ba4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

nxc/protocols/winrm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ def execute(self, payload=None, get_output=False, shell_type="cmd"):
266266

267267
def ps_execute(self, payload=None, get_output=False):
268268
command = payload if payload else self.args.ps_execute
269-
self.execute(payload=command, get_output=get_output, shell_type="powershell")
269+
result = self.execute(payload=command, get_output=get_output, shell_type="powershell")
270+
if get_output:
271+
return result
270272

271273
# Dos attack prevent:
272274
# if someboby executed "reg save HKLM\sam C:\windows\temp\sam" before, but didn't remove "C:\windows\temp\sam" file,

0 commit comments

Comments
 (0)