Changeset 5468

Show
Ignore:
Timestamp:
04/04/08 17:12:59 (6 months ago)
Author:
hdm
Message:

Fix an exception that is encountered when not enough of the DCERPC packet has been read

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework3/trunk/lib/rex/proto/dcerpc/client.rb

    r5467 r5468  
    165165                                                # if we have read enough data. Once we have the length value, we need to make sure 
    166166                                                # that we don't read beyond this amount, or it can screw up the SMB state 
    167                                                 begin  
    168                                                         check = Rex::Proto::DCERPC::Response.new(raw_response) 
    169                                                         read_limit = check.frag_len 
    170                                                 rescue ::Rex::Proto::DCERPC::Exceptions::InvalidPacket 
     167                                                if (not read_limit) 
     168                                                        begin  
     169                                                                check = Rex::Proto::DCERPC::Response.new(raw_response) 
     170                                                                read_limit = check.frag_len 
     171                                                        rescue ::Rex::Proto::DCERPC::Exceptions::InvalidPacket 
     172                                                        end 
    171173                                                end 
    172174                                                 
  • framework3/trunk/lib/rex/proto/dcerpc/response.rb

    r5467 r5468  
    7171                        self.sec_addr_len = data.unpack('CCCCNvvVvvVv') 
    7272 
     73 
     74                        if(not self.frag_len or data.length < self.frag_len) 
     75                                raise Rex::Proto::DCERPC::Exceptions::InvalidPacket, 'DCERPC response packet is incomplete' 
     76                        end 
     77                                         
    7378                        # Keep an offset into the packet handy 
    7479                        x = 0