Catch file not found

bug/bundler_fix
Meatballs 2014-03-19 14:08:52 +00:00
parent c78a6b36b6
commit 9ee13afe6a
No known key found for this signature in database
GPG Key ID: 5380EAF01F2F8B38
1 changed files with 5 additions and 1 deletions

View File

@ -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