Module: Buby::Extender
- Includes:
- Java::Burp::IBurpExtender, Java::Burp::IContextMenuFactory, Java::Burp::IExtensionStateListener, Java::Burp::IHttpListener, Java::Burp::IProxyListener, Java::Burp::IScannerListener, Java::Burp::IScopeChangeListener
- Included in:
- BurpExtender
- Defined in:
- lib/buby/extender.rb
Overview
move implant logic to extender interfaces
This class, unlike the Java implementation, does not fire the deprecated evt_* callbacks, only the new versions.
This is the JRuby implementation of IBurpExtender for use as a JRuby extension. This class handles the type conversions and other ruby sugar. BurpExtender further extends this by adding additional things during startup, like setting up Buby as the handler class and starting console tabs.
Defined Under Namespace
Modules: ExtenderMethods
Buby internals collapse
- @@handler =
Internal reference to ruby handler class (usually Buby)
nil
Buby internals collapse
Burp extender collapse
-
#initialize(*args) ⇒ Object
This callback usually fires before the handler is set.
-
#registerExtenderCallbacks(callbacks) ⇒ void
This method is invoked when the extension is loaded.
Listeners collapse
- .included(klass) ⇒ Object
-
#createMenuItems(invocation) ⇒ Array<JMenuItem>?
abstract
This method will be called by Burp when the user invokes a context menu anywhere within Burp.
-
#extensionUnloaded ⇒ Object
This method is called when the extension is unloaded.
-
#newScanIssue(issue) ⇒ Object
This method is invoked when a new issue is added to Burp Scanner’s results.
-
#processHttpMessage(toolFlag, messageIsRequest, messageInfo) ⇒ void
This method is invoked when an HTTP request is about to be issued, and when an HTTP response has been received.
-
#processProxyMessage(messageIsRequest, message) ⇒ void
This method is invoked when an HTTP message is being processed by the Proxy and calls #process_proxy_message on the handler.
-
#scopeChanged ⇒ void
abstract
This method is invoked whenever a change occurs to Burp’s suite-wide target scope.
Class Method Details
.included(klass) ⇒ Object
136 137 138 |
# File 'lib/buby/extender.rb', line 136 def self.included klass klass.extend ExtenderMethods end |
Instance Method Details
#createMenuItems(invocation) ⇒ Array<JMenuItem>?
This method will be called by Burp when the user invokes a context menu anywhere within Burp. The factory can then provide any custom context menu items that should be displayed in the context menu, based on the details of the menu invocation.
122 123 124 |
# File 'lib/buby/extender.rb', line 122 def createMenuItems invocation @@handler.(invocation) if @@handler.respond_to? :create_menu_items end |
#extensionUnloaded ⇒ Object
This method is called when the extension is unloaded. This, in turn, calls Buby#extension_unloaded on the handler instance
63 64 65 |
# File 'lib/buby/extender.rb', line 63 def extensionUnloaded @@handler.extension_unloaded if @@handler.respond_to? :extension_unloaded end |
#handler ⇒ Object
25 26 27 |
# File 'lib/buby/extender.rb', line 25 def handler @@handler end |
#handler=(hndlr) ⇒ Object
29 30 31 |
# File 'lib/buby/extender.rb', line 29 def handler= hndlr @@handler = hndlr end |
#initialize(*args) ⇒ Object
This callback usually fires before the handler is set.
36 37 38 |
# File 'lib/buby/extender.rb', line 36 def initialize *args @@handler.extender_initialize(*args) if @@handler.respond_to? :extender_inititialize end |
#newScanIssue(issue) ⇒ Object
This method is invoked when a new issue is added to Burp Scanner’s results.
105 106 107 |
# File 'lib/buby/extender.rb', line 105 def newScanIssue(issue) @@handler.new_scan_issue(issue) if @@handler.respond_to? :new_scan_issue end |
#processHttpMessage(toolFlag, messageIsRequest, messageInfo) ⇒ void
This method returns an undefined value.
This method is invoked when an HTTP request is about to be issued, and when an HTTP response has been received.
95 96 97 |
# File 'lib/buby/extender.rb', line 95 def processHttpMessage(toolFlag, , ) @@handler.(toolFlag, , ) if @@handler.respond_to? :process_http_message end |
#processProxyMessage(messageIsRequest, message) ⇒ void
This method returns an undefined value.
This method is invoked when an HTTP message is being processed by the Proxy and calls Buby#process_proxy_message on the handler.
78 79 80 |
# File 'lib/buby/extender.rb', line 78 def processProxyMessage(, ) @@handler.(, ) if @@handler.respond_to? :process_proxy_message end |
#registerExtenderCallbacks(callbacks) ⇒ void
This method returns an undefined value.
This method is invoked when the extension is loaded. It registers an instance of the IBurpExtenderCallbacks
interface, providing methods that may be invoked by the extension to perform various actions.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/buby/extender.rb', line 48 def registerExtenderCallbacks(callbacks) @callbacks = callbacks callbacks.issueAlert("[#{self.class}] registering JRuby handler callbacks") callbacks.registerExtensionStateListener(self) callbacks.registerHttpListener(self) callbacks.registerScannerListener(self) callbacks.registerContextMenuFactory self callbacks.registerScopeChangeListener self @@handler.register_callbacks(callbacks) if @@handler.respond_to? :register_callbacks end |
#scopeChanged ⇒ void
This method returns an undefined value.
This method is invoked whenever a change occurs to Burp’s suite-wide target scope.
132 133 134 |
# File 'lib/buby/extender.rb', line 132 def scopeChanged @@handler.scope_changed if @@handler.respond_to? :scope_changed end |