Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced winrm_cmd module #11445

Merged
merged 2 commits into from Feb 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/auxiliary/scanner/winrm/winrm_cmd.rb
Expand Up @@ -29,7 +29,7 @@ def initialize
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", false])
OptBool.new('SAVE_OUTPUT', [true, "Store output as loot", true])
])
end

Expand All @@ -38,7 +38,7 @@ def run_host(ip)
streams = winrm_run_cmd(datastore['CMD'])
return unless streams.class == Hash
print_error streams['stderr'] unless streams['stderr'] == ''
print_good streams['stdout']
print_good "#{peer}=> #{streams['stdout']}"
Yashvendra marked this conversation as resolved.
Show resolved Hide resolved
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}"
Expand All @@ -48,3 +48,4 @@ def run_host(ip)


end