Module: Buby::Implants::MessageEditorController

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

Overview

This interface is used by an IMessageEditor to obtain details about the currently displayed message. Extensions that create instances of Burp’s HTTP message editor can optionally provide an implementation of IMessageEditorController, which the editor will invoke when it requires further information about the current message (for example, to send it to another Burp tool). Extensions that provide custom editor tabs via an IMessageEditorTabFactory will receive a reference to an IMessageEditorController object for each tab instance they generate, which the tab can invoke if it requires further information about the current message.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.implant(controller) ⇒ Object

Install ourselves into the current IMessageEditorController java class

Parameters:

  • controller (IMessageEditorController)


36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/buby/implants/message_editor_controller.rb', line 36

def self.implant(controller)
  unless controller.implanted? || controller.nil?
    pp [:implanting, controller, controller.class] if $DEBUG
    controller.class.class_exec(controller) do |controller|
      a_methods = %w{
        getRequest
        getResponse
      }
      a_methods.each do |meth|
        alias_method "__"+meth.to_s, meth
      end
      include Buby::Implants::MessageEditorController
      a_methods.each do |meth|
        java_class.ruby_names_for_java_method(meth).each do |ruby_meth|
          define_method ruby_meth, Buby::Implants::MessageEditorController.instance_method(meth)
        end
      end
      include Buby::Implants::Proxy
    end
  end
  controller
end

Instance Method Details

#getRequestString

This method is used to retrieve the HTTP request associated with the current message (which may itself be a response).

Returns:

  • (String)

    The HTTP request associated with the current message.



20
21
22
# File 'lib/buby/implants/message_editor_controller.rb', line 20

def getRequest
  String.from_java_bytes __getRequest
end

#getResponseString

This method is used to retrieve the HTTP response associated with the current message (which may itself be a request).

Returns:

  • (String)

    The HTTP response associated with the current message.



29
30
31
# File 'lib/buby/implants/message_editor_controller.rb', line 29

def getResponse
  String.from_java_bytes __getResponse
end