Exception: Msf::PayloadItemSizeError

Inherits:
ArgumentError
  • Object
show all
Includes:
Exception
Defined in:
lib/msf/core/exceptions.rb

Overview

This exception is raised if a payload option string exceeds the maximum allowed size during the payload generation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item = nil, max_size = nil) ⇒ PayloadItemSizeError

Returns a new instance of PayloadItemSizeError.


299
300
301
302
# File 'lib/msf/core/exceptions.rb', line 299

def initialize(item = nil, max_size = nil)
  @item = item
  @max_size = max_size
end

Instance Attribute Details

#itemObject (readonly)

The content of the payload option (for example a URL)


308
309
310
# File 'lib/msf/core/exceptions.rb', line 308

def item
  @item
end

#max_sizeObject (readonly)

The maximum allowed size of the payload option


309
310
311
# File 'lib/msf/core/exceptions.rb', line 309

def max_size
  @max_size
end

Instance Method Details

#to_sObject


304
305
306
# File 'lib/msf/core/exceptions.rb', line 304

def to_s
  "Option value: #{item.slice(0..30)} is too big (Current length: #{item.length}, Maximum length: #{max_size})."
end