Catch file not found
parent
c78a6b36b6
commit
9ee13afe6a
|
@ -16,6 +16,7 @@ module Exploit::Remote::SMB::Psexec
|
||||||
include Msf::Exploit::Remote::SMB::Authenticated
|
include Msf::Exploit::Remote::SMB::Authenticated
|
||||||
|
|
||||||
ERROR_SUCCESS = 0x0
|
ERROR_SUCCESS = 0x0
|
||||||
|
ERROR_FILE_NOT_FOUND = 0x2
|
||||||
ERROR_SERVICE_EXISTS = 0x431
|
ERROR_SERVICE_EXISTS = 0x431
|
||||||
NULL_HANDLE = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
NULL_HANDLE = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||||
|
|
||||||
|
@ -212,8 +213,11 @@ module Exploit::Remote::SMB::Psexec
|
||||||
vprint_status("#{peer} - Starting the service...")
|
vprint_status("#{peer} - Starting the service...")
|
||||||
begin
|
begin
|
||||||
svc_status = start_service(svc_handle)
|
svc_status = start_service(svc_handle)
|
||||||
if svc_status == ERROR_SUCCESS
|
case svc_status
|
||||||
|
when ERROR_SUCCESS
|
||||||
print_good("#{peer} - Service started successfully...")
|
print_good("#{peer} - Service started successfully...")
|
||||||
|
when ERROR_FILE_NOT_FOUND
|
||||||
|
print_error("#{peer} - Service failed to start - FILE_NOT_FOUND")
|
||||||
else
|
else
|
||||||
print_error("#{peer} - Service failed to start, ERROR_CODE: #{svc_status}")
|
print_error("#{peer} - Service failed to start, ERROR_CODE: #{svc_status}")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue