Exception: Msf::PayloadItemSizeError

Inherits:
ArgumentError
  • Object
show all
Includes:
Exception
Defined in:
lib/msf/core/exception.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.



311
312
313
314
# File 'lib/msf/core/exception.rb', line 311

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)



320
321
322
# File 'lib/msf/core/exception.rb', line 320

def item
  @item
end

#max_sizeObject (readonly)

The maximum allowed size of the payload option



321
322
323
# File 'lib/msf/core/exception.rb', line 321

def max_size
  @max_size
end

Instance Method Details

#to_sObject



316
317
318
# File 'lib/msf/core/exception.rb', line 316

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