Response code, Write fix

GSoC/Meterpreter_Web_Console
Jacob Robles 2018-04-12 14:05:01 -05:00 committed by Brent Cook
parent 7fa001ba50
commit d54992674f
3 changed files with 15 additions and 12 deletions

View File

@ -267,7 +267,7 @@ module Exploit::Remote::SMB::Client::Psexec
begin
psexec(command)
rescue StandardError => exec_command_error
fail_with(Msf::Exploit::Failure::Unknown, "#{peer} - Unable to execute specified command: #{exec_command_error}")
fail_with(Failure::Unknown, "#{peer} - Unable to execute specified command: #{exec_command_error}")
end
end

View File

@ -119,17 +119,17 @@ class Client
NDR.long(default_opts[:password4])
begin
response = dcerpc_client.call(CREATE_SERVICE_W, stubdata)
if response
svc_status = error_code(response[24,4])
if svc_status == ERROR_SUCCESS
svc_handle = response[4,20]
end
end
rescue Rex::Proto::DCERPC::Exceptions::Fault => e
print_error("Error creating service: #{e}")
end
if response
svc_status = error_code(response[24,4])
if svc_status == ERROR_SUCCESS
svc_handle = response[4,20]
end
end
return svc_handle, svc_status
end
@ -169,7 +169,7 @@ class Client
begin
response = dcerpc_client.call(CLOSE_SERVICE_HANDLE, handle)
if response
svc_status = error_code(response[20,4])
svc_status = error_code(response)
end
rescue Rex::Proto::DCERPC::Exceptions::Fault => e
print_error("Error closing service handle: #{e}")

View File

@ -84,13 +84,16 @@ class OpenFile
# Keep writing data until we run out
while (chunk.length > 0)
ok = self.client.write(self.file_id, fptr, chunk)
cl = ok
# Partial write, push the failed data back into the queue
if (cl != chunk.length)
data = chunk.slice(cl - 1, chunk.length - cl) + data
begin
data = chunk.slice(cl - 1, chunk.length - cl) + data
rescue
self.write(data, offset)
return
end
end
# Increment our painter and grab the next chunk