Skip to content

Commit 248f05e

Browse files
committed
Added manual testing mode
1 parent 71af016 commit 248f05e

8 files changed

Lines changed: 730 additions & 50 deletions

src/burp/BurpExtender.java

Lines changed: 416 additions & 6 deletions
Large diffs are not rendered by default.

src/burp/IBurpExtenderCallbacks.java

Lines changed: 252 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ public interface IBurpExtenderCallbacks
109109
*/
110110
OutputStream getStderr();
111111

112+
/**
113+
* This method prints a line of output to the current extension's standard
114+
* output stream.
115+
*
116+
* @param output The message to print.
117+
*/
118+
void printOutput(String output);
119+
120+
/**
121+
* This method prints a line of output to the current extension's standard
122+
* error stream.
123+
*
124+
* @param error The message to print.
125+
*/
126+
void printError(String error);
127+
112128
/**
113129
* This method is used to register a listener which will be notified of
114130
* changes to the extension's state. <b>Note:</b> Any extensions that start
@@ -121,6 +137,23 @@ public interface IBurpExtenderCallbacks
121137
*/
122138
void registerExtensionStateListener(IExtensionStateListener listener);
123139

140+
/**
141+
* This method is used to retrieve the extension state listeners that are
142+
* registered by the extension.
143+
*
144+
* @return A list of extension state listeners that are currently registered
145+
* by this extension.
146+
*/
147+
List<IExtensionStateListener> getExtensionStateListeners();
148+
149+
/**
150+
* This method is used to remove an extension state listener that has been
151+
* registered by the extension.
152+
*
153+
* @param listener The extension state listener to be removed.
154+
*/
155+
void removeExtensionStateListener(IExtensionStateListener listener);
156+
124157
/**
125158
* This method is used to register a listener which will be notified of
126159
* requests and responses made by any Burp tool. Extensions can perform
@@ -132,6 +165,23 @@ public interface IBurpExtenderCallbacks
132165
*/
133166
void registerHttpListener(IHttpListener listener);
134167

168+
/**
169+
* This method is used to retrieve the HTTP listeners that are registered by
170+
* the extension.
171+
*
172+
* @return A list of HTTP listeners that are currently registered by this
173+
* extension.
174+
*/
175+
List<IHttpListener> getHttpListeners();
176+
177+
/**
178+
* This method is used to remove an HTTP listener that has been registered
179+
* by the extension.
180+
*
181+
* @param listener The HTTP listener to be removed.
182+
*/
183+
void removeHttpListener(IHttpListener listener);
184+
135185
/**
136186
* This method is used to register a listener which will be notified of
137187
* requests and responses being processed by the Proxy tool. Extensions can
@@ -143,6 +193,23 @@ public interface IBurpExtenderCallbacks
143193
*/
144194
void registerProxyListener(IProxyListener listener);
145195

196+
/**
197+
* This method is used to retrieve the Proxy listeners that are registered
198+
* by the extension.
199+
*
200+
* @return A list of Proxy listeners that are currently registered by this
201+
* extension.
202+
*/
203+
List<IProxyListener> getProxyListeners();
204+
205+
/**
206+
* This method is used to remove a Proxy listener that has been registered
207+
* by the extension.
208+
*
209+
* @param listener The Proxy listener to be removed.
210+
*/
211+
void removeProxyListener(IProxyListener listener);
212+
146213
/**
147214
* This method is used to register a listener which will be notified of new
148215
* issues that are reported by the Scanner tool. Extensions can perform
@@ -154,6 +221,23 @@ public interface IBurpExtenderCallbacks
154221
*/
155222
void registerScannerListener(IScannerListener listener);
156223

224+
/**
225+
* This method is used to retrieve the Scanner listeners that are registered
226+
* by the extension.
227+
*
228+
* @return A list of Scanner listeners that are currently registered by this
229+
* extension.
230+
*/
231+
List<IScannerListener> getScannerListeners();
232+
233+
/**
234+
* This method is used to remove a Scanner listener that has been registered
235+
* by the extension.
236+
*
237+
* @param listener The Scanner listener to be removed.
238+
*/
239+
void removeScannerListener(IScannerListener listener);
240+
157241
/**
158242
* This method is used to register a listener which will be notified of
159243
* changes to Burp's suite-wide target scope.
@@ -163,6 +247,23 @@ public interface IBurpExtenderCallbacks
163247
*/
164248
void registerScopeChangeListener(IScopeChangeListener listener);
165249

250+
/**
251+
* This method is used to retrieve the scope change listeners that are
252+
* registered by the extension.
253+
*
254+
* @return A list of scope change listeners that are currently registered by
255+
* this extension.
256+
*/
257+
List<IScopeChangeListener> getScopeChangeListeners();
258+
259+
/**
260+
* This method is used to remove a scope change listener that has been
261+
* registered by the extension.
262+
*
263+
* @param listener The scope change listener to be removed.
264+
*/
265+
void removeScopeChangeListener(IScopeChangeListener listener);
266+
166267
/**
167268
* This method is used to register a factory for custom context menu items.
168269
* When the user invokes a context menu anywhere within Burp, the factory
@@ -174,6 +275,23 @@ public interface IBurpExtenderCallbacks
174275
*/
175276
void registerContextMenuFactory(IContextMenuFactory factory);
176277

278+
/**
279+
* This method is used to retrieve the context menu factories that are
280+
* registered by the extension.
281+
*
282+
* @return A list of context menu factories that are currently registered by
283+
* this extension.
284+
*/
285+
List<IContextMenuFactory> getContextMenuFactories();
286+
287+
/**
288+
* This method is used to remove a context menu factory that has been
289+
* registered by the extension.
290+
*
291+
* @param factory The context menu factory to be removed.
292+
*/
293+
void removeContextMenuFactory(IContextMenuFactory factory);
294+
177295
/**
178296
* This method is used to register a factory for custom message editor tabs.
179297
* For each message editor that already exists, or is subsequently created,
@@ -186,6 +304,23 @@ public interface IBurpExtenderCallbacks
186304
*/
187305
void registerMessageEditorTabFactory(IMessageEditorTabFactory factory);
188306

307+
/**
308+
* This method is used to retrieve the message editor tab factories that are
309+
* registered by the extension.
310+
*
311+
* @return A list of message editor tab factories that are currently
312+
* registered by this extension.
313+
*/
314+
List<IMessageEditorTabFactory> getMessageEditorTabFactories();
315+
316+
/**
317+
* This method is used to remove a message editor tab factory that has been
318+
* registered by the extension.
319+
*
320+
* @param factory The message editor tab factory to be removed.
321+
*/
322+
void removeMessageEditorTabFactory(IMessageEditorTabFactory factory);
323+
189324
/**
190325
* This method is used to register a provider of Scanner insertion points.
191326
* For each base request that is actively scanned, Burp will ask the
@@ -198,6 +333,24 @@ public interface IBurpExtenderCallbacks
198333
void registerScannerInsertionPointProvider(
199334
IScannerInsertionPointProvider provider);
200335

336+
/**
337+
* This method is used to retrieve the Scanner insertion point providers
338+
* that are registered by the extension.
339+
*
340+
* @return A list of Scanner insertion point providers that are currently
341+
* registered by this extension.
342+
*/
343+
List<IScannerInsertionPointProvider> getScannerInsertionPointProviders();
344+
345+
/**
346+
* This method is used to remove a Scanner insertion point provider that has
347+
* been registered by the extension.
348+
*
349+
* @param provider The Scanner insertion point provider to be removed.
350+
*/
351+
void removeScannerInsertionPointProvider(
352+
IScannerInsertionPointProvider provider);
353+
201354
/**
202355
* This method is used to register a custom Scanner check. When performing
203356
* scanning, Burp will ask the check to perform active or passive scanning
@@ -208,6 +361,23 @@ void registerScannerInsertionPointProvider(
208361
*/
209362
void registerScannerCheck(IScannerCheck check);
210363

364+
/**
365+
* This method is used to retrieve the Scanner checks that are registered by
366+
* the extension.
367+
*
368+
* @return A list of Scanner checks that are currently registered by this
369+
* extension.
370+
*/
371+
List<IScannerCheck> getScannerChecks();
372+
373+
/**
374+
* This method is used to remove a Scanner check that has been registered by
375+
* the extension.
376+
*
377+
* @param check The Scanner check to be removed.
378+
*/
379+
void removeScannerCheck(IScannerCheck check);
380+
211381
/**
212382
* This method is used to register a factory for Intruder payloads. Each
213383
* registered factory will be available within the Intruder UI for the user
@@ -222,6 +392,25 @@ void registerScannerInsertionPointProvider(
222392
void registerIntruderPayloadGeneratorFactory(
223393
IIntruderPayloadGeneratorFactory factory);
224394

395+
/**
396+
* This method is used to retrieve the Intruder payload generator factories
397+
* that are registered by the extension.
398+
*
399+
* @return A list of Intruder payload generator factories that are currently
400+
* registered by this extension.
401+
*/
402+
List<IIntruderPayloadGeneratorFactory>
403+
getIntruderPayloadGeneratorFactories();
404+
405+
/**
406+
* This method is used to remove an Intruder payload generator factory that
407+
* has been registered by the extension.
408+
*
409+
* @param factory The Intruder payload generator factory to be removed.
410+
*/
411+
void removeIntruderPayloadGeneratorFactory(
412+
IIntruderPayloadGeneratorFactory factory);
413+
225414
/**
226415
* This method is used to register a custom Intruder payload processor. Each
227416
* registered processor will be available within the Intruder UI for the
@@ -232,6 +421,23 @@ void registerIntruderPayloadGeneratorFactory(
232421
*/
233422
void registerIntruderPayloadProcessor(IIntruderPayloadProcessor processor);
234423

424+
/**
425+
* This method is used to retrieve the Intruder payload processors that are
426+
* registered by the extension.
427+
*
428+
* @return A list of Intruder payload processors that are currently
429+
* registered by this extension.
430+
*/
431+
List<IIntruderPayloadProcessor> getIntruderPayloadProcessors();
432+
433+
/**
434+
* This method is used to remove an Intruder payload processor that has been
435+
* registered by the extension.
436+
*
437+
* @param processor The Intruder payload processor to be removed.
438+
*/
439+
void removeIntruderPayloadProcessor(IIntruderPayloadProcessor processor);
440+
235441
/**
236442
* This method is used to register a custom session handling action. Each
237443
* registered action will be available within the session handling rule UI
@@ -243,6 +449,23 @@ void registerIntruderPayloadGeneratorFactory(
243449
*/
244450
void registerSessionHandlingAction(ISessionHandlingAction action);
245451

452+
/**
453+
* This method is used to retrieve the session handling actions that are
454+
* registered by the extension.
455+
*
456+
* @return A list of session handling actions that are currently registered
457+
* by this extension.
458+
*/
459+
List<ISessionHandlingAction> getSessionHandlingActions();
460+
461+
/**
462+
* This method is used to remove a session handling action that has been
463+
* registered by the extension.
464+
*
465+
* @param action The extension session handling action to be removed.
466+
*/
467+
void removeSessionHandlingAction(ISessionHandlingAction action);
468+
246469
/**
247470
* This method is used to unload the extension from Burp Suite.
248471
*/
@@ -267,7 +490,9 @@ void registerIntruderPayloadGeneratorFactory(
267490

268491
/**
269492
* This method is used to customize UI components in line with Burp's UI
270-
* style, including font size, colors, table line spacing, etc.
493+
* style, including font size, colors, table line spacing, etc. The action
494+
* is performed recursively on any child components of the passed-in
495+
* component.
271496
*
272497
* @param component The UI component to be customized.
273498
*/
@@ -392,6 +617,13 @@ void sendToIntruder(
392617
byte[] request,
393618
List<int[]> payloadPositionOffsets);
394619

620+
/**
621+
* This method can be used to send data to the Comparer tool.
622+
*
623+
* @param data The data to be sent to Comparer.
624+
*/
625+
void sendToComparer(byte[] data);
626+
395627
/**
396628
* This method can be used to send a seed URL to the Burp Spider tool. If
397629
* the URL is not within the current Spider scope, the user will be asked if
@@ -570,7 +802,8 @@ byte[] makeHttpRequest(
570802
* @param issues The Scanner issues to be reported.
571803
* @param file The file to which the report will be saved.
572804
*/
573-
void generateScanReport(String format, IScanIssue[] issues, java.io.File file);
805+
void generateScanReport(String format, IScanIssue[] issues,
806+
java.io.File file);
574807

575808
/**
576809
* This method is used to retrieve the contents of Burp's session handling
@@ -669,6 +902,23 @@ byte[] makeHttpRequest(
669902
*/
670903
String[] getBurpVersion();
671904

905+
/**
906+
* This method retrieves the absolute path name of the file from which the
907+
* current extension was loaded.
908+
*
909+
* @return The absolute path name of the file from which the current
910+
* extension was loaded.
911+
*/
912+
String getExtensionFilename();
913+
914+
/**
915+
* This method determines whether the current extension was loaded as a
916+
* BApp (a Burp App from the BApp Store).
917+
*
918+
* @return Returns true if the current extension was loaded as a BApp.
919+
*/
920+
boolean isExtensionBapp();
921+
672922
/**
673923
* This method can be used to shut down Burp programmatically, with an
674924
* optional prompt to the user. If the method returns, the user canceled the

src/burp/ICookie.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ public interface ICookie
2929
*/
3030
String getDomain();
3131

32+
/**
33+
* This method is used to retrieve the path for which the cookie is in
34+
* scope.
35+
*
36+
* @return The path for which the cookie is in scope or null if none is set.
37+
*/
38+
String getPath();
39+
3240
/**
3341
* This method is used to retrieve the expiration time for the cookie.
3442
*

src/burp/IHttpRequestResponsePersisted.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
public interface IHttpRequestResponsePersisted extends IHttpRequestResponse
1919
{
2020
/**
21-
* This method is used to permanently delete the saved temporary files. It
22-
* will no longer be possible to retrieve the request or response for this
23-
* item.
21+
* This method is deprecated and no longer performs any action.
2422
*/
23+
@Deprecated
2524
void deleteTempFiles();
2625
}

0 commit comments

Comments
 (0)