Module: Buby::Implants::ContextMenuInvocation
- Defined in:
- lib/buby/implants/context_menu_invocation.rb
Overview
This interface is used when Burp calls into an extension-provided IContextMenuFactory
with details of a context menu invocation. The custom context menu factory can query this interface to obtain details of the invocation event, in order to determine what menu items should be displayed. This module is used to extend the JRuby proxy class returned by Burp.
Constant Summary collapse
- CONTEXT_MESSAGE_EDITOR_REQUEST =
Context menu is being invoked in a request editor.
0
- CONTEXT_MESSAGE_EDITOR_RESPONSE =
Context menu is being invoked in a response editor.
1
- CONTEXT_MESSAGE_VIEWER_REQUEST =
Context menu is being invoked in a non-editable request viewer.
2
- CONTEXT_MESSAGE_VIEWER_RESPONSE =
Context menu is being invoked in a non-editable response viewer.
3
- CONTEXT_TARGET_SITE_MAP_TREE =
Context menu is being invoked in the Target site map tree.
4
- CONTEXT_TARGET_SITE_MAP_TABLE =
Context menu is being invoked in the Target site map table.
5
- CONTEXT_PROXY_HISTORY =
Context menu is being invoked in the Proxy history.
6
- CONTEXT_SCANNER_RESULTS =
Context menu is being invoked in the Scanner results.
7
- CONTEXT_INTRUDER_PAYLOAD_POSITIONS =
Context menu is being invoked in the Intruder payload positions editor.
8
- CONTEXT_INTRUDER_ATTACK_RESULTS =
Context menu is being invoked in an Intruder attack results.
9
- CONTEXT_SEARCH_RESULTS =
Context menu is being invoked in a search results window.
10
Class Method Summary collapse
-
.implant(invocation) ⇒ Object
Install ourselves into the current
IContextMenuInvocation
java class.
Instance Method Summary collapse
-
#getSelectedIssues ⇒ Array<IScanIssue>?
This method can be used to retrieve details of the Scanner issues that were selected by the user when the context menu was invoked.
-
#getSelectedMessages ⇒ Array<IHttpRequestResponse>?
This method can be used to retrieve details of the HTTP requests / responses that were shown or selected by the user when the context menu was invoked.
Class Method Details
.implant(invocation) ⇒ Object
Install ourselves into the current IContextMenuInvocation
java class
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/buby/implants/context_menu_invocation.rb', line 89 def self.implant(invocation) unless invocation.implanted? || invocation.nil? pp [:implanting, invocation, invocation.class] if $DEBUG invocation.class.class_exec(invocation) do |invocation| a_methods = %w{ getSelectedMessages getSelectedIssues } a_methods.each do |meth| alias_method "__"+meth.to_s, meth end include Buby::Implants::ContextMenuInvocation a_methods.each do |meth| java_class.ruby_names_for_java_method(meth).each do |ruby_meth| define_method ruby_meth, Buby::Implants::ContextMenuInvocation.instance_method(meth) end end include Buby::Implants::Proxy end end invocation end |
Instance Method Details
#getSelectedIssues ⇒ Array<IScanIssue>?
This method can be used to retrieve details of the Scanner issues that were selected by the user when the context menu was invoked.
79 80 81 82 83 84 |
# File 'lib/buby/implants/context_menu_invocation.rb', line 79 def getSelectedIssues pp [:got_get_selected_issues] if $DEBUG sil = __getSelectedIssues ScanIssueHelper.implant(sil.first) sil end |
#getSelectedMessages ⇒ Array<IHttpRequestResponse>?
For performance reasons, the objects returned from this method are tied to the originating context of the messages within the Burp UI. For example, if a context menu is invoked on the Proxy intercept panel, then the IHttpRequestResponse
returned by this method will reflect the current contents of the interception panel, and this will change when the current message has been forwarded or dropped. If your extension needs to store details of the message for which the context menu has been invoked, then you should query those details from the IHttpRequestResponse
at the time of invocation, or you should use IBurpExtenderCallbacks.saveBuffersToTempFiles() to create a persistent read-only copy of the IHttpRequestResponse
.
This method can be used to retrieve details of the HTTP requests / responses that were shown or selected by the user when the context menu was invoked.
65 66 67 68 69 70 |
# File 'lib/buby/implants/context_menu_invocation.rb', line 65 def getSelectedMessages pp [:got_get_selected_messages] if $DEBUG hrrl = __getSelectedMessages HttpRequestResponseHelper.implant(hrrl.first) hrrl end |