Method: Rex::Proto::SMB::Client#smb_parse_open

Defined in:
lib/rex/proto/smb/client.rb

#smb_parse_open(pkt, data) ⇒ Object

Process incoming SMB_COM_OPEN_ANDX packets



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/rex/proto/smb/client.rb', line 416

def smb_parse_open(pkt, data)
  # Process open responses
  if (pkt['Payload']['SMB'].v['WordCount'] == 15)
    res = CONST::SMB_OPEN_RES_PKT.make_struct
    res.from_s(data)
    return res
  end

  # Process SMB error responses
  if (pkt['Payload']['SMB'].v['WordCount'] == 0)
    return pkt
  end

  raise XCEPT::InvalidWordCount
end