File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
modules/exploits/windows/local Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -120,14 +120,14 @@ def build_script
120
120
def exploit
121
121
122
122
# Make sure we meet the requirements before running the script
123
- # Shell sessions can't kill PIDs
124
- if !have_powershell?
125
- print_error ( "Incompatible environment - PowerShell is required" )
126
- return
123
+ unless have_powershell?
124
+ fail_with ( Failure ::BadConfig , 'PowerShell not found' )
127
125
end
126
+
127
+
128
128
# SYSTEM doesnt have credentials on remote hosts
129
129
if is_system? and datastore [ 'RHOSTS' ]
130
- print_error ( "Cannot run as system" )
130
+ print_error ( "Cannot run as local system on remote hosts " )
131
131
return 0
132
132
end
133
133
@@ -137,7 +137,7 @@ def exploit
137
137
print_good script
138
138
return
139
139
end
140
- #
140
+
141
141
print_good ( "#{ datastore [ "RHOSTS" ] ? psh_exec ( script ) : psh_exec ( script , true , false ) } " )
142
142
vprint_good ( 'PSH WMI exec is complete.' )
143
143
end
You can’t perform that action at this time.
0 commit comments