buby 1.3.3-java → 1.5.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +28 -14
- data/Rakefile +96 -6
- data/VERSION.yml +5 -0
- data/bin/buby +2 -0
- data/buby.gemspec +102 -17
- data/{java/src → ext/buby/burp}/BurpExtender.java +189 -29
- data/ext/burp_interfaces/burp/IBurpExtender.java +31 -0
- data/ext/burp_interfaces/burp/IBurpExtenderCallbacks.java +785 -0
- data/ext/burp_interfaces/burp/IContextMenuFactory.java +38 -0
- data/ext/burp_interfaces/burp/IContextMenuInvocation.java +156 -0
- data/ext/burp_interfaces/burp/ICookie.java +53 -0
- data/ext/burp_interfaces/burp/IExtensionHelpers.java +352 -0
- data/ext/burp_interfaces/burp/IExtensionStateListener.java +27 -0
- data/ext/burp_interfaces/burp/IHttpListener.java +37 -0
- data/ext/burp_interfaces/burp/IHttpRequestResponse.java +102 -0
- data/ext/burp_interfaces/burp/IHttpRequestResponsePersisted.java +26 -0
- data/ext/burp_interfaces/burp/IHttpRequestResponseWithMarkers.java +44 -0
- data/ext/burp_interfaces/burp/IHttpService.java +39 -0
- data/ext/burp_interfaces/burp/IInterceptedProxyMessage.java +116 -0
- data/ext/burp_interfaces/burp/IIntruderAttack.java +31 -0
- data/ext/burp_interfaces/burp/IIntruderPayloadGenerator.java +50 -0
- data/ext/burp_interfaces/burp/IIntruderPayloadGeneratorFactory.java +40 -0
- data/ext/burp_interfaces/burp/IIntruderPayloadProcessor.java +45 -0
- data/{java/src → ext/burp_interfaces}/burp/IMenuItemHandler.java +36 -40
- data/ext/burp_interfaces/burp/IMessageEditor.java +64 -0
- data/ext/burp_interfaces/burp/IMessageEditorController.java +49 -0
- data/ext/burp_interfaces/burp/IMessageEditorTab.java +102 -0
- data/ext/burp_interfaces/burp/IMessageEditorTabFactory.java +38 -0
- data/ext/burp_interfaces/burp/IParameter.java +104 -0
- data/ext/burp_interfaces/burp/IProxyListener.java +37 -0
- data/ext/burp_interfaces/burp/IRequestInfo.java +95 -0
- data/ext/burp_interfaces/burp/IResponseInfo.java +54 -0
- data/ext/burp_interfaces/burp/IScanIssue.java +120 -0
- data/ext/burp_interfaces/burp/IScanQueueItem.java +80 -0
- data/ext/burp_interfaces/burp/IScannerCheck.java +89 -0
- data/ext/burp_interfaces/burp/IScannerInsertionPoint.java +156 -0
- data/ext/burp_interfaces/burp/IScannerInsertionPointProvider.java +38 -0
- data/ext/burp_interfaces/burp/IScannerListener.java +30 -0
- data/ext/burp_interfaces/burp/IScopeChangeListener.java +25 -0
- data/ext/burp_interfaces/burp/ISessionHandlingAction.java +51 -0
- data/ext/burp_interfaces/burp/ITab.java +38 -0
- data/ext/burp_interfaces/burp/ITempFile.java +33 -0
- data/ext/burp_interfaces/burp/ITextEditor.java +90 -0
- data/lib/buby/burp_extender/console_frame.rb +33 -0
- data/lib/buby/burp_extender/console_pane.rb +26 -0
- data/lib/buby/burp_extender/console_tab.rb +15 -0
- data/lib/buby/burp_extender/context_menu.rb +29 -0
- data/lib/buby/burp_extender/context_menu_factory.rb +17 -0
- data/lib/buby/burp_extender/context_menu_item.rb +13 -0
- data/lib/buby/burp_extender/jcheck_box_menu_item.rb +12 -0
- data/lib/buby/burp_extender/jmenu.rb +11 -0
- data/lib/buby/burp_extender/jmenu_item.rb +12 -0
- data/lib/buby/burp_extender/menu.rb +11 -0
- data/lib/buby/burp_extender/menu_item.rb +12 -0
- data/lib/buby/burp_extender.rb +339 -0
- data/lib/buby/context_menu_factory.rb +35 -0
- data/lib/buby/cookie.rb +37 -0
- data/lib/buby/extender.rb +156 -0
- data/lib/buby/http_listener.rb +29 -0
- data/lib/buby/{extends → implants}/buby_array_wrapper.rb +0 -0
- data/lib/buby/implants/context_menu_invocation.rb +113 -0
- data/lib/buby/implants/cookie.rb +47 -0
- data/lib/buby/implants/extension_helpers.rb +286 -0
- data/lib/buby/{extends → implants}/http_request_response.rb +8 -1
- data/lib/buby/implants/intercepted_proxy_message.rb +53 -0
- data/lib/buby/implants/intruder_attack.rb +42 -0
- data/lib/buby/implants/jruby.rb +64 -0
- data/lib/buby/implants/message_editor.rb +70 -0
- data/lib/buby/implants/message_editor_controller.rb +60 -0
- data/lib/buby/implants/parameter.rb +84 -0
- data/lib/buby/implants/request_info.rb +47 -0
- data/lib/buby/implants/response_info.rb +44 -0
- data/lib/buby/{extends → implants}/scan_issue.rb +1 -2
- data/lib/buby/implants/scan_queue_item.rb +53 -0
- data/lib/buby/implants/scanner_insertion_point.rb +92 -0
- data/lib/buby/implants/temp_file.rb +43 -0
- data/lib/buby/implants/text_editor.rb +63 -0
- data/lib/buby/implants.rb +28 -0
- data/lib/buby/intruder_payload_generator.rb +60 -0
- data/lib/buby/intruder_payload_generator_factory.rb +32 -0
- data/lib/buby/intruder_payload_processor.rb +38 -0
- data/lib/buby/message_editor_controller.rb +41 -0
- data/lib/buby/message_editor_tab.rb +98 -0
- data/lib/buby/message_editor_tab_factory.rb +28 -0
- data/lib/buby/parameter/base.rb +40 -0
- data/lib/buby/parameter/body.rb +7 -0
- data/lib/buby/parameter/cookie.rb +7 -0
- data/lib/buby/parameter/url.rb +7 -0
- data/lib/buby/parameter.rb +15 -0
- data/lib/buby/proxy_listener.rb +26 -0
- data/lib/buby/scan_issue.rb +112 -0
- data/lib/buby/scanner_check.rb +84 -0
- data/lib/buby/scanner_insertion_point.rb +118 -0
- data/lib/buby/scanner_insertion_point_provider.rb +27 -0
- data/lib/buby/scanner_listener.rb +22 -0
- data/lib/buby/scope_change_listener.rb +19 -0
- data/lib/buby/session_handling_action.rb +43 -0
- data/lib/buby/tab.rb +37 -0
- data/lib/buby/version.rb +9 -0
- data/lib/buby.rb +892 -101
- metadata +118 -22
- data/VERSION +0 -1
- data/java/buby.jar +0 -0
- data/java/src/burp/IBurpExtender.java +0 -180
- data/java/src/burp/IBurpExtenderCallbacks.java +0 -373
- data/java/src/burp/IHttpRequestResponse.java +0 -156
- data/java/src/burp/IScanIssue.java +0 -106
- data/java/src/burp/IScanQueueItem.java +0 -76
- data/lib/buby/extends.rb +0 -4
@@ -0,0 +1,38 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)IContextMenuFactory.java
|
5
|
+
*
|
6
|
+
* Copyright PortSwigger Ltd. All rights reserved.
|
7
|
+
*
|
8
|
+
* This code may be used to extend the functionality of Burp Suite Free Edition
|
9
|
+
* and Burp Suite Professional, provided that this usage does not violate the
|
10
|
+
* license terms for those products.
|
11
|
+
*/
|
12
|
+
import java.util.List;
|
13
|
+
import javax.swing.JMenuItem;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Extensions can implement this interface and then call
|
17
|
+
* <code>IBurpExtenderCallbacks.registerContextMenuFactory()</code> to register
|
18
|
+
* a factory for custom context menu items.
|
19
|
+
*/
|
20
|
+
public interface IContextMenuFactory
|
21
|
+
{
|
22
|
+
/**
|
23
|
+
* This method will be called by Burp when the user invokes a context menu
|
24
|
+
* anywhere within Burp. The factory can then provide any custom context
|
25
|
+
* menu items that should be displayed in the context menu, based on the
|
26
|
+
* details of the menu invocation.
|
27
|
+
*
|
28
|
+
* @param invocation An object that implements the
|
29
|
+
* <code>IMessageEditorTabFactory</code> interface, which the extension can
|
30
|
+
* query to obtain details of the context menu invocation.
|
31
|
+
* @return A list of custom menu items (which may include sub-menus,
|
32
|
+
* checkbox menu items, etc.) that should be displayed. Extensions may
|
33
|
+
* return
|
34
|
+
* <code>null</code> from this method, to indicate that no menu items are
|
35
|
+
* required.
|
36
|
+
*/
|
37
|
+
List<JMenuItem> createMenuItems(IContextMenuInvocation invocation);
|
38
|
+
}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)IContextMenuInvocation.java
|
5
|
+
*
|
6
|
+
* Copyright PortSwigger Ltd. All rights reserved.
|
7
|
+
*
|
8
|
+
* This code may be used to extend the functionality of Burp Suite Free Edition
|
9
|
+
* and Burp Suite Professional, provided that this usage does not violate the
|
10
|
+
* license terms for those products.
|
11
|
+
*/
|
12
|
+
import java.awt.event.InputEvent;
|
13
|
+
|
14
|
+
/**
|
15
|
+
* This interface is used when Burp calls into an extension-provided
|
16
|
+
* <code>IContextMenuFactory</code> with details of a context menu invocation.
|
17
|
+
* The custom context menu factory can query this interface to obtain details of
|
18
|
+
* the invocation event, in order to determine what menu items should be
|
19
|
+
* displayed.
|
20
|
+
*/
|
21
|
+
public interface IContextMenuInvocation
|
22
|
+
{
|
23
|
+
/**
|
24
|
+
* Used to indicate that the context menu is being invoked in a request
|
25
|
+
* editor.
|
26
|
+
*/
|
27
|
+
static final byte CONTEXT_MESSAGE_EDITOR_REQUEST = 0;
|
28
|
+
/**
|
29
|
+
* Used to indicate that the context menu is being invoked in a response
|
30
|
+
* editor.
|
31
|
+
*/
|
32
|
+
static final byte CONTEXT_MESSAGE_EDITOR_RESPONSE = 1;
|
33
|
+
/**
|
34
|
+
* Used to indicate that the context menu is being invoked in a non-editable
|
35
|
+
* request viewer.
|
36
|
+
*/
|
37
|
+
static final byte CONTEXT_MESSAGE_VIEWER_REQUEST = 2;
|
38
|
+
/**
|
39
|
+
* Used to indicate that the context menu is being invoked in a non-editable
|
40
|
+
* response viewer.
|
41
|
+
*/
|
42
|
+
static final byte CONTEXT_MESSAGE_VIEWER_RESPONSE = 3;
|
43
|
+
/**
|
44
|
+
* Used to indicate that the context menu is being invoked in the Target
|
45
|
+
* site map tree.
|
46
|
+
*/
|
47
|
+
static final byte CONTEXT_TARGET_SITE_MAP_TREE = 4;
|
48
|
+
/**
|
49
|
+
* Used to indicate that the context menu is being invoked in the Target
|
50
|
+
* site map table.
|
51
|
+
*/
|
52
|
+
static final byte CONTEXT_TARGET_SITE_MAP_TABLE = 5;
|
53
|
+
/**
|
54
|
+
* Used to indicate that the context menu is being invoked in the Proxy
|
55
|
+
* history.
|
56
|
+
*/
|
57
|
+
static final byte CONTEXT_PROXY_HISTORY = 6;
|
58
|
+
/**
|
59
|
+
* Used to indicate that the context menu is being invoked in the Scanner
|
60
|
+
* results.
|
61
|
+
*/
|
62
|
+
static final byte CONTEXT_SCANNER_RESULTS = 7;
|
63
|
+
/**
|
64
|
+
* Used to indicate that the context menu is being invoked in the Intruder
|
65
|
+
* payload positions editor.
|
66
|
+
*/
|
67
|
+
static final byte CONTEXT_INTRUDER_PAYLOAD_POSITIONS = 8;
|
68
|
+
/**
|
69
|
+
* Used to indicate that the context menu is being invoked in an Intruder
|
70
|
+
* attack results.
|
71
|
+
*/
|
72
|
+
static final byte CONTEXT_INTRUDER_ATTACK_RESULTS = 9;
|
73
|
+
/**
|
74
|
+
* Used to indicate that the context menu is being invoked in a search
|
75
|
+
* results window.
|
76
|
+
*/
|
77
|
+
static final byte CONTEXT_SEARCH_RESULTS = 10;
|
78
|
+
|
79
|
+
/**
|
80
|
+
* This method can be used to retrieve the native Java input event that was
|
81
|
+
* the trigger for the context menu invocation.
|
82
|
+
*
|
83
|
+
* @return The <code>InputEvent</code> that was the trigger for the context
|
84
|
+
* menu invocation.
|
85
|
+
*/
|
86
|
+
InputEvent getInputEvent();
|
87
|
+
|
88
|
+
/**
|
89
|
+
* This method can be used to retrieve the Burp tool within which the
|
90
|
+
* context menu was invoked.
|
91
|
+
*
|
92
|
+
* @return A flag indicating the Burp tool within which the context menu was
|
93
|
+
* invoked. Burp tool flags are defined in the
|
94
|
+
* <code>IBurpExtenderCallbacks</code> interface.
|
95
|
+
*/
|
96
|
+
int getToolFlag();
|
97
|
+
|
98
|
+
/**
|
99
|
+
* This method can be used to retrieve the context within which the menu was
|
100
|
+
* invoked.
|
101
|
+
*
|
102
|
+
* @return An index indicating the context within which the menu was
|
103
|
+
* invoked. The indices used are defined within this interface.
|
104
|
+
*/
|
105
|
+
byte getInvocationContext();
|
106
|
+
|
107
|
+
/**
|
108
|
+
* This method can be used to retrieve the bounds of the user's selection
|
109
|
+
* into the current message, if applicable.
|
110
|
+
*
|
111
|
+
* @return An int[2] array containing the start and end offsets of the
|
112
|
+
* user's selection in the current message. If the user has not made any
|
113
|
+
* selection in the current message, both offsets indicate the position of
|
114
|
+
* the caret within the editor. If the menu is not being invoked from a
|
115
|
+
* message editor, the method returns <code>null</code>.
|
116
|
+
*/
|
117
|
+
int[] getSelectionBounds();
|
118
|
+
|
119
|
+
/**
|
120
|
+
* This method can be used to retrieve details of the HTTP requests /
|
121
|
+
* responses that were shown or selected by the user when the context menu
|
122
|
+
* was invoked.
|
123
|
+
*
|
124
|
+
* <b>Note:</b> For performance reasons, the objects returned from this
|
125
|
+
* method are tied to the originating context of the messages within the
|
126
|
+
* Burp UI. For example, if a context menu is invoked on the Proxy intercept
|
127
|
+
* panel, then the
|
128
|
+
* <code>IHttpRequestResponse</code> returned by this method will reflect
|
129
|
+
* the current contents of the interception panel, and this will change when
|
130
|
+
* the current message has been forwarded or dropped. If your extension
|
131
|
+
* needs to store details of the message for which the context menu has been
|
132
|
+
* invoked, then you should query those details from the
|
133
|
+
* <code>IHttpRequestResponse</code> at the time of invocation, or you
|
134
|
+
* should use
|
135
|
+
* <code>IBurpExtenderCallbacks.saveBuffersToTempFiles()</code> to create a
|
136
|
+
* persistent read-only copy of the
|
137
|
+
* <code>IHttpRequestResponse</code>.
|
138
|
+
*
|
139
|
+
* @return An array of <code>IHttpRequestResponse</code> objects
|
140
|
+
* representing the items that were shown or selected by the user when the
|
141
|
+
* context menu was invoked. This method returns <code>null</code> if no
|
142
|
+
* messages are applicable to the invocation.
|
143
|
+
*/
|
144
|
+
IHttpRequestResponse[] getSelectedMessages();
|
145
|
+
|
146
|
+
/**
|
147
|
+
* This method can be used to retrieve details of the Scanner issues that
|
148
|
+
* were selected by the user when the context menu was invoked.
|
149
|
+
*
|
150
|
+
* @return An array of <code>IScanIssue</code> objects representing the
|
151
|
+
* issues that were selected by the user when the context menu was invoked.
|
152
|
+
* This method returns <code>null</code> if no Scanner issues are applicable
|
153
|
+
* to the invocation.
|
154
|
+
*/
|
155
|
+
IScanIssue[] getSelectedIssues();
|
156
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)ICookie.java
|
5
|
+
*
|
6
|
+
* Copyright PortSwigger Ltd. All rights reserved.
|
7
|
+
*
|
8
|
+
* This code may be used to extend the functionality of Burp Suite Free Edition
|
9
|
+
* and Burp Suite Professional, provided that this usage does not violate the
|
10
|
+
* license terms for those products.
|
11
|
+
*/
|
12
|
+
import java.util.Date;
|
13
|
+
|
14
|
+
/**
|
15
|
+
* This interface is used to hold details about an HTTP cookie.
|
16
|
+
*/
|
17
|
+
public interface ICookie
|
18
|
+
{
|
19
|
+
/**
|
20
|
+
* This method is used to retrieve the domain for which the cookie is in
|
21
|
+
* scope.
|
22
|
+
*
|
23
|
+
* @return The domain for which the cookie is in scope. <b>Note:</b> For
|
24
|
+
* cookies that have been analyzed from responses (by calling
|
25
|
+
* <code>IExtensionHelpers.analyzeResponse()</code> and then
|
26
|
+
* <code>IResponseInfo.getCookies()</code>, the domain will be
|
27
|
+
* <code>null</code> if the response did not explicitly set a domain
|
28
|
+
* attribute for the cookie.
|
29
|
+
*/
|
30
|
+
String getDomain();
|
31
|
+
|
32
|
+
/**
|
33
|
+
* This method is used to retrieve the expiration time for the cookie.
|
34
|
+
*
|
35
|
+
* @return The expiration time for the cookie, or
|
36
|
+
* <code>null</code> if none is set (i.e., for non-persistent session
|
37
|
+
* cookies).
|
38
|
+
*/
|
39
|
+
Date getExpiration();
|
40
|
+
|
41
|
+
/**
|
42
|
+
* This method is used to retrieve the name of the cookie.
|
43
|
+
*
|
44
|
+
* @return The name of the cookie.
|
45
|
+
*/
|
46
|
+
String getName();
|
47
|
+
|
48
|
+
/**
|
49
|
+
* This method is used to retrieve the value of the cookie.
|
50
|
+
* @return The value of the cookie.
|
51
|
+
*/
|
52
|
+
String getValue();
|
53
|
+
}
|
@@ -0,0 +1,352 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)IExtensionHelpers.java
|
5
|
+
*
|
6
|
+
* Copyright PortSwigger Ltd. All rights reserved.
|
7
|
+
*
|
8
|
+
* This code may be used to extend the functionality of Burp Suite Free Edition
|
9
|
+
* and Burp Suite Professional, provided that this usage does not violate the
|
10
|
+
* license terms for those products.
|
11
|
+
*/
|
12
|
+
import java.net.URL;
|
13
|
+
import java.util.List;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* This interface contains a number of helper methods, which extensions can use
|
17
|
+
* to assist with various common tasks that arise for Burp extensions.
|
18
|
+
*
|
19
|
+
* Extensions can call
|
20
|
+
* <code>IBurpExtenderCallbacks.getHelpers</code> to obtain an instance of this
|
21
|
+
* interface.
|
22
|
+
*/
|
23
|
+
public interface IExtensionHelpers
|
24
|
+
{
|
25
|
+
/**
|
26
|
+
* This method can be used to analyze an HTTP request, and obtain various
|
27
|
+
* key details about it.
|
28
|
+
*
|
29
|
+
* @param request An
|
30
|
+
* <code>IHttpRequestResponse</code> object containing the request to be
|
31
|
+
* analyzed.
|
32
|
+
* @return An
|
33
|
+
* <code>IRequestInfo</code> object that can be queried to obtain details
|
34
|
+
* about the request.
|
35
|
+
*/
|
36
|
+
IRequestInfo analyzeRequest(IHttpRequestResponse request);
|
37
|
+
|
38
|
+
/**
|
39
|
+
* This method can be used to analyze an HTTP request, and obtain various
|
40
|
+
* key details about it.
|
41
|
+
*
|
42
|
+
* @param httpService The HTTP service associated with the request. This is
|
43
|
+
* optional and may be
|
44
|
+
* <code>null</code>, in which case the resulting
|
45
|
+
* <code>IRequestInfo</code> object will not include the full request URL.
|
46
|
+
* @param request The request to be analyzed.
|
47
|
+
* @return An
|
48
|
+
* <code>IRequestInfo</code> object that can be queried to obtain details
|
49
|
+
* about the request.
|
50
|
+
*/
|
51
|
+
IRequestInfo analyzeRequest(IHttpService httpService, byte[] request);
|
52
|
+
|
53
|
+
/**
|
54
|
+
* This method can be used to analyze an HTTP request, and obtain various
|
55
|
+
* key details about it. The resulting
|
56
|
+
* <code>IRequestInfo</code> object will not include the full request URL.
|
57
|
+
* To obtain the full URL, use one of the other overloaded
|
58
|
+
* <code>analyzeRequest()</code> methods.
|
59
|
+
*
|
60
|
+
* @param request The request to be analyzed.
|
61
|
+
* @return An
|
62
|
+
* <code>IRequestInfo</code> object that can be queried to obtain details
|
63
|
+
* about the request.
|
64
|
+
*/
|
65
|
+
IRequestInfo analyzeRequest(byte[] request);
|
66
|
+
|
67
|
+
/**
|
68
|
+
* This method can be used to analyze an HTTP response, and obtain various
|
69
|
+
* key details about it.
|
70
|
+
*
|
71
|
+
* @param response The response to be analyzed.
|
72
|
+
* @return An
|
73
|
+
* <code>IResponseInfo</code> object that can be queried to obtain details
|
74
|
+
* about the response.
|
75
|
+
*/
|
76
|
+
IResponseInfo analyzeResponse(byte[] response);
|
77
|
+
|
78
|
+
/**
|
79
|
+
* This method can be used to retrieve details of a specified parameter
|
80
|
+
* within an HTTP request. <b>Note:</b> Use
|
81
|
+
* <code>analyzeRequest()</code> to obtain details of all parameters within
|
82
|
+
* the request.
|
83
|
+
*
|
84
|
+
* @param request The request to be inspected for the specified parameter.
|
85
|
+
* @param parameterName The name of the parameter to retrieve.
|
86
|
+
* @return An
|
87
|
+
* <code>IParameter</code> object that can be queried to obtain details
|
88
|
+
* about the parameter, or
|
89
|
+
* <code>null</code> if the parameter was not found.
|
90
|
+
*/
|
91
|
+
IParameter getRequestParameter(byte[] request, String parameterName);
|
92
|
+
|
93
|
+
/**
|
94
|
+
* This method can be used to URL-decode the specified data.
|
95
|
+
*
|
96
|
+
* @param data The data to be decoded.
|
97
|
+
* @return The decoded data.
|
98
|
+
*/
|
99
|
+
String urlDecode(String data);
|
100
|
+
|
101
|
+
/**
|
102
|
+
* This method can be used to URL-encode the specified data. Any characters
|
103
|
+
* that do not need to be encoded within HTTP requests are not encoded.
|
104
|
+
*
|
105
|
+
* @param data The data to be encoded.
|
106
|
+
* @return The encoded data.
|
107
|
+
*/
|
108
|
+
String urlEncode(String data);
|
109
|
+
|
110
|
+
/**
|
111
|
+
* This method can be used to URL-decode the specified data.
|
112
|
+
*
|
113
|
+
* @param data The data to be decoded.
|
114
|
+
* @return The decoded data.
|
115
|
+
*/
|
116
|
+
byte[] urlDecode(byte[] data);
|
117
|
+
|
118
|
+
/**
|
119
|
+
* This method can be used to URL-encode the specified data. Any characters
|
120
|
+
* that do not need to be encoded within HTTP requests are not encoded.
|
121
|
+
*
|
122
|
+
* @param data The data to be encoded.
|
123
|
+
* @return The encoded data.
|
124
|
+
*/
|
125
|
+
byte[] urlEncode(byte[] data);
|
126
|
+
|
127
|
+
/**
|
128
|
+
* This method can be used to Base64-decode the specified data.
|
129
|
+
*
|
130
|
+
* @param data The data to be decoded.
|
131
|
+
* @return The decoded data.
|
132
|
+
*/
|
133
|
+
byte[] base64Decode(String data);
|
134
|
+
|
135
|
+
/**
|
136
|
+
* This method can be used to Base64-decode the specified data.
|
137
|
+
*
|
138
|
+
* @param data The data to be decoded.
|
139
|
+
* @return The decoded data.
|
140
|
+
*/
|
141
|
+
byte[] base64Decode(byte[] data);
|
142
|
+
|
143
|
+
/**
|
144
|
+
* This method can be used to Base64-encode the specified data.
|
145
|
+
*
|
146
|
+
* @param data The data to be encoded.
|
147
|
+
* @return The encoded data.
|
148
|
+
*/
|
149
|
+
String base64Encode(String data);
|
150
|
+
|
151
|
+
/**
|
152
|
+
* This method can be used to Base64-encode the specified data.
|
153
|
+
*
|
154
|
+
* @param data The data to be encoded.
|
155
|
+
* @return The encoded data.
|
156
|
+
*/
|
157
|
+
String base64Encode(byte[] data);
|
158
|
+
|
159
|
+
/**
|
160
|
+
* This method can be used to convert data from String form into an array of
|
161
|
+
* bytes. The conversion does not reflect any particular character set, and
|
162
|
+
* a character with the hex representation 0xWXYZ will always be converted
|
163
|
+
* into a byte with the representation 0xYZ. It performs the opposite
|
164
|
+
* conversion to the method
|
165
|
+
* <code>bytesToString()</code>, and byte-based data that is converted to a
|
166
|
+
* String and back again using these two methods is guaranteed to retain its
|
167
|
+
* integrity (which may not be the case with conversions that reflect a
|
168
|
+
* given character set).
|
169
|
+
*
|
170
|
+
* @param data The data to be converted.
|
171
|
+
* @return The converted data.
|
172
|
+
*/
|
173
|
+
byte[] stringToBytes(String data);
|
174
|
+
|
175
|
+
/**
|
176
|
+
* This method can be used to convert data from an array of bytes into
|
177
|
+
* String form. The conversion does not reflect any particular character
|
178
|
+
* set, and a byte with the representation 0xYZ will always be converted
|
179
|
+
* into a character with the hex representation 0x00YZ. It performs the
|
180
|
+
* opposite conversion to the method
|
181
|
+
* <code>stringToBytes()</code>, and byte-based data that is converted to a
|
182
|
+
* String and back again using these two methods is guaranteed to retain its
|
183
|
+
* integrity (which may not be the case with conversions that reflect a
|
184
|
+
* given character set).
|
185
|
+
*
|
186
|
+
* @param data The data to be converted.
|
187
|
+
* @return The converted data.
|
188
|
+
*/
|
189
|
+
String bytesToString(byte[] data);
|
190
|
+
|
191
|
+
/**
|
192
|
+
* This method searches a piece of data for the first occurrence of a
|
193
|
+
* specified pattern. It works on byte-based data in a way that is similar
|
194
|
+
* to the way the native Java method
|
195
|
+
* <code>String.indexOf()</code> works on String-based data.
|
196
|
+
*
|
197
|
+
* @param data The data to be searched.
|
198
|
+
* @param pattern The pattern to be searched for.
|
199
|
+
* @param caseSensitive Flags whether or not the search is case-sensitive.
|
200
|
+
* @param from The offset within
|
201
|
+
* <code>data</code> where the search should begin.
|
202
|
+
* @param to The offset within
|
203
|
+
* <code>data</code> where the search should end.
|
204
|
+
* @return The offset of the first occurrence of the pattern within the
|
205
|
+
* specified bounds, or -1 if no match is found.
|
206
|
+
*/
|
207
|
+
int indexOf(byte[] data,
|
208
|
+
byte[] pattern,
|
209
|
+
boolean caseSensitive,
|
210
|
+
int from,
|
211
|
+
int to);
|
212
|
+
|
213
|
+
/**
|
214
|
+
* This method builds an HTTP message containing the specified headers and
|
215
|
+
* message body. If applicable, the Content-Length header will be added or
|
216
|
+
* updated, based on the length of the body.
|
217
|
+
*
|
218
|
+
* @param headers A list of headers to include in the message.
|
219
|
+
* @param body The body of the message, of
|
220
|
+
* <code>null</code> if the message has an empty body.
|
221
|
+
* @return The resulting full HTTP message.
|
222
|
+
*/
|
223
|
+
byte[] buildHttpMessage(List<String> headers, byte[] body);
|
224
|
+
|
225
|
+
/**
|
226
|
+
* This method creates a GET request to the specified URL. The headers used
|
227
|
+
* in the request are determined by the Request headers settings as
|
228
|
+
* configured in Burp Spider's options.
|
229
|
+
*
|
230
|
+
* @param url The URL to which the request should be made.
|
231
|
+
* @return A request to the specified URL.
|
232
|
+
*/
|
233
|
+
byte[] buildHttpRequest(URL url);
|
234
|
+
|
235
|
+
/**
|
236
|
+
* This method adds a new parameter to an HTTP request, and if appropriate
|
237
|
+
* updates the Content-Length header.
|
238
|
+
*
|
239
|
+
* @param request The request to which the parameter should be added.
|
240
|
+
* @param parameter An
|
241
|
+
* <code>IParameter</code> object containing details of the parameter to be
|
242
|
+
* added. Supported parameter types are:
|
243
|
+
* <code>PARAM_URL</code>,
|
244
|
+
* <code>PARAM_BODY</code> and
|
245
|
+
* <code>PARAM_COOKIE</code>.
|
246
|
+
* @return A new HTTP request with the new parameter added.
|
247
|
+
*/
|
248
|
+
byte[] addParameter(byte[] request, IParameter parameter);
|
249
|
+
|
250
|
+
/**
|
251
|
+
* This method removes a parameter from an HTTP request, and if appropriate
|
252
|
+
* updates the Content-Length header.
|
253
|
+
*
|
254
|
+
* @param request The request from which the parameter should be removed.
|
255
|
+
* @param parameter An
|
256
|
+
* <code>IParameter</code> object containing details of the parameter to be
|
257
|
+
* removed. Supported parameter types are:
|
258
|
+
* <code>PARAM_URL</code>,
|
259
|
+
* <code>PARAM_BODY</code> and
|
260
|
+
* <code>PARAM_COOKIE</code>.
|
261
|
+
* @return A new HTTP request with the parameter removed.
|
262
|
+
*/
|
263
|
+
byte[] removeParameter(byte[] request, IParameter parameter);
|
264
|
+
|
265
|
+
/**
|
266
|
+
* This method updates the value of a parameter within an HTTP request, and
|
267
|
+
* if appropriate updates the Content-Length header. <b>Note:</b> This
|
268
|
+
* method can only be used to update the value of an existing parameter of a
|
269
|
+
* specified type. If you need to change the type of an existing parameter,
|
270
|
+
* you should first call
|
271
|
+
* <code>removeParameter()</code> to remove the parameter with the old type,
|
272
|
+
* and then call
|
273
|
+
* <code>addParameter()</code> to add a parameter with the new type.
|
274
|
+
*
|
275
|
+
* @param request The request containing the parameter to be updated.
|
276
|
+
* @param parameter An
|
277
|
+
* <code>IParameter</code> object containing details of the parameter to be
|
278
|
+
* updated. Supported parameter types are:
|
279
|
+
* <code>PARAM_URL</code>,
|
280
|
+
* <code>PARAM_BODY</code> and
|
281
|
+
* <code>PARAM_COOKIE</code>.
|
282
|
+
* @return A new HTTP request with the parameter updated.
|
283
|
+
*/
|
284
|
+
byte[] updateParameter(byte[] request, IParameter parameter);
|
285
|
+
|
286
|
+
/**
|
287
|
+
* This method can be used to toggle a request's method between GET and
|
288
|
+
* POST. Parameters are relocated between the URL query string and message
|
289
|
+
* body as required, and the Content-Length header is created or removed as
|
290
|
+
* applicable.
|
291
|
+
*
|
292
|
+
* @param request The HTTP request whose method should be toggled.
|
293
|
+
* @return A new HTTP request using the toggled method.
|
294
|
+
*/
|
295
|
+
byte[] toggleRequestMethod(byte[] request);
|
296
|
+
|
297
|
+
/**
|
298
|
+
* This method constructs an
|
299
|
+
* <code>IHttpService</code> object based on the details provided.
|
300
|
+
*
|
301
|
+
* @param host The HTTP service host.
|
302
|
+
* @param port The HTTP service port.
|
303
|
+
* @param protocol The HTTP service protocol.
|
304
|
+
* @return An
|
305
|
+
* <code>IHttpService</code> object based on the details provided.
|
306
|
+
*/
|
307
|
+
IHttpService buildHttpService(String host, int port, String protocol);
|
308
|
+
|
309
|
+
/**
|
310
|
+
* This method constructs an
|
311
|
+
* <code>IHttpService</code> object based on the details provided.
|
312
|
+
*
|
313
|
+
* @param host The HTTP service host.
|
314
|
+
* @param port The HTTP service port.
|
315
|
+
* @param useHttps Flags whether the HTTP service protocol is HTTPS or HTTP.
|
316
|
+
* @return An
|
317
|
+
* <code>IHttpService</code> object based on the details provided.
|
318
|
+
*/
|
319
|
+
IHttpService buildHttpService(String host, int port, boolean useHttps);
|
320
|
+
|
321
|
+
/**
|
322
|
+
* This method constructs an
|
323
|
+
* <code>IParameter</code> object based on the details provided.
|
324
|
+
*
|
325
|
+
* @param name The parameter name.
|
326
|
+
* @param value The parameter value.
|
327
|
+
* @param type The parameter type, as defined in the
|
328
|
+
* <code>IParameter</code> interface.
|
329
|
+
* @return An
|
330
|
+
* <code>IParameter</code> object based on the details provided.
|
331
|
+
*/
|
332
|
+
IParameter buildParameter(String name, String value, byte type);
|
333
|
+
|
334
|
+
/**
|
335
|
+
* This method constructs an
|
336
|
+
* <code>IScannerInsertionPoint</code> object based on the details provided.
|
337
|
+
* It can be used to quickly create a simple insertion point based on a
|
338
|
+
* fixed payload location within a base request.
|
339
|
+
*
|
340
|
+
* @param insertionPointName The name of the insertion point.
|
341
|
+
* @param baseRequest The request from which to build scan requests.
|
342
|
+
* @param from The offset of the start of the payload location.
|
343
|
+
* @param to The offset of the end of the payload location.
|
344
|
+
* @return An
|
345
|
+
* <code>IScannerInsertionPoint</code> object based on the details provided.
|
346
|
+
*/
|
347
|
+
IScannerInsertionPoint makeScannerInsertionPoint(
|
348
|
+
String insertionPointName,
|
349
|
+
byte[] baseRequest,
|
350
|
+
int from,
|
351
|
+
int to);
|
352
|
+
}
|