remove case for open smb file packet field
parent
960c733f16
commit
f2cf4fd1dc
4
Gemfile
4
Gemfile
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -91,12 +84,9 @@ class OpenFile
|
|||
# Keep writing data until we run out
|
||||
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
|
||||
|
||||
|
||||
cl = ok
|
||||
|
||||
# Partial write, push the failed data back into the queue
|
||||
if (cl != chunk.length)
|
||||
|
|
Loading…
Reference in New Issue