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,31 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)IBurpExtender.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
|
+
/**
|
13
|
+
* All extensions must implement this interface.
|
14
|
+
*
|
15
|
+
* Implementations must be called BurpExtender, in the package burp, must be
|
16
|
+
* declared public, and must provide a default (public, no-argument)
|
17
|
+
* constructor.
|
18
|
+
*/
|
19
|
+
public interface IBurpExtender
|
20
|
+
{
|
21
|
+
/**
|
22
|
+
* This method is invoked when the extension is loaded. It registers an
|
23
|
+
* instance of the
|
24
|
+
* <code>IBurpExtenderCallbacks</code> interface, providing methods that may
|
25
|
+
* be invoked by the extension to perform various actions.
|
26
|
+
*
|
27
|
+
* @param callbacks An
|
28
|
+
* <code>IBurpExtenderCallbacks</code> object.
|
29
|
+
*/
|
30
|
+
void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks);
|
31
|
+
}
|
@@ -0,0 +1,785 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)IBurpExtenderCallbacks.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.Component;
|
13
|
+
import java.io.OutputStream;
|
14
|
+
import java.util.List;
|
15
|
+
import java.util.Map;
|
16
|
+
|
17
|
+
/**
|
18
|
+
* This interface is used by Burp Suite to pass to extensions a set of callback
|
19
|
+
* methods that can be used by extensions to perform various actions within
|
20
|
+
* Burp.
|
21
|
+
*
|
22
|
+
* When an extension is loaded, Burp invokes its
|
23
|
+
* <code>registerExtenderCallbacks()</code> method and passes an instance of the
|
24
|
+
* <code>IBurpExtenderCallbacks</code> interface. The extension may then invoke
|
25
|
+
* the methods of this interface as required in order to extend Burp's
|
26
|
+
* functionality.
|
27
|
+
*/
|
28
|
+
public interface IBurpExtenderCallbacks
|
29
|
+
{
|
30
|
+
/**
|
31
|
+
* Flag used to identify Burp Suite as a whole.
|
32
|
+
*/
|
33
|
+
static final int TOOL_SUITE = 0x00000001;
|
34
|
+
/**
|
35
|
+
* Flag used to identify the Burp Target tool.
|
36
|
+
*/
|
37
|
+
static final int TOOL_TARGET = 0x00000002;
|
38
|
+
/**
|
39
|
+
* Flag used to identify the Burp Proxy tool.
|
40
|
+
*/
|
41
|
+
static final int TOOL_PROXY = 0x00000004;
|
42
|
+
/**
|
43
|
+
* Flag used to identify the Burp Spider tool.
|
44
|
+
*/
|
45
|
+
static final int TOOL_SPIDER = 0x00000008;
|
46
|
+
/**
|
47
|
+
* Flag used to identify the Burp Scanner tool.
|
48
|
+
*/
|
49
|
+
static final int TOOL_SCANNER = 0x00000010;
|
50
|
+
/**
|
51
|
+
* Flag used to identify the Burp Intruder tool.
|
52
|
+
*/
|
53
|
+
static final int TOOL_INTRUDER = 0x00000020;
|
54
|
+
/**
|
55
|
+
* Flag used to identify the Burp Repeater tool.
|
56
|
+
*/
|
57
|
+
static final int TOOL_REPEATER = 0x00000040;
|
58
|
+
/**
|
59
|
+
* Flag used to identify the Burp Sequencer tool.
|
60
|
+
*/
|
61
|
+
static final int TOOL_SEQUENCER = 0x00000080;
|
62
|
+
/**
|
63
|
+
* Flag used to identify the Burp Decoder tool.
|
64
|
+
*/
|
65
|
+
static final int TOOL_DECODER = 0x00000100;
|
66
|
+
/**
|
67
|
+
* Flag used to identify the Burp Comparer tool.
|
68
|
+
*/
|
69
|
+
static final int TOOL_COMPARER = 0x00000200;
|
70
|
+
/**
|
71
|
+
* Flag used to identify the Burp Extender tool.
|
72
|
+
*/
|
73
|
+
static final int TOOL_EXTENDER = 0x00000400;
|
74
|
+
|
75
|
+
/**
|
76
|
+
* This method is used to set the display name for the current extension,
|
77
|
+
* which will be displayed within the user interface for the Extender tool.
|
78
|
+
*
|
79
|
+
* @param name The extension name.
|
80
|
+
*/
|
81
|
+
void setExtensionName(String name);
|
82
|
+
|
83
|
+
/**
|
84
|
+
* This method is used to obtain an
|
85
|
+
* <code>IExtensionHelpers</code> object, which can be used by the extension
|
86
|
+
* to perform numerous useful tasks.
|
87
|
+
*
|
88
|
+
* @return An object containing numerous helper methods, for tasks such as
|
89
|
+
* building and analyzing HTTP requests.
|
90
|
+
*/
|
91
|
+
IExtensionHelpers getHelpers();
|
92
|
+
|
93
|
+
/**
|
94
|
+
* This method is used to obtain the current extension's standard output
|
95
|
+
* stream. Extensions should write all output to this stream, allowing the
|
96
|
+
* Burp user to configure how that output is handled from within the UI.
|
97
|
+
*
|
98
|
+
* @return The extension's standard output stream.
|
99
|
+
*/
|
100
|
+
OutputStream getStdout();
|
101
|
+
|
102
|
+
/**
|
103
|
+
* This method is used to obtain the current extension's standard error
|
104
|
+
* stream. Extensions should write all error messages to this stream,
|
105
|
+
* allowing the Burp user to configure how that output is handled from
|
106
|
+
* within the UI.
|
107
|
+
*
|
108
|
+
* @return The extension's standard error stream.
|
109
|
+
*/
|
110
|
+
OutputStream getStderr();
|
111
|
+
|
112
|
+
/**
|
113
|
+
* This method is used to register a listener which will be notified of
|
114
|
+
* changes to the extension's state. <b>Note:</b> Any extensions that start
|
115
|
+
* background threads or open system resources (such as files or database
|
116
|
+
* connections) should register a listener and terminate threads / close
|
117
|
+
* resources when the extension is unloaded.
|
118
|
+
*
|
119
|
+
* @param listener An object created by the extension that implements the
|
120
|
+
* <code>IExtensionStateListener</code> interface.
|
121
|
+
*/
|
122
|
+
void registerExtensionStateListener(IExtensionStateListener listener);
|
123
|
+
|
124
|
+
/**
|
125
|
+
* This method is used to register a listener which will be notified of
|
126
|
+
* requests and responses made by any Burp tool. Extensions can perform
|
127
|
+
* custom analysis or modification of these messages by registering an HTTP
|
128
|
+
* listener.
|
129
|
+
*
|
130
|
+
* @param listener An object created by the extension that implements the
|
131
|
+
* <code>IHttpListener</code> interface.
|
132
|
+
*/
|
133
|
+
void registerHttpListener(IHttpListener listener);
|
134
|
+
|
135
|
+
/**
|
136
|
+
* This method is used to register a listener which will be notified of
|
137
|
+
* requests and responses being processed by the Proxy tool. Extensions can
|
138
|
+
* perform custom analysis or modification of these messages, and control
|
139
|
+
* in-UI message interception, by registering a proxy listener.
|
140
|
+
*
|
141
|
+
* @param listener An object created by the extension that implements the
|
142
|
+
* <code>IProxyListener</code> interface.
|
143
|
+
*/
|
144
|
+
void registerProxyListener(IProxyListener listener);
|
145
|
+
|
146
|
+
/**
|
147
|
+
* This method is used to register a listener which will be notified of new
|
148
|
+
* issues that are reported by the Scanner tool. Extensions can perform
|
149
|
+
* custom analysis or logging of Scanner issues by registering a Scanner
|
150
|
+
* listener.
|
151
|
+
*
|
152
|
+
* @param listener An object created by the extension that implements the
|
153
|
+
* <code>IScannerListener</code> interface.
|
154
|
+
*/
|
155
|
+
void registerScannerListener(IScannerListener listener);
|
156
|
+
|
157
|
+
/**
|
158
|
+
* This method is used to register a listener which will be notified of
|
159
|
+
* changes to Burp's suite-wide target scope.
|
160
|
+
*
|
161
|
+
* @param listener An object created by the extension that implements the
|
162
|
+
* <code>IScopeChangeListener</code> interface.
|
163
|
+
*/
|
164
|
+
void registerScopeChangeListener(IScopeChangeListener listener);
|
165
|
+
|
166
|
+
/**
|
167
|
+
* This method is used to register a factory for custom context menu items.
|
168
|
+
* When the user invokes a context menu anywhere within Burp, the factory
|
169
|
+
* will be passed details of the invocation event, and asked to provide any
|
170
|
+
* custom context menu items that should be shown.
|
171
|
+
*
|
172
|
+
* @param factory An object created by the extension that implements the
|
173
|
+
* <code>IContextMenuFactory</code> interface.
|
174
|
+
*/
|
175
|
+
void registerContextMenuFactory(IContextMenuFactory factory);
|
176
|
+
|
177
|
+
/**
|
178
|
+
* This method is used to register a factory for custom message editor tabs.
|
179
|
+
* For each message editor that already exists, or is subsequently created,
|
180
|
+
* within Burp, the factory will be asked to provide a new instance of an
|
181
|
+
* <code>IMessageEditorTab</code> object, which can provide custom rendering
|
182
|
+
* or editing of HTTP messages.
|
183
|
+
*
|
184
|
+
* @param factory An object created by the extension that implements the
|
185
|
+
* <code>IMessageEditorTabFactory</code> interface.
|
186
|
+
*/
|
187
|
+
void registerMessageEditorTabFactory(IMessageEditorTabFactory factory);
|
188
|
+
|
189
|
+
/**
|
190
|
+
* This method is used to register a provider of Scanner insertion points.
|
191
|
+
* For each base request that is actively scanned, Burp will ask the
|
192
|
+
* provider to provide any custom scanner insertion points that are
|
193
|
+
* appropriate for the request.
|
194
|
+
*
|
195
|
+
* @param provider An object created by the extension that implements the
|
196
|
+
* <code>IScannerInsertionPointProvider</code> interface.
|
197
|
+
*/
|
198
|
+
void registerScannerInsertionPointProvider(
|
199
|
+
IScannerInsertionPointProvider provider);
|
200
|
+
|
201
|
+
/**
|
202
|
+
* This method is used to register a custom Scanner check. When performing
|
203
|
+
* scanning, Burp will ask the check to perform active or passive scanning
|
204
|
+
* on the base request, and report any Scanner issues that are identified.
|
205
|
+
*
|
206
|
+
* @param check An object created by the extension that implements the
|
207
|
+
* <code>IScannerCheck</code> interface.
|
208
|
+
*/
|
209
|
+
void registerScannerCheck(IScannerCheck check);
|
210
|
+
|
211
|
+
/**
|
212
|
+
* This method is used to register a factory for Intruder payloads. Each
|
213
|
+
* registered factory will be available within the Intruder UI for the user
|
214
|
+
* to select as the payload source for an attack. When this is selected, the
|
215
|
+
* factory will be asked to provide a new instance of an
|
216
|
+
* <code>IIntruderPayloadGenerator</code> object, which will be used to
|
217
|
+
* generate payloads for the attack.
|
218
|
+
*
|
219
|
+
* @param factory An object created by the extension that implements the
|
220
|
+
* <code>IIntruderPayloadGeneratorFactory</code> interface.
|
221
|
+
*/
|
222
|
+
void registerIntruderPayloadGeneratorFactory(
|
223
|
+
IIntruderPayloadGeneratorFactory factory);
|
224
|
+
|
225
|
+
/**
|
226
|
+
* This method is used to register a custom Intruder payload processor. Each
|
227
|
+
* registered processor will be available within the Intruder UI for the
|
228
|
+
* user to select as the action for a payload processing rule.
|
229
|
+
*
|
230
|
+
* @param processor An object created by the extension that implements the
|
231
|
+
* <code>IIntruderPayloadProcessor</code> interface.
|
232
|
+
*/
|
233
|
+
void registerIntruderPayloadProcessor(IIntruderPayloadProcessor processor);
|
234
|
+
|
235
|
+
/**
|
236
|
+
* This method is used to register a custom session handling action. Each
|
237
|
+
* registered action will be available within the session handling rule UI
|
238
|
+
* for the user to select as a rule action. Users can choose to invoke an
|
239
|
+
* action directly in its own right, or following execution of a macro.
|
240
|
+
*
|
241
|
+
* @param action An object created by the extension that implements the
|
242
|
+
* <code>ISessionHandlingAction</code> interface.
|
243
|
+
*/
|
244
|
+
void registerSessionHandlingAction(ISessionHandlingAction action);
|
245
|
+
|
246
|
+
/**
|
247
|
+
* This method is used to unload the extension from Burp Suite.
|
248
|
+
*/
|
249
|
+
void unloadExtension();
|
250
|
+
|
251
|
+
/**
|
252
|
+
* This method is used to add a custom tab to the main Burp Suite window.
|
253
|
+
*
|
254
|
+
* @param tab An object created by the extension that implements the
|
255
|
+
* <code>ITab</code> interface.
|
256
|
+
*/
|
257
|
+
void addSuiteTab(ITab tab);
|
258
|
+
|
259
|
+
/**
|
260
|
+
* This method is used to remove a previously-added tab from the main Burp
|
261
|
+
* Suite window.
|
262
|
+
*
|
263
|
+
* @param tab An object created by the extension that implements the
|
264
|
+
* <code>ITab</code> interface.
|
265
|
+
*/
|
266
|
+
void removeSuiteTab(ITab tab);
|
267
|
+
|
268
|
+
/**
|
269
|
+
* This method is used to customize UI components in line with Burp's UI
|
270
|
+
* style, including font size, colors, table line spacing, etc.
|
271
|
+
*
|
272
|
+
* @param component The UI component to be customized.
|
273
|
+
*/
|
274
|
+
void customizeUiComponent(Component component);
|
275
|
+
|
276
|
+
/**
|
277
|
+
* This method is used to create a new instance of Burp's HTTP message
|
278
|
+
* editor, for the extension to use in its own UI.
|
279
|
+
*
|
280
|
+
* @param controller An object created by the extension that implements the
|
281
|
+
* <code>IMessageEditorController</code> interface. This parameter is
|
282
|
+
* optional and may be <code>null</code>. If it is provided, then the
|
283
|
+
* message editor will query the controller when required to obtain details
|
284
|
+
* about the currently displayed message, including the
|
285
|
+
* <code>IHttpService</code> for the message, and the associated request or
|
286
|
+
* response message. If a controller is not provided, then the message
|
287
|
+
* editor will not support context menu actions, such as sending requests to
|
288
|
+
* other Burp tools.
|
289
|
+
* @param editable Indicates whether the editor created should be editable,
|
290
|
+
* or used only for message viewing.
|
291
|
+
* @return An object that implements the <code>IMessageEditor</code>
|
292
|
+
* interface, and which the extension can use in its own UI.
|
293
|
+
*/
|
294
|
+
IMessageEditor createMessageEditor(IMessageEditorController controller,
|
295
|
+
boolean editable);
|
296
|
+
|
297
|
+
/**
|
298
|
+
* This method returns the command line arguments that were passed to Burp
|
299
|
+
* on startup.
|
300
|
+
*
|
301
|
+
* @return The command line arguments that were passed to Burp on startup.
|
302
|
+
*/
|
303
|
+
String[] getCommandLineArguments();
|
304
|
+
|
305
|
+
/**
|
306
|
+
* This method is used to save configuration settings for the extension in a
|
307
|
+
* persistent way that survives reloads of the extension and of Burp Suite.
|
308
|
+
* Saved settings can be retrieved using the method
|
309
|
+
* <code>loadExtensionSetting()</code>.
|
310
|
+
*
|
311
|
+
* @param name The name of the setting.
|
312
|
+
* @param value The value of the setting. If this value is <code>null</code>
|
313
|
+
* then any existing setting with the specified name will be removed.
|
314
|
+
*/
|
315
|
+
void saveExtensionSetting(String name, String value);
|
316
|
+
|
317
|
+
/**
|
318
|
+
* This method is used to load configuration settings for the extension that
|
319
|
+
* were saved using the method
|
320
|
+
* <code>saveExtensionSetting()</code>.
|
321
|
+
*
|
322
|
+
* @param name The name of the setting.
|
323
|
+
* @return The value of the setting, or <code>null</code> if no value is
|
324
|
+
* set.
|
325
|
+
*/
|
326
|
+
String loadExtensionSetting(String name);
|
327
|
+
|
328
|
+
/**
|
329
|
+
* This method is used to create a new instance of Burp's plain text editor,
|
330
|
+
* for the extension to use in its own UI.
|
331
|
+
*
|
332
|
+
* @return An object that implements the <code>ITextEditor</code> interface,
|
333
|
+
* and which the extension can use in its own UI.
|
334
|
+
*/
|
335
|
+
ITextEditor createTextEditor();
|
336
|
+
|
337
|
+
/**
|
338
|
+
* This method can be used to send an HTTP request to the Burp Repeater
|
339
|
+
* tool. The request will be displayed in the user interface, but will not
|
340
|
+
* be issued until the user initiates this action.
|
341
|
+
*
|
342
|
+
* @param host The hostname of the remote HTTP server.
|
343
|
+
* @param port The port of the remote HTTP server.
|
344
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
345
|
+
* @param request The full HTTP request.
|
346
|
+
* @param tabCaption An optional caption which will appear on the Repeater
|
347
|
+
* tab containing the request. If this value is <code>null</code> then a
|
348
|
+
* default tab index will be displayed.
|
349
|
+
*/
|
350
|
+
void sendToRepeater(
|
351
|
+
String host,
|
352
|
+
int port,
|
353
|
+
boolean useHttps,
|
354
|
+
byte[] request,
|
355
|
+
String tabCaption);
|
356
|
+
|
357
|
+
/**
|
358
|
+
* This method can be used to send an HTTP request to the Burp Intruder
|
359
|
+
* tool. The request will be displayed in the user interface, and markers
|
360
|
+
* for attack payloads will be placed into default locations within the
|
361
|
+
* request.
|
362
|
+
*
|
363
|
+
* @param host The hostname of the remote HTTP server.
|
364
|
+
* @param port The port of the remote HTTP server.
|
365
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
366
|
+
* @param request The full HTTP request.
|
367
|
+
*/
|
368
|
+
void sendToIntruder(
|
369
|
+
String host,
|
370
|
+
int port,
|
371
|
+
boolean useHttps,
|
372
|
+
byte[] request);
|
373
|
+
|
374
|
+
/**
|
375
|
+
* This method can be used to send an HTTP request to the Burp Intruder
|
376
|
+
* tool. The request will be displayed in the user interface, and markers
|
377
|
+
* for attack payloads will be placed into the specified locations within
|
378
|
+
* the request.
|
379
|
+
*
|
380
|
+
* @param host The hostname of the remote HTTP server.
|
381
|
+
* @param port The port of the remote HTTP server.
|
382
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
383
|
+
* @param request The full HTTP request.
|
384
|
+
* @param payloadPositionOffsets A list of index pairs representing the
|
385
|
+
* payload positions to be used. Each item in the list must be an int[2]
|
386
|
+
* array containing the start and end offsets for the payload position.
|
387
|
+
*/
|
388
|
+
void sendToIntruder(
|
389
|
+
String host,
|
390
|
+
int port,
|
391
|
+
boolean useHttps,
|
392
|
+
byte[] request,
|
393
|
+
List<int[]> payloadPositionOffsets);
|
394
|
+
|
395
|
+
/**
|
396
|
+
* This method can be used to send a seed URL to the Burp Spider tool. If
|
397
|
+
* the URL is not within the current Spider scope, the user will be asked if
|
398
|
+
* they wish to add the URL to the scope. If the Spider is not currently
|
399
|
+
* running, it will be started. The seed URL will be requested, and the
|
400
|
+
* Spider will process the application's response in the normal way.
|
401
|
+
*
|
402
|
+
* @param url The new seed URL to begin spidering from.
|
403
|
+
*/
|
404
|
+
void sendToSpider(
|
405
|
+
java.net.URL url);
|
406
|
+
|
407
|
+
/**
|
408
|
+
* This method can be used to send an HTTP request to the Burp Scanner tool
|
409
|
+
* to perform an active vulnerability scan. If the request is not within the
|
410
|
+
* current active scanning scope, the user will be asked if they wish to
|
411
|
+
* proceed with the scan.
|
412
|
+
*
|
413
|
+
* @param host The hostname of the remote HTTP server.
|
414
|
+
* @param port The port of the remote HTTP server.
|
415
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
416
|
+
* @param request The full HTTP request.
|
417
|
+
* @return The resulting scan queue item.
|
418
|
+
*/
|
419
|
+
IScanQueueItem doActiveScan(
|
420
|
+
String host,
|
421
|
+
int port,
|
422
|
+
boolean useHttps,
|
423
|
+
byte[] request);
|
424
|
+
|
425
|
+
/**
|
426
|
+
* This method can be used to send an HTTP request to the Burp Scanner tool
|
427
|
+
* to perform an active vulnerability scan, based on a custom list of
|
428
|
+
* insertion points that are to be scanned. If the request is not within the
|
429
|
+
* current active scanning scope, the user will be asked if they wish to
|
430
|
+
* proceed with the scan.
|
431
|
+
*
|
432
|
+
* @param host The hostname of the remote HTTP server.
|
433
|
+
* @param port The port of the remote HTTP server.
|
434
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
435
|
+
* @param request The full HTTP request.
|
436
|
+
* @param insertionPointOffsets A list of index pairs representing the
|
437
|
+
* positions of the insertion points that should be scanned. Each item in
|
438
|
+
* the list must be an int[2] array containing the start and end offsets for
|
439
|
+
* the insertion point.
|
440
|
+
* @return The resulting scan queue item.
|
441
|
+
*/
|
442
|
+
IScanQueueItem doActiveScan(
|
443
|
+
String host,
|
444
|
+
int port,
|
445
|
+
boolean useHttps,
|
446
|
+
byte[] request,
|
447
|
+
List<int[]> insertionPointOffsets);
|
448
|
+
|
449
|
+
/**
|
450
|
+
* This method can be used to send an HTTP request to the Burp Scanner tool
|
451
|
+
* to perform a passive vulnerability scan.
|
452
|
+
*
|
453
|
+
* @param host The hostname of the remote HTTP server.
|
454
|
+
* @param port The port of the remote HTTP server.
|
455
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
456
|
+
* @param request The full HTTP request.
|
457
|
+
* @param response The full HTTP response.
|
458
|
+
*/
|
459
|
+
void doPassiveScan(
|
460
|
+
String host,
|
461
|
+
int port,
|
462
|
+
boolean useHttps,
|
463
|
+
byte[] request,
|
464
|
+
byte[] response);
|
465
|
+
|
466
|
+
/**
|
467
|
+
* This method can be used to issue HTTP requests and retrieve their
|
468
|
+
* responses.
|
469
|
+
*
|
470
|
+
* @param httpService The HTTP service to which the request should be sent.
|
471
|
+
* @param request The full HTTP request.
|
472
|
+
* @return An object that implements the <code>IHttpRequestResponse</code>
|
473
|
+
* interface, and which the extension can query to obtain the details of the
|
474
|
+
* response.
|
475
|
+
*/
|
476
|
+
IHttpRequestResponse makeHttpRequest(IHttpService httpService,
|
477
|
+
byte[] request);
|
478
|
+
|
479
|
+
/**
|
480
|
+
* This method can be used to issue HTTP requests and retrieve their
|
481
|
+
* responses.
|
482
|
+
*
|
483
|
+
* @param host The hostname of the remote HTTP server.
|
484
|
+
* @param port The port of the remote HTTP server.
|
485
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
486
|
+
* @param request The full HTTP request.
|
487
|
+
* @return The full response retrieved from the remote server.
|
488
|
+
*/
|
489
|
+
byte[] makeHttpRequest(
|
490
|
+
String host,
|
491
|
+
int port,
|
492
|
+
boolean useHttps,
|
493
|
+
byte[] request);
|
494
|
+
|
495
|
+
/**
|
496
|
+
* This method can be used to query whether a specified URL is within the
|
497
|
+
* current Suite-wide scope.
|
498
|
+
*
|
499
|
+
* @param url The URL to query.
|
500
|
+
* @return Returns <code>true</code> if the URL is within the current
|
501
|
+
* Suite-wide scope.
|
502
|
+
*/
|
503
|
+
boolean isInScope(java.net.URL url);
|
504
|
+
|
505
|
+
/**
|
506
|
+
* This method can be used to include the specified URL in the Suite-wide
|
507
|
+
* scope.
|
508
|
+
*
|
509
|
+
* @param url The URL to include in the Suite-wide scope.
|
510
|
+
*/
|
511
|
+
void includeInScope(java.net.URL url);
|
512
|
+
|
513
|
+
/**
|
514
|
+
* This method can be used to exclude the specified URL from the Suite-wide
|
515
|
+
* scope.
|
516
|
+
*
|
517
|
+
* @param url The URL to exclude from the Suite-wide scope.
|
518
|
+
*/
|
519
|
+
void excludeFromScope(java.net.URL url);
|
520
|
+
|
521
|
+
/**
|
522
|
+
* This method can be used to display a specified message in the Burp Suite
|
523
|
+
* alerts tab.
|
524
|
+
*
|
525
|
+
* @param message The alert message to display.
|
526
|
+
*/
|
527
|
+
void issueAlert(String message);
|
528
|
+
|
529
|
+
/**
|
530
|
+
* This method returns details of all items in the Proxy history.
|
531
|
+
*
|
532
|
+
* @return The contents of the Proxy history.
|
533
|
+
*/
|
534
|
+
IHttpRequestResponse[] getProxyHistory();
|
535
|
+
|
536
|
+
/**
|
537
|
+
* This method returns details of items in the site map.
|
538
|
+
*
|
539
|
+
* @param urlPrefix This parameter can be used to specify a URL prefix, in
|
540
|
+
* order to extract a specific subset of the site map. The method performs a
|
541
|
+
* simple case-sensitive text match, returning all site map items whose URL
|
542
|
+
* begins with the specified prefix. If this parameter is null, the entire
|
543
|
+
* site map is returned.
|
544
|
+
*
|
545
|
+
* @return Details of items in the site map.
|
546
|
+
*/
|
547
|
+
IHttpRequestResponse[] getSiteMap(String urlPrefix);
|
548
|
+
|
549
|
+
/**
|
550
|
+
* This method returns all of the current scan issues for URLs matching the
|
551
|
+
* specified literal prefix.
|
552
|
+
*
|
553
|
+
* @param urlPrefix This parameter can be used to specify a URL prefix, in
|
554
|
+
* order to extract a specific subset of scan issues. The method performs a
|
555
|
+
* simple case-sensitive text match, returning all scan issues whose URL
|
556
|
+
* begins with the specified prefix. If this parameter is null, all issues
|
557
|
+
* are returned.
|
558
|
+
* @return Details of the scan issues.
|
559
|
+
*/
|
560
|
+
IScanIssue[] getScanIssues(String urlPrefix);
|
561
|
+
|
562
|
+
/**
|
563
|
+
* This method is used to retrieve the contents of Burp's session handling
|
564
|
+
* cookie jar. Extensions that provide an
|
565
|
+
* <code>ISessionHandlingAction</code> can query and update the cookie jar
|
566
|
+
* in order to handle unusual session handling mechanisms.
|
567
|
+
*
|
568
|
+
* @return A list of <code>ICookie</code> objects representing the contents
|
569
|
+
* of Burp's session handling cookie jar.
|
570
|
+
*/
|
571
|
+
List<ICookie> getCookieJarContents();
|
572
|
+
|
573
|
+
/**
|
574
|
+
* This method is used to update the contents of Burp's session handling
|
575
|
+
* cookie jar. Extensions that provide an
|
576
|
+
* <code>ISessionHandlingAction</code> can query and update the cookie jar
|
577
|
+
* in order to handle unusual session handling mechanisms.
|
578
|
+
*
|
579
|
+
* @param cookie An <code>ICookie</code> object containing details of the
|
580
|
+
* cookie to be updated. If the cookie jar already contains a cookie that
|
581
|
+
* matches the specified domain and name, then that cookie will be updated
|
582
|
+
* with the new value and expiration, unless the new value is
|
583
|
+
* <code>null</code>, in which case the cookie will be removed. If the
|
584
|
+
* cookie jar does not already contain a cookie that matches the specified
|
585
|
+
* domain and name, then the cookie will be added.
|
586
|
+
*/
|
587
|
+
void updateCookieJar(ICookie cookie);
|
588
|
+
|
589
|
+
/**
|
590
|
+
* This method can be used to add an item to Burp's site map with the
|
591
|
+
* specified request/response details. This will overwrite the details of
|
592
|
+
* any existing matching item in the site map.
|
593
|
+
*
|
594
|
+
* @param item Details of the item to be added to the site map
|
595
|
+
*/
|
596
|
+
void addToSiteMap(IHttpRequestResponse item);
|
597
|
+
|
598
|
+
/**
|
599
|
+
* This method can be used to restore Burp's state from a specified saved
|
600
|
+
* state file. This method blocks until the restore operation is completed,
|
601
|
+
* and must not be called from the event dispatch thread.
|
602
|
+
*
|
603
|
+
* @param file The file containing Burp's saved state.
|
604
|
+
*/
|
605
|
+
void restoreState(java.io.File file);
|
606
|
+
|
607
|
+
/**
|
608
|
+
* This method can be used to save Burp's state to a specified file. This
|
609
|
+
* method blocks until the save operation is completed, and must not be
|
610
|
+
* called from the event dispatch thread.
|
611
|
+
*
|
612
|
+
* @param file The file to save Burp's state in.
|
613
|
+
*/
|
614
|
+
void saveState(java.io.File file);
|
615
|
+
|
616
|
+
/**
|
617
|
+
* This method causes Burp to save all of its current configuration as a Map
|
618
|
+
* of name/value Strings.
|
619
|
+
*
|
620
|
+
* @return A Map of name/value Strings reflecting Burp's current
|
621
|
+
* configuration.
|
622
|
+
*/
|
623
|
+
Map<String, String> saveConfig();
|
624
|
+
|
625
|
+
/**
|
626
|
+
* This method causes Burp to load a new configuration from the Map of
|
627
|
+
* name/value Strings provided. Any settings not specified in the Map will
|
628
|
+
* be restored to their default values. To selectively update only some
|
629
|
+
* settings and leave the rest unchanged, you should first call
|
630
|
+
* <code>saveConfig()</code> to obtain Burp's current configuration, modify
|
631
|
+
* the relevant items in the Map, and then call
|
632
|
+
* <code>loadConfig()</code> with the same Map.
|
633
|
+
*
|
634
|
+
* @param config A map of name/value Strings to use as Burp's new
|
635
|
+
* configuration.
|
636
|
+
*/
|
637
|
+
void loadConfig(Map<String, String> config);
|
638
|
+
|
639
|
+
/**
|
640
|
+
* This method sets the master interception mode for Burp Proxy.
|
641
|
+
*
|
642
|
+
* @param enabled Indicates whether interception of Proxy messages should be
|
643
|
+
* enabled.
|
644
|
+
*/
|
645
|
+
void setProxyInterceptionEnabled(boolean enabled);
|
646
|
+
|
647
|
+
/**
|
648
|
+
* This method retrieves information about the version of Burp in which the
|
649
|
+
* extension is running. It can be used by extensions to dynamically adjust
|
650
|
+
* their behavior depending on the functionality and APIs supported by the
|
651
|
+
* current version.
|
652
|
+
*
|
653
|
+
* @return An array of Strings comprised of: the product name (e.g. Burp
|
654
|
+
* Suite Professional), the major version (e.g. 1.5), the minor version
|
655
|
+
* (e.g. 03)
|
656
|
+
*/
|
657
|
+
String[] getBurpVersion();
|
658
|
+
|
659
|
+
/**
|
660
|
+
* This method can be used to shut down Burp programmatically, with an
|
661
|
+
* optional prompt to the user. If the method returns, the user canceled the
|
662
|
+
* shutdown prompt.
|
663
|
+
*
|
664
|
+
* @param promptUser Indicates whether to prompt the user to confirm the
|
665
|
+
* shutdown.
|
666
|
+
*/
|
667
|
+
void exitSuite(boolean promptUser);
|
668
|
+
|
669
|
+
/**
|
670
|
+
* This method is used to create a temporary file on disk containing the
|
671
|
+
* provided data. Extensions can use temporary files for long-term storage
|
672
|
+
* of runtime data, avoiding the need to retain that data in memory.
|
673
|
+
*
|
674
|
+
* @param buffer The data to be saved to a temporary file.
|
675
|
+
* @return An object that implements the <code>ITempFile</code> interface.
|
676
|
+
*/
|
677
|
+
ITempFile saveToTempFile(byte[] buffer);
|
678
|
+
|
679
|
+
/**
|
680
|
+
* This method is used to save the request and response of an
|
681
|
+
* <code>IHttpRequestResponse</code> object to temporary files, so that they
|
682
|
+
* are no longer held in memory. Extensions can used this method to convert
|
683
|
+
* <code>IHttpRequestResponse</code> objects into a form suitable for
|
684
|
+
* long-term storage.
|
685
|
+
*
|
686
|
+
* @param httpRequestResponse The <code>IHttpRequestResponse</code> object
|
687
|
+
* whose request and response messages are to be saved to temporary files.
|
688
|
+
* @return An object that implements the
|
689
|
+
* <code>IHttpRequestResponsePersisted</code> interface.
|
690
|
+
*/
|
691
|
+
IHttpRequestResponsePersisted saveBuffersToTempFiles(
|
692
|
+
IHttpRequestResponse httpRequestResponse);
|
693
|
+
|
694
|
+
/**
|
695
|
+
* This method is used to apply markers to an HTTP request or response, at
|
696
|
+
* offsets into the message that are relevant for some particular purpose.
|
697
|
+
* Markers are used in various situations, such as specifying Intruder
|
698
|
+
* payload positions, Scanner insertion points, and highlights in Scanner
|
699
|
+
* issues.
|
700
|
+
*
|
701
|
+
* @param httpRequestResponse The <code>IHttpRequestResponse</code> object
|
702
|
+
* to which the markers should be applied.
|
703
|
+
* @param requestMarkers A list of index pairs representing the offsets of
|
704
|
+
* markers to be applied to the request message. Each item in the list must
|
705
|
+
* be an int[2] array containing the start and end offsets for the marker.
|
706
|
+
* This parameter is optional and may be <code>null</code> if no request
|
707
|
+
* markers are required.
|
708
|
+
* @param responseMarkers A list of index pairs representing the offsets of
|
709
|
+
* markers to be applied to the response message. Each item in the list must
|
710
|
+
* be an int[2] array containing the start and end offsets for the marker.
|
711
|
+
* This parameter is optional and may be <code>null</code> if no response
|
712
|
+
* markers are required.
|
713
|
+
* @return An object that implements the
|
714
|
+
* <code>IHttpRequestResponseWithMarkers</code> interface.
|
715
|
+
*/
|
716
|
+
IHttpRequestResponseWithMarkers applyMarkers(
|
717
|
+
IHttpRequestResponse httpRequestResponse,
|
718
|
+
List<int[]> requestMarkers,
|
719
|
+
List<int[]> responseMarkers);
|
720
|
+
|
721
|
+
/**
|
722
|
+
* This method is used to obtain the descriptive name for the Burp tool
|
723
|
+
* identified by the tool flag provided.
|
724
|
+
*
|
725
|
+
* @param toolFlag A flag identifying a Burp tool ( <code>TOOL_PROXY</code>,
|
726
|
+
* <code>TOOL_SCANNER</code>, etc.). Tool flags are defined within this
|
727
|
+
* interface.
|
728
|
+
* @return The descriptive name for the specified tool.
|
729
|
+
*/
|
730
|
+
String getToolName(int toolFlag);
|
731
|
+
|
732
|
+
/**
|
733
|
+
* This method is used to register a new Scanner issue. <b>Note:</b>
|
734
|
+
* Wherever possible, extensions should implement custom Scanner checks
|
735
|
+
* using
|
736
|
+
* <code>IScannerCheck</code> and report issues via those checks, so as to
|
737
|
+
* integrate with Burp's user-driven workflow, and ensure proper
|
738
|
+
* consolidation of duplicate reported issues. This method is only designed
|
739
|
+
* for tasks outside of the normal testing workflow, such as importing
|
740
|
+
* results from other scanning tools.
|
741
|
+
*
|
742
|
+
* @param issue An object created by the extension that implements the
|
743
|
+
* <code>IScanIssue</code> interface.
|
744
|
+
*/
|
745
|
+
void addScanIssue(IScanIssue issue);
|
746
|
+
|
747
|
+
/**
|
748
|
+
* This method parses the specified request and returns details of each
|
749
|
+
* request parameter.
|
750
|
+
*
|
751
|
+
* @param request The request to be parsed.
|
752
|
+
* @return An array of: <code>String[] { name, value, type }</code>
|
753
|
+
* containing details of the parameters contained within the request.
|
754
|
+
* @deprecated Use <code>IExtensionHelpers.analyzeRequest()</code> instead.
|
755
|
+
*/
|
756
|
+
@Deprecated
|
757
|
+
String[][] getParameters(byte[] request);
|
758
|
+
|
759
|
+
/**
|
760
|
+
* This method parses the specified request and returns details of each HTTP
|
761
|
+
* header.
|
762
|
+
*
|
763
|
+
* @param message The request to be parsed.
|
764
|
+
* @return An array of HTTP headers.
|
765
|
+
* @deprecated Use <code>IExtensionHelpers.analyzeRequest()</code> or
|
766
|
+
* <code>IExtensionHelpers.analyzeResponse()</code> instead.
|
767
|
+
*/
|
768
|
+
@Deprecated
|
769
|
+
String[] getHeaders(byte[] message);
|
770
|
+
|
771
|
+
/**
|
772
|
+
* This method can be used to register a new menu item which will appear on
|
773
|
+
* the various context menus that are used throughout Burp Suite to handle
|
774
|
+
* user-driven actions.
|
775
|
+
*
|
776
|
+
* @param menuItemCaption The caption to be displayed on the menu item.
|
777
|
+
* @param menuItemHandler The handler to be invoked when the user clicks on
|
778
|
+
* the menu item.
|
779
|
+
* @deprecated Use <code>registerContextMenuFactory()</code> instead.
|
780
|
+
*/
|
781
|
+
@Deprecated
|
782
|
+
void registerMenuItem(
|
783
|
+
String menuItemCaption,
|
784
|
+
IMenuItemHandler menuItemHandler);
|
785
|
+
}
|