Method: Buby::Implants::ScannerInsertionPoint#getPayloadOffsets

Defined in:
lib/buby/implants/scanner_insertion_point.rb

#getPayloadOffsets(payload) ⇒ Array<Fixnum>?

This method is used to determine the offsets of the payload value within the request, when it is placed into the insertion point. Scan checks may invoke this method when reporting issues, so as to highlight the relevant part of the request within the UI.

Parameters:

  • payload (String, Array<byte>)

    The payload that should be placed into the insertion point.

Returns:

  • (Array<Fixnum>, nil)

    An int array containing the start and end offsets of the payload within the request, or nil if this is not applicable (for example, where the insertion point places a payload into a serialized data structure, the raw payload may not literally appear anywhere within the resulting request).



60
61
62
63
# File 'lib/buby/implants/scanner_insertion_point.rb', line 60

def getPayloadOffsets(payload)
  payload = payload.to_java_bytes if payload.respond_to? :to_java_bytes
  __getPayloadOffsets(payload)
end