From b22c49679baaf8a5e5290fb2600c3287fc3b1fb4 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 28 Feb 2019 15:03:04 -0600 Subject: [PATCH] remove some extra complication --- modules/auxiliary/scanner/winrm/winrm_cmd.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/auxiliary/scanner/winrm/winrm_cmd.rb b/modules/auxiliary/scanner/winrm/winrm_cmd.rb index 71a87bc2d2..60f4f95858 100644 --- a/modules/auxiliary/scanner/winrm/winrm_cmd.rb +++ b/modules/auxiliary/scanner/winrm/winrm_cmd.rb @@ -28,8 +28,7 @@ class MetasploitModule < Msf::Auxiliary [ OptString.new('CMD', [ true, "The windows command to run", "ipconfig /all" ]), OptString.new('USERNAME', [ true, "The username to authenticate as"]), - OptString.new('PASSWORD', [ true, "The password to authenticate with"]), - OptBool.new('SAVE_OUTPUT', [true, "Store output as loot", true]) + OptString.new('PASSWORD', [ true, "The password to authenticate with"]) ]) end @@ -38,11 +37,9 @@ class MetasploitModule < Msf::Auxiliary streams = winrm_run_cmd(datastore['CMD']) return unless streams.class == Hash print_error streams['stderr'] unless streams['stderr'] == '' - print_good "#{peer}=> #{streams['stdout']}" - if datastore['SAVE_OUTPUT'] - path = store_loot("winrm.cmd_results", "text/plain", ip, streams['stdout'], "winrm_cmd_results.txt", "WinRM CMD Results") - print_good "Results saved to #{path}" - end + print_good "#{peer}: #{streams['stdout']}" + path = store_loot("winrm.cmd_results", "text/plain", ip, streams['stdout'], "winrm_cmd_results.txt", "WinRM CMD Results") + print_good "Results saved to #{path}" end