1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00

Fixed spaces before paranethesis issues in dcerpc/packet.rb

Fixed comment in smb/client.rb
Fixed ReadAndX in smb/client.rb
Updated ReadAndX struct in constants.rb


git-svn-id: file:///home/svn/incoming/trunk@3643 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2006-05-15 16:44:44 +00:00
parent 43387ea793
commit 18bb4f9e6d
4 changed files with 9 additions and 7 deletions

View File

@ -76,7 +76,7 @@ module Exploit::Remote::DCERPC
opts['smb_pipeio'] = datastore['DCERPC::smb_pipeio']
end
if self.simple
if self.respond_to?('simple') and self.simple
opts['smb_client'] = self.simple
end

View File

@ -10,7 +10,7 @@ require 'rex/text'
UUID = Rex::Proto::DCERPC::UUID
# Create a standard DCERPC BIND request packet
def self.make_bind (uuid, vers)
def self.make_bind(uuid, vers)
# Process the version strings ("1.0", 1.0, "1", 1)
bind_vers_maj, bind_vers_min = UUID.vers_to_nums(vers)
@ -140,7 +140,7 @@ require 'rex/text'
end
# Create a standard DCERPC ALTER_CONTEXT request packet
def self.make_alter_context (uuid, vers)
def self.make_alter_context(uuid, vers)
u = Rex::Proto::DCERPC::UUID
# Process the version strings ("1.0", 1.0, "1", 1)
@ -174,7 +174,7 @@ require 'rex/text'
# Used to create a piece of a DCERPC REQUEST packet
def self.make_request_chunk (flags=3, opnum=0, data="", ctx=0, object_id = '')
def self.make_request_chunk(flags=3, opnum=0, data="", ctx=0, object_id = '')
dlen = data.length
flen = dlen + 24
@ -206,7 +206,7 @@ require 'rex/text'
end
# Used to create standard DCERPC REQUEST packet(s)
def self.make_request (opnum=0, data="", size=data.length, ctx=0, object_id = '')
def self.make_request(opnum=0, data="", size=data.length, ctx=0, object_id = '')
if size > 4000
size = 4000

View File

@ -355,7 +355,7 @@ EVADE = Rex::Proto::SMB::Evasions
# Process incoming SMB_COM_READ_ANDX packets
def smb_parse_read(pkt, data)
# Process write responses
# Process read responses
if (pkt['Payload']['SMB'].v['WordCount'] == 12)
res = CONST::SMB_READ_RES_PKT.make_struct
res.from_s(data)
@ -969,6 +969,7 @@ EVADE = Rex::Proto::SMB::Evasions
# pkt['Payload'].v['MaxCountHigh'] = (data_length / 65536).to_i
pkt['Payload'].v['MaxCountLow'] = (data_length % 65536).to_i
pkt['Payload'].v['MinCount'] = data_length
pkt['Payload'].v['Reserved2'] = -1
self.smb_send(pkt.to_s)

View File

@ -911,8 +911,9 @@ SMB_READ_HDR_PKT = Rex::Struct2::CStructTemplate.new(
[ 'uint32v', 'Offset', 0 ],
[ 'uint16v', 'MaxCountLow', 0 ],
[ 'uint16v', 'MinCount', 0 ],
[ 'uint32v', 'MaxCountHigh', 0 ],
[ 'uint32v', 'Reserved2', 0 ],
[ 'uint16v', 'Remaining', 0 ],
[ 'uint32v', 'MaxCountHigh', 0 ],
[ 'uint16v', 'ByteCount', 0 ],
[ 'string', 'Payload', nil, '' ]
).create_restraints(