remove some extra complication

master
Brent Cook 2019-02-28 15:03:04 -06:00
parent 31bf6a11ad
commit b22c49679b
1 changed files with 4 additions and 7 deletions

View File

@ -28,8 +28,7 @@ class MetasploitModule < Msf::Auxiliary
[ [
OptString.new('CMD', [ true, "The windows command to run", "ipconfig /all" ]), OptString.new('CMD', [ true, "The windows command to run", "ipconfig /all" ]),
OptString.new('USERNAME', [ true, "The username to authenticate as"]), OptString.new('USERNAME', [ true, "The username to authenticate as"]),
OptString.new('PASSWORD', [ true, "The password to authenticate with"]), OptString.new('PASSWORD', [ true, "The password to authenticate with"])
OptBool.new('SAVE_OUTPUT', [true, "Store output as loot", true])
]) ])
end end
@ -38,11 +37,9 @@ class MetasploitModule < Msf::Auxiliary
streams = winrm_run_cmd(datastore['CMD']) streams = winrm_run_cmd(datastore['CMD'])
return unless streams.class == Hash return unless streams.class == Hash
print_error streams['stderr'] unless streams['stderr'] == '' print_error streams['stderr'] unless streams['stderr'] == ''
print_good "#{peer}=> #{streams['stdout']}" 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")
path = store_loot("winrm.cmd_results", "text/plain", ip, streams['stdout'], "winrm_cmd_results.txt", "WinRM CMD Results") print_good "Results saved to #{path}"
print_good "Results saved to #{path}"
end
end end