remove some extra complication
parent
31bf6a11ad
commit
b22c49679b
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue