Skip to content

Commit 8711484

Browse files
David Maloneysinn3r
authored andcommitted
minor fixups
1 parent 09195ad commit 8711484

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/auxiliary/scanner/winrm/winrm_wql.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def initialize
2727
'Name' => 'WinRM WQL Query Runner',
2828
'Version' => '$Revision$',
2929
'Description' => %q{
30-
This module runs WQL queries against remote WinRM Services.
30+
This module runs WQL queries against remote WinRM Services.
3131
Authentication is required. Currently only works with NTLM auth.
3232
},
3333
'Author' => [ 'thelightcosine' ],
@@ -48,8 +48,12 @@ def run_host(ip)
4848
print_error "The Remote WinRM server (#{ip} does not appear to allow Negotiate(NTLM) auth"
4949
return
5050
end
51-
51+
5252
resp,c = send_request_ntlm(winrm_wql_msg(datastore['WQL']))
53+
if resp.nil?
54+
print_error "Got no reply from the server"
55+
return
56+
end
5357
if resp.code == 401
5458
print_error "Login Failure! Recheck the supplied credentials."
5559
return
@@ -61,7 +65,8 @@ def run_host(ip)
6165
end
6266
resp_tbl = parse_wql_response(resp)
6367
print_good resp_tbl.to_s
64-
store_loot("winrm.wql_results", "text/csv", ip, resp_tbl.to_csv, "winrm_wql_results.csv", "WinRM WQL Query Results")
68+
path = store_loot("winrm.wql_results", "text/csv", ip, resp_tbl.to_csv, "winrm_wql_results.csv", "WinRM WQL Query Results")
69+
print_status "Results saved to #{path}"
6570
end
6671

6772

0 commit comments

Comments
 (0)