remove case for open smb file packet field

GSoC/Meterpreter_Web_Console
dmohanty-r7 2018-02-28 15:44:07 -06:00 committed by Brent Cook
parent 960c733f16
commit f2cf4fd1dc
3 changed files with 5 additions and 21 deletions

View File

@ -16,7 +16,6 @@ group :development do
gem 'yard'
# for development and testing purposes
gem 'pry'
gem 'pry-byebug'
# module documentation
gem 'octokit'
# Metasploit::Aggregator external session proxy
@ -41,6 +40,3 @@ group :test do
# Manipulate Time.now in specs
gem 'timecop'
end
gem 'ruby_smb', git: 'https://github.com/rapid7/ruby_smb', branch: 'master'

View File

@ -70,7 +70,7 @@ attr_accessor :socket, :client, :direct, :shares, :last_share
self.client.send_ntlm = send_ntlm
ok = self.client.negotiate
self.server_max_buffer_size = ok['Payload'].v['MaxBuff']
self.server_max_buffer_size = self.client.server_max_buffer_size
# Disable NTLMv2 Session for Windows 2000 (breaks authentication on some systems)
# XXX: This in turn breaks SMB auth for Windows 2000 configured to enforce NTLMv2
@ -191,8 +191,6 @@ attr_accessor :socket, :client, :direct, :shares, :last_share
ok.guid.to_binary_s
elsif ok.respond_to? :fid
ok.fid.to_binary_s
else
ok['Payload'].v['FileID']
end
fh = OpenPipe.new(self.client, path, self.client.last_tree_id, file_id)
end

View File

@ -61,14 +61,7 @@ class OpenFile
return data
else
ok = self.client.read(self.file_id, offset, length)
data = if ok.is_a? Array
ok.pack('C*')
else
ok.to_s.slice(
ok['Payload'].v['DataOffset'] + 4,
ok['Payload'].v['DataLenLow']
)
end
data = ok.pack('C*')
return data
end
end
@ -92,11 +85,8 @@ class OpenFile
while (chunk.length > 0)
ok = self.client.write(self.file_id, fptr, chunk)
if ok.is_a? BinData::Uint32le
cl = ok
else
cl = ok['Payload'].v['CountLow']
end
# Partial write, push the failed data back into the queue
if (cl != chunk.length)