Skip to content

Commit 681f9f3

Browse files
committed
updated check if powershell is available
1 parent 096469a commit 681f9f3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/exploits/windows/local/wmi_persistence.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ def initialize(info = {})
6464

6565

6666
def exploit
67-
raise "Powershell not available" if ! have_powershell?
67+
unless have_powershell?
68+
print_error("This module requires powershell to run")
69+
return
70+
end
6871

6972
unless is_admin?
7073
print_error("This module requires admin privs to run")
@@ -179,4 +182,4 @@ def cleanup
179182
file_local_write(clean_rc, clean_up_rc)
180183
print_status("Clean up Meterpreter RC file: #{clean_rc}")
181184
end
182-
end
185+
end

0 commit comments

Comments
 (0)