├── .gitignore
├── LICENSE
├── README.md
├── build.xml
├── manifest.mf
├── nbproject
├── build-impl.xml
├── genfiles.properties
├── project.properties
└── project.xml
└── src
├── burp
├── BurpExtender.java
├── IBurpExtender.java
├── IBurpExtenderCallbacks.java
├── IContextMenuFactory.java
├── IContextMenuInvocation.java
├── ICookie.java
├── IExtensionHelpers.java
├── IExtensionStateListener.java
├── IHttpListener.java
├── IHttpRequestResponse.java
├── IHttpRequestResponsePersisted.java
├── IHttpRequestResponseWithMarkers.java
├── IHttpService.java
├── IInterceptedProxyMessage.java
├── IIntruderAttack.java
├── IIntruderPayloadGenerator.java
├── IIntruderPayloadGeneratorFactory.java
├── IIntruderPayloadProcessor.java
├── IMenuItemHandler.java
├── IMessageEditor.java
├── IMessageEditorController.java
├── IMessageEditorTab.java
├── IMessageEditorTabFactory.java
├── IParameter.java
├── IProxyListener.java
├── IRequestInfo.java
├── IResponseInfo.java
├── IScanIssue.java
├── IScanQueueItem.java
├── IScannerCheck.java
├── IScannerInsertionPoint.java
├── IScannerInsertionPointProvider.java
├── IScannerListener.java
├── IScopeChangeListener.java
├── ISessionHandlingAction.java
├── ITab.java
├── ITempFile.java
└── ITextEditor.java
└── hvqzao
└── flow
├── FlowAddNewIssue.form
├── FlowAddNewIssue.java
├── FlowExtension.java
├── FlowFilterPopup.form
├── FlowFilterPopup.java
├── FlowOptionsPane.form
├── FlowOptionsPane.java
├── resources
├── checkbox.png
├── newwindow.png
├── panel_defaults.png
└── panel_help.png
└── ui
├── BooleanTableCellRenderer.java
├── DialogWrapper.form
├── DialogWrapper.java
├── Editor.form
├── Editor.java
├── IEditor.java
└── ThemeHelper.java
/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /dist
3 | /nbproject/private
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 hvqzao
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flow
2 |
3 | This simple extension provides Proxy-like view along with search filter capabilities for all Burp sources. Some users might find Parameters count table column handy.
4 |
5 | Request without responses received are also being shown and they are later updated as soon as response is received. This might be helpful to troubleshoot e.g. scanning issues.
6 |
7 | Request and response are splitted into separate columns (Repeater-like view).
8 |
9 | If required, extension window can be detached from Burp UI.
10 |
11 | This extension _DOES NOT_ require Burp Suite Professional
12 |
13 | 
14 |
15 | ## Known issues
16 |
17 | * If Burp "Platform Authentication" is in use, or "Match and Replace" in request is used, Flow is unable to match responses to related requests. This is caused by Burp API limitations (lack of unique identifiers in HttpRequestResponse). Problem was reported to Portswigger. As a workaround I suggest to perform platform authentication / requests altering in upstream proxy.
18 |
19 | * ~~Gnome-shell related issue: Filter popup appears correctly only on first use. Resizing Burp window helps.~~ Fixed
20 |
21 | ## Changelog
22 |
23 | 2020-12-02 - 1.25
24 | - fixed support for dark mode
25 | - fixed bug with "Time" column (Issue #11)
26 |
27 | 2017-03-10 - 1.10
28 | - added "Reflect" column (analysis result is available in tooltip)
29 |
30 | 2017-03-09 - 1.09
31 | - "display only requests with responses" should now work properly
32 | - url field is now wider by default
33 | - url field contains query pararameters when present
34 | - "populate with requests from proxy history" option added
35 |
36 | 2016-10-17 - 1.06
37 | - updated filter popup UI, extension is now initialized with current Proxy history. Detach window button have current extension version in its tool tip.
38 |
39 | ## Download
40 |
41 | https://github.com/hvqzao/burp-flow/releases/download/1.06/flow.jar
42 |
43 | ## License
44 |
45 | [MIT License](LICENSE)
46 |
--------------------------------------------------------------------------------
/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Builds, tests, and runs the project burp-flow.
12 |
13 |
73 |
74 |
--------------------------------------------------------------------------------
/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=85917c14
2 | build.xml.script.CRC32=a05149b9
3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=85917c14
7 | nbproject/build-impl.xml.script.CRC32=0565f157
8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
9 |
--------------------------------------------------------------------------------
/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=false
3 | annotation.processing.processors.list=
4 | annotation.processing.run.all.processors=true
5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
6 | application.title=burp-flow
7 | application.vendor=hvqzao
8 | build.classes.dir=${build.dir}/classes
9 | build.classes.excludes=**/*.java,**/*.form
10 | # This directory is removed when the project is cleaned:
11 | build.dir=build
12 | build.generated.dir=${build.dir}/generated
13 | build.generated.sources.dir=${build.dir}/generated-sources
14 | # Only compile against the classpath explicitly listed here:
15 | build.sysclasspath=ignore
16 | build.test.classes.dir=${build.dir}/test/classes
17 | build.test.results.dir=${build.dir}/test/results
18 | # Uncomment to specify the preferred debugger connection transport:
19 | #debug.transport=dt_socket
20 | debug.classpath=\
21 | ${run.classpath}
22 | debug.test.classpath=\
23 | ${run.test.classpath}
24 | # This directory is removed when the project is cleaned:
25 | dist.dir=dist
26 | dist.jar=${dist.dir}/flow.jar
27 | dist.javadoc.dir=${dist.dir}/javadoc
28 | endorsed.classpath=
29 | excludes=
30 | includes=**
31 | jar.compress=false
32 | javac.classpath=
33 | # Space-separated list of extra javac options
34 | javac.compilerargs=
35 | javac.deprecation=false
36 | javac.external.vm=false
37 | javac.processorpath=\
38 | ${javac.classpath}
39 | javac.source=1.7
40 | javac.target=1.7
41 | javac.test.classpath=\
42 | ${javac.classpath}:\
43 | ${build.classes.dir}
44 | javac.test.processorpath=\
45 | ${javac.test.classpath}
46 | javadoc.additionalparam=
47 | javadoc.author=false
48 | javadoc.encoding=${source.encoding}
49 | javadoc.noindex=false
50 | javadoc.nonavbar=false
51 | javadoc.notree=false
52 | javadoc.private=false
53 | javadoc.splitindex=true
54 | javadoc.use=true
55 | javadoc.version=false
56 | javadoc.windowtitle=
57 | main.class=
58 | manifest.file=manifest.mf
59 | meta.inf.dir=${src.dir}/META-INF
60 | mkdist.disabled=false
61 | platform.active=default_platform
62 | run.classpath=\
63 | ${javac.classpath}:\
64 | ${build.classes.dir}
65 | # Space-separated list of JVM arguments used when running the project
66 | # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
67 | # or test-sys-prop.name=value to set system properties for unit tests):
68 | run.jvmargs=
69 | run.test.classpath=\
70 | ${javac.test.classpath}:\
71 | ${build.test.classes.dir}
72 | source.encoding=UTF-8
73 | src.dir=src
74 | test.src.dir=test
75 |
--------------------------------------------------------------------------------
/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | burp-flow
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/burp/BurpExtender.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | import hvqzao.flow.FlowExtension;
4 |
5 | public class BurpExtender extends FlowExtension {
6 | // see hvqzao.flow.FlowExtension
7 | }
8 |
--------------------------------------------------------------------------------
/src/burp/IBurpExtender.java:
--------------------------------------------------------------------------------
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 | * IBurpExtenderCallbacks
interface, providing methods that may
25 | * be invoked by the extension to perform various actions.
26 | *
27 | * @param callbacks An
28 | * IBurpExtenderCallbacks
object.
29 | */
30 | void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks);
31 | }
32 |
--------------------------------------------------------------------------------
/src/burp/IContextMenuFactory.java:
--------------------------------------------------------------------------------
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 |
13 | import javax.swing.JMenuItem;
14 | import java.util.List;
15 |
16 | /**
17 | * Extensions can implement this interface and then call
18 | * IBurpExtenderCallbacks.registerContextMenuFactory()
to register
19 | * a factory for custom context menu items.
20 | */
21 | public interface IContextMenuFactory
22 | {
23 | /**
24 | * This method will be called by Burp when the user invokes a context menu
25 | * anywhere within Burp. The factory can then provide any custom context
26 | * menu items that should be displayed in the context menu, based on the
27 | * details of the menu invocation.
28 | *
29 | * @param invocation An object that implements the
30 | * IMessageEditorTabFactory
interface, which the extension can
31 | * query to obtain details of the context menu invocation.
32 | * @return A list of custom menu items (which may include sub-menus,
33 | * checkbox menu items, etc.) that should be displayed. Extensions may
34 | * return
35 | * null
from this method, to indicate that no menu items are
36 | * required.
37 | */
38 | List createMenuItems(IContextMenuInvocation invocation);
39 | }
40 |
--------------------------------------------------------------------------------
/src/burp/IContextMenuInvocation.java:
--------------------------------------------------------------------------------
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 | * IContextMenuFactory
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 InputEvent
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 | * IBurpExtenderCallbacks
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 null
.
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 | * Note: 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 | * IHttpRequestResponse
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 | * IHttpRequestResponse
at the time of invocation, or you
134 | * should use
135 | * IBurpExtenderCallbacks.saveBuffersToTempFiles()
to create a
136 | * persistent read-only copy of the
137 | * IHttpRequestResponse
.
138 | *
139 | * @return An array of IHttpRequestResponse
objects
140 | * representing the items that were shown or selected by the user when the
141 | * context menu was invoked. This method returns null
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 IScanIssue
objects representing the
151 | * issues that were selected by the user when the context menu was invoked.
152 | * This method returns null
if no Scanner issues are applicable
153 | * to the invocation.
154 | */
155 | IScanIssue[] getSelectedIssues();
156 | }
157 |
--------------------------------------------------------------------------------
/src/burp/ICookie.java:
--------------------------------------------------------------------------------
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. Note: For
24 | * cookies that have been analyzed from responses (by calling
25 | * IExtensionHelpers.analyzeResponse()
and then
26 | * IResponseInfo.getCookies()
, the domain will be
27 | * null
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 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 |
40 | /**
41 | * This method is used to retrieve the expiration time for the cookie.
42 | *
43 | * @return The expiration time for the cookie, or
44 | * null
if none is set (i.e., for non-persistent session
45 | * cookies).
46 | */
47 | Date getExpiration();
48 |
49 | /**
50 | * This method is used to retrieve the name of the cookie.
51 | *
52 | * @return The name of the cookie.
53 | */
54 | String getName();
55 |
56 | /**
57 | * This method is used to retrieve the value of the cookie.
58 | * @return The value of the cookie.
59 | */
60 | String getValue();
61 | }
62 |
--------------------------------------------------------------------------------
/src/burp/IExtensionHelpers.java:
--------------------------------------------------------------------------------
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 | * IBurpExtenderCallbacks.getHelpers
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 | * IHttpRequestResponse
object containing the request to be
31 | * analyzed.
32 | * @return An
33 | * IRequestInfo
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 | * null
, in which case the resulting
45 | * IRequestInfo
object will not include the full request URL.
46 | * @param request The request to be analyzed.
47 | * @return An
48 | * IRequestInfo
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 | * IRequestInfo
object will not include the full request URL.
57 | * To obtain the full URL, use one of the other overloaded
58 | * analyzeRequest()
methods.
59 | *
60 | * @param request The request to be analyzed.
61 | * @return An
62 | * IRequestInfo
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 | * IResponseInfo
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. Note: Use
81 | * analyzeRequest()
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 | * IParameter
object that can be queried to obtain details
88 | * about the parameter, or
89 | * null
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 | * bytesToString()
, 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 | * stringToBytes()
, 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 | * String.indexOf()
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 | * data
where the search should begin.
202 | * @param to The offset within
203 | * data
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 | * null
if the message has an empty body.
221 | * @return The resulting full HTTP message.
222 | */
223 | byte[] buildHttpMessage(List 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 | * IParameter
object containing details of the parameter to be
242 | * added. Supported parameter types are:
243 | * PARAM_URL
,
244 | * PARAM_BODY
and
245 | * PARAM_COOKIE
.
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 | * IParameter
object containing details of the parameter to be
257 | * removed. Supported parameter types are:
258 | * PARAM_URL
,
259 | * PARAM_BODY
and
260 | * PARAM_COOKIE
.
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. Note: 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 | * removeParameter()
to remove the parameter with the old type,
272 | * and then call
273 | * addParameter()
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 | * IParameter
object containing details of the parameter to be
278 | * updated. Supported parameter types are:
279 | * PARAM_URL
,
280 | * PARAM_BODY
and
281 | * PARAM_COOKIE
.
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 | * IHttpService
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 | * IHttpService
object based on the details provided.
306 | */
307 | IHttpService buildHttpService(String host, int port, String protocol);
308 |
309 | /**
310 | * This method constructs an
311 | * IHttpService
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 | * IHttpService
object based on the details provided.
318 | */
319 | IHttpService buildHttpService(String host, int port, boolean useHttps);
320 |
321 | /**
322 | * This method constructs an
323 | * IParameter
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 | * IParameter
interface.
329 | * @return An
330 | * IParameter
object based on the details provided.
331 | */
332 | IParameter buildParameter(String name, String value, byte type);
333 |
334 | /**
335 | * This method constructs an
336 | * IScannerInsertionPoint
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 | * IScannerInsertionPoint
object based on the details provided.
346 | */
347 | IScannerInsertionPoint makeScannerInsertionPoint(
348 | String insertionPointName,
349 | byte[] baseRequest,
350 | int from,
351 | int to);
352 | }
353 |
--------------------------------------------------------------------------------
/src/burp/IExtensionStateListener.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IExtensionStateListener.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerExtensionStateListener()
to
15 | * register an extension state listener. The listener will be notified of
16 | * changes to the extension's state. Note: Any extensions that start
17 | * background threads or open system resources (such as files or database
18 | * connections) should register a listener and terminate threads / close
19 | * resources when the extension is unloaded.
20 | */
21 | public interface IExtensionStateListener
22 | {
23 | /**
24 | * This method is called when the extension is unloaded.
25 | */
26 | void extensionUnloaded();
27 | }
28 |
--------------------------------------------------------------------------------
/src/burp/IHttpListener.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IHttpListener.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerHttpListener()
to register an
15 | * HTTP listener. The listener will be notified of requests and responses made
16 | * by any Burp tool. Extensions can perform custom analysis or modification of
17 | * these messages by registering an HTTP listener.
18 | */
19 | public interface IHttpListener
20 | {
21 | /**
22 | * This method is invoked when an HTTP request is about to be issued, and
23 | * when an HTTP response has been received.
24 | *
25 | * @param toolFlag A flag indicating the Burp tool that issued the request.
26 | * Burp tool flags are defined in the
27 | * IBurpExtenderCallbacks
interface.
28 | * @param messageIsRequest Flags whether the method is being invoked for a
29 | * request or response.
30 | * @param messageInfo Details of the request / response to be processed.
31 | * Extensions can call the setter methods on this object to update the
32 | * current message and so modify Burp's behavior.
33 | */
34 | void processHttpMessage(int toolFlag,
35 | boolean messageIsRequest,
36 | IHttpRequestResponse messageInfo);
37 | }
38 |
--------------------------------------------------------------------------------
/src/burp/IHttpRequestResponse.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IHttpRequestResponse.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 | * This interface is used to retrieve and update details about HTTP messages.
14 | *
15 | * Note: The setter methods generally can only be used before the message
16 | * has been processed, and not in read-only contexts. The getter methods
17 | * relating to response details can only be used after the request has been
18 | * issued.
19 | */
20 | public interface IHttpRequestResponse
21 | {
22 | /**
23 | * This method is used to retrieve the request message.
24 | *
25 | * @return The request message.
26 | */
27 | byte[] getRequest();
28 |
29 | /**
30 | * This method is used to update the request message.
31 | *
32 | * @param message The new request message.
33 | */
34 | void setRequest(byte[] message);
35 |
36 | /**
37 | * This method is used to retrieve the response message.
38 | *
39 | * @return The response message.
40 | */
41 | byte[] getResponse();
42 |
43 | /**
44 | * This method is used to update the response message.
45 | *
46 | * @param message The new response message.
47 | */
48 | void setResponse(byte[] message);
49 |
50 | /**
51 | * This method is used to retrieve the user-annotated comment for this item,
52 | * if applicable.
53 | *
54 | * @return The user-annotated comment for this item, or null if none is set.
55 | */
56 | String getComment();
57 |
58 | /**
59 | * This method is used to update the user-annotated comment for this item.
60 | *
61 | * @param comment The comment to be assigned to this item.
62 | */
63 | void setComment(String comment);
64 |
65 | /**
66 | * This method is used to retrieve the user-annotated highlight for this
67 | * item, if applicable.
68 | *
69 | * @return The user-annotated highlight for this item, or null if none is
70 | * set.
71 | */
72 | String getHighlight();
73 |
74 | /**
75 | * This method is used to update the user-annotated highlight for this item.
76 | *
77 | * @param color The highlight color to be assigned to this item. Accepted
78 | * values are: red, orange, yellow, green, cyan, blue, pink, magenta, gray,
79 | * or a null String to clear any existing highlight.
80 | */
81 | void setHighlight(String color);
82 |
83 | /**
84 | * This method is used to retrieve the HTTP service for this request /
85 | * response.
86 | *
87 | * @return An
88 | * IHttpService
object containing details of the HTTP service.
89 | */
90 | IHttpService getHttpService();
91 |
92 | /**
93 | * This method is used to update the HTTP service for this request /
94 | * response.
95 | *
96 | * @param httpService An
97 | * IHttpService
object containing details of the new HTTP
98 | * service.
99 | */
100 | void setHttpService(IHttpService httpService);
101 |
102 | }
103 |
--------------------------------------------------------------------------------
/src/burp/IHttpRequestResponsePersisted.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IHttpRequestResponsePersisted.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 | * This interface is used for an
14 | * IHttpRequestResponse
object whose request and response messages
15 | * have been saved to temporary files using
16 | * IBurpExtenderCallbacks.saveBuffersToTempFiles()
.
17 | */
18 | public interface IHttpRequestResponsePersisted extends IHttpRequestResponse
19 | {
20 | /**
21 | * This method is deprecated and no longer performs any action.
22 | */
23 | @Deprecated
24 | void deleteTempFiles();
25 | }
26 |
--------------------------------------------------------------------------------
/src/burp/IHttpRequestResponseWithMarkers.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IHttpRequestResponseWithMarkers.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 |
14 | /**
15 | * This interface is used for an
16 | * IHttpRequestResponse
object that has had markers applied.
17 | * Extensions can create instances of this interface using
18 | * IBurpExtenderCallbacks.applyMarkers()
, or provide their own
19 | * implementation. Markers are used in various situations, such as specifying
20 | * Intruder payload positions, Scanner insertion points, and highlights in
21 | * Scanner issues.
22 | */
23 | public interface IHttpRequestResponseWithMarkers extends IHttpRequestResponse
24 | {
25 | /**
26 | * This method returns the details of the request markers.
27 | *
28 | * @return A list of index pairs representing the offsets of markers for the
29 | * request message. Each item in the list is an int[2] array containing the
30 | * start and end offsets for the marker. The method may return
31 | * null
if no request markers are defined.
32 | */
33 | List getRequestMarkers();
34 |
35 | /**
36 | * This method returns the details of the response markers.
37 | *
38 | * @return A list of index pairs representing the offsets of markers for the
39 | * response message. Each item in the list is an int[2] array containing the
40 | * start and end offsets for the marker. The method may return
41 | * null
if no response markers are defined.
42 | */
43 | List getResponseMarkers();
44 | }
45 |
--------------------------------------------------------------------------------
/src/burp/IHttpService.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IHttpService.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 | * This interface is used to provide details about an HTTP service, to which
14 | * HTTP requests can be sent.
15 | */
16 | public interface IHttpService
17 | {
18 | /**
19 | * This method returns the hostname or IP address for the service.
20 | *
21 | * @return The hostname or IP address for the service.
22 | */
23 | String getHost();
24 |
25 | /**
26 | * This method returns the port number for the service.
27 | *
28 | * @return The port number for the service.
29 | */
30 | int getPort();
31 |
32 | /**
33 | * This method returns the protocol for the service.
34 | *
35 | * @return The protocol for the service. Expected values are "http" or
36 | * "https".
37 | */
38 | String getProtocol();
39 | }
40 |
--------------------------------------------------------------------------------
/src/burp/IInterceptedProxyMessage.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IInterceptedProxyMessage.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.InetAddress;
13 |
14 | /**
15 | * This interface is used to represent an HTTP message that has been intercepted
16 | * by Burp Proxy. Extensions can register an
17 | * IProxyListener
to receive details of proxy messages using this
18 | * interface. *
19 | */
20 | public interface IInterceptedProxyMessage
21 | {
22 | /**
23 | * This action causes Burp Proxy to follow the current interception rules to
24 | * determine the appropriate action to take for the message.
25 | */
26 | static final int ACTION_FOLLOW_RULES = 0;
27 | /**
28 | * This action causes Burp Proxy to present the message to the user for
29 | * manual review or modification.
30 | */
31 | static final int ACTION_DO_INTERCEPT = 1;
32 | /**
33 | * This action causes Burp Proxy to forward the message to the remote server
34 | * or client, without presenting it to the user.
35 | */
36 | static final int ACTION_DONT_INTERCEPT = 2;
37 | /**
38 | * This action causes Burp Proxy to drop the message.
39 | */
40 | static final int ACTION_DROP = 3;
41 | /**
42 | * This action causes Burp Proxy to follow the current interception rules to
43 | * determine the appropriate action to take for the message, and then make a
44 | * second call to processProxyMessage.
45 | */
46 | static final int ACTION_FOLLOW_RULES_AND_REHOOK = 0x10;
47 | /**
48 | * This action causes Burp Proxy to present the message to the user for
49 | * manual review or modification, and then make a second call to
50 | * processProxyMessage.
51 | */
52 | static final int ACTION_DO_INTERCEPT_AND_REHOOK = 0x11;
53 | /**
54 | * This action causes Burp Proxy to skip user interception, and then make a
55 | * second call to processProxyMessage.
56 | */
57 | static final int ACTION_DONT_INTERCEPT_AND_REHOOK = 0x12;
58 |
59 | /**
60 | * This method retrieves a unique reference number for this
61 | * request/response.
62 | *
63 | * @return An identifier that is unique to a single request/response pair.
64 | * Extensions can use this to correlate details of requests and responses
65 | * and perform processing on the response message accordingly.
66 | */
67 | int getMessageReference();
68 |
69 | /**
70 | * This method retrieves details of the intercepted message.
71 | *
72 | * @return An IHttpRequestResponse
object containing details of
73 | * the intercepted message.
74 | */
75 | IHttpRequestResponse getMessageInfo();
76 |
77 | /**
78 | * This method retrieves the currently defined interception action. The
79 | * default action is
80 | * ACTION_FOLLOW_RULES
. If multiple proxy listeners are
81 | * registered, then other listeners may already have modified the
82 | * interception action before it reaches the current listener. This method
83 | * can be used to determine whether this has occurred.
84 | *
85 | * @return The currently defined interception action. Possible values are
86 | * defined within this interface.
87 | */
88 | int getInterceptAction();
89 |
90 | /**
91 | * This method is used to update the interception action.
92 | *
93 | * @param interceptAction The new interception action. Possible values are
94 | * defined within this interface.
95 | */
96 | void setInterceptAction(int interceptAction);
97 |
98 | /**
99 | * This method retrieves the name of the Burp Proxy listener that is
100 | * processing the intercepted message.
101 | *
102 | * @return The name of the Burp Proxy listener that is processing the
103 | * intercepted message. The format is the same as that shown in the Proxy
104 | * Listeners UI - for example, "127.0.0.1:8080".
105 | */
106 | String getListenerInterface();
107 |
108 | /**
109 | * This method retrieves the client IP address from which the request for
110 | * the intercepted message was received.
111 | *
112 | * @return The client IP address from which the request for the intercepted
113 | * message was received.
114 | */
115 | InetAddress getClientIpAddress();
116 | }
117 |
--------------------------------------------------------------------------------
/src/burp/IIntruderAttack.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IIntruderAttack.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 | * This interface is used to hold details about an Intruder attack.
14 | */
15 | public interface IIntruderAttack
16 | {
17 | /**
18 | * This method is used to retrieve the HTTP service for the attack.
19 | *
20 | * @return The HTTP service for the attack.
21 | */
22 | IHttpService getHttpService();
23 |
24 | /**
25 | * This method is used to retrieve the request template for the attack.
26 | *
27 | * @return The request template for the attack.
28 | */
29 | byte[] getRequestTemplate();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/burp/IIntruderPayloadGenerator.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IIntruderPayloadGenerator.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 | * This interface is used for custom Intruder payload generators. Extensions
14 | * that have registered an
15 | * IIntruderPayloadGeneratorFactory
must return a new instance of
16 | * this interface when required as part of a new Intruder attack.
17 | */
18 | public interface IIntruderPayloadGenerator
19 | {
20 | /**
21 | * This method is used by Burp to determine whether the payload generator is
22 | * able to provide any further payloads.
23 | *
24 | * @return Extensions should return
25 | * false
when all the available payloads have been used up,
26 | * otherwise
27 | * true
.
28 | */
29 | boolean hasMorePayloads();
30 |
31 | /**
32 | * This method is used by Burp to obtain the value of the next payload.
33 | *
34 | * @param baseValue The base value of the current payload position. This
35 | * value may be
36 | * null
if the concept of a base value is not applicable (e.g.
37 | * in a battering ram attack).
38 | * @return The next payload to use in the attack.
39 | */
40 | byte[] getNextPayload(byte[] baseValue);
41 |
42 | /**
43 | * This method is used by Burp to reset the state of the payload generator
44 | * so that the next call to
45 | * getNextPayload()
returns the first payload again. This
46 | * method will be invoked when an attack uses the same payload generator for
47 | * more than one payload position, for example in a sniper attack.
48 | */
49 | void reset();
50 | }
51 |
--------------------------------------------------------------------------------
/src/burp/IIntruderPayloadGeneratorFactory.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IIntruderPayloadGeneratorFactory.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerIntruderPayloadGeneratorFactory()
15 | * to register a factory for custom Intruder payloads.
16 | */
17 | public interface IIntruderPayloadGeneratorFactory
18 | {
19 | /**
20 | * This method is used by Burp to obtain the name of the payload generator.
21 | * This will be displayed as an option within the Intruder UI when the user
22 | * selects to use extension-generated payloads.
23 | *
24 | * @return The name of the payload generator.
25 | */
26 | String getGeneratorName();
27 |
28 | /**
29 | * This method is used by Burp when the user starts an Intruder attack that
30 | * uses this payload generator.
31 | *
32 | * @param attack An
33 | * IIntruderAttack
object that can be queried to obtain details
34 | * about the attack in which the payload generator will be used.
35 | * @return A new instance of
36 | * IIntruderPayloadGenerator
that will be used to generate
37 | * payloads for the attack.
38 | */
39 | IIntruderPayloadGenerator createNewInstance(IIntruderAttack attack);
40 | }
41 |
--------------------------------------------------------------------------------
/src/burp/IIntruderPayloadProcessor.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IIntruderPayloadProcessor.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerIntruderPayloadProcessor()
to
15 | * register a custom Intruder payload processor.
16 | */
17 | public interface IIntruderPayloadProcessor
18 | {
19 | /**
20 | * This method is used by Burp to obtain the name of the payload processor.
21 | * This will be displayed as an option within the Intruder UI when the user
22 | * selects to use an extension-provided payload processor.
23 | *
24 | * @return The name of the payload processor.
25 | */
26 | String getProcessorName();
27 |
28 | /**
29 | * This method is invoked by Burp each time the processor should be applied
30 | * to an Intruder payload.
31 | *
32 | * @param currentPayload The value of the payload to be processed.
33 | * @param originalPayload The value of the original payload prior to
34 | * processing by any already-applied processing rules.
35 | * @param baseValue The base value of the payload position, which will be
36 | * replaced with the current payload.
37 | * @return The value of the processed payload. This may be
38 | * null
to indicate that the current payload should be skipped,
39 | * and the attack will move directly to the next payload.
40 | */
41 | byte[] processPayload(
42 | byte[] currentPayload,
43 | byte[] originalPayload,
44 | byte[] baseValue);
45 | }
46 |
--------------------------------------------------------------------------------
/src/burp/IMenuItemHandler.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IMenuItemHandler.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerMenuItem()
to register a custom
15 | * context menu item.
16 | *
17 | * @deprecated Use
18 | * IContextMenuFactory
instead.
19 | */
20 | @Deprecated
21 | public interface IMenuItemHandler
22 | {
23 | /**
24 | * This method is invoked by Burp Suite when the user clicks on a custom
25 | * menu item which the extension has registered with Burp.
26 | *
27 | * @param menuItemCaption The caption of the menu item which was clicked.
28 | * This parameter enables extensions to provide a single implementation
29 | * which handles multiple different menu items.
30 | * @param messageInfo Details of the HTTP message(s) for which the context
31 | * menu was displayed.
32 | */
33 | void menuItemClicked(
34 | String menuItemCaption,
35 | IHttpRequestResponse[] messageInfo);
36 | }
37 |
--------------------------------------------------------------------------------
/src/burp/IMessageEditor.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IMessageEditor.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 |
14 | /**
15 | * This interface is used to provide extensions with an instance of Burp's HTTP
16 | * message editor, for the extension to use in its own UI. Extensions should
17 | * call
18 | * IBurpExtenderCallbacks.createMessageEditor()
to obtain an
19 | * instance of this interface.
20 | */
21 | public interface IMessageEditor
22 | {
23 | /**
24 | * This method returns the UI component of the editor, for extensions to add
25 | * to their own UI.
26 | *
27 | * @return The UI component of the editor.
28 | */
29 | Component getComponent();
30 |
31 | /**
32 | * This method is used to display an HTTP message in the editor.
33 | *
34 | * @param message The HTTP message to be displayed.
35 | * @param isRequest Flags whether the message is an HTTP request or
36 | * response.
37 | */
38 | void setMessage(byte[] message, boolean isRequest);
39 |
40 | /**
41 | * This method is used to retrieve the currently displayed message, which
42 | * may have been modified by the user.
43 | *
44 | * @return The currently displayed HTTP message.
45 | */
46 | byte[] getMessage();
47 |
48 | /**
49 | * This method is used to determine whether the current message has been
50 | * modified by the user.
51 | *
52 | * @return An indication of whether the current message has been modified by
53 | * the user since it was first displayed.
54 | */
55 | boolean isMessageModified();
56 |
57 | /**
58 | * This method returns the data that is currently selected by the user.
59 | *
60 | * @return The data that is currently selected by the user, or
61 | * null
if no selection is made.
62 | */
63 | byte[] getSelectedData();
64 | }
65 |
--------------------------------------------------------------------------------
/src/burp/IMessageEditorController.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IMessageEditorController.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 | * This interface is used by an
14 | * IMessageEditor
to obtain details about the currently displayed
15 | * message. Extensions that create instances of Burp's HTTP message editor can
16 | * optionally provide an implementation of
17 | * IMessageEditorController
, which the editor will invoke when it
18 | * requires further information about the current message (for example, to send
19 | * it to another Burp tool). Extensions that provide custom editor tabs via an
20 | * IMessageEditorTabFactory
will receive a reference to an
21 | * IMessageEditorController
object for each tab instance they
22 | * generate, which the tab can invoke if it requires further information about
23 | * the current message.
24 | */
25 | public interface IMessageEditorController
26 | {
27 | /**
28 | * This method is used to retrieve the HTTP service for the current message.
29 | *
30 | * @return The HTTP service for the current message.
31 | */
32 | IHttpService getHttpService();
33 |
34 | /**
35 | * This method is used to retrieve the HTTP request associated with the
36 | * current message (which may itself be a response).
37 | *
38 | * @return The HTTP request associated with the current message.
39 | */
40 | byte[] getRequest();
41 |
42 | /**
43 | * This method is used to retrieve the HTTP response associated with the
44 | * current message (which may itself be a request).
45 | *
46 | * @return The HTTP response associated with the current message.
47 | */
48 | byte[] getResponse();
49 | }
50 |
--------------------------------------------------------------------------------
/src/burp/IMessageEditorTab.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IMessageEditorTab.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 |
14 | /**
15 | * Extensions that register an
16 | * IMessageEditorTabFactory
must return instances of this
17 | * interface, which Burp will use to create custom tabs within its HTTP message
18 | * editors.
19 | */
20 | public interface IMessageEditorTab
21 | {
22 | /**
23 | * This method returns the caption that should appear on the custom tab when
24 | * it is displayed. Note: Burp invokes this method once when the tab
25 | * is first generated, and the same caption will be used every time the tab
26 | * is displayed.
27 | *
28 | * @return The caption that should appear on the custom tab when it is
29 | * displayed.
30 | */
31 | String getTabCaption();
32 |
33 | /**
34 | * This method returns the component that should be used as the contents of
35 | * the custom tab when it is displayed. Note: Burp invokes this
36 | * method once when the tab is first generated, and the same component will
37 | * be used every time the tab is displayed.
38 | *
39 | * @return The component that should be used as the contents of the custom
40 | * tab when it is displayed.
41 | */
42 | Component getUiComponent();
43 |
44 | /**
45 | * The hosting editor will invoke this method before it displays a new HTTP
46 | * message, so that the custom tab can indicate whether it should be enabled
47 | * for that message.
48 | *
49 | * @param content The message that is about to be displayed, or a zero-length
50 | * array if the existing message is to be cleared.
51 | * @param isRequest Indicates whether the message is a request or a
52 | * response.
53 | * @return The method should return
54 | * true
if the custom tab is able to handle the specified
55 | * message, and so will be displayed within the editor. Otherwise, the tab
56 | * will be hidden while this message is displayed.
57 | */
58 | boolean isEnabled(byte[] content, boolean isRequest);
59 |
60 | /**
61 | * The hosting editor will invoke this method to display a new message or to
62 | * clear the existing message. This method will only be called with a new
63 | * message if the tab has already returned
64 | * true
to a call to
65 | * isEnabled()
with the same message details.
66 | *
67 | * @param content The message that is to be displayed, or
68 | * null
if the tab should clear its contents and disable any
69 | * editable controls.
70 | * @param isRequest Indicates whether the message is a request or a
71 | * response.
72 | */
73 | void setMessage(byte[] content, boolean isRequest);
74 |
75 | /**
76 | * This method returns the currently displayed message.
77 | *
78 | * @return The currently displayed message.
79 | */
80 | byte[] getMessage();
81 |
82 | /**
83 | * This method is used to determine whether the currently displayed message
84 | * has been modified by the user. The hosting editor will always call
85 | * getMessage()
before calling this method, so any pending
86 | * edits should be completed within
87 | * getMessage()
.
88 | *
89 | * @return The method should return
90 | * true
if the user has modified the current message since it
91 | * was first displayed.
92 | */
93 | boolean isModified();
94 |
95 | /**
96 | * This method is used to retrieve the data that is currently selected by
97 | * the user.
98 | *
99 | * @return The data that is currently selected by the user. This may be
100 | * null
if no selection is currently made.
101 | */
102 | byte[] getSelectedData();
103 | }
104 |
--------------------------------------------------------------------------------
/src/burp/IMessageEditorTabFactory.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IMessageEditorTabFactory.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerMessageEditorTabFactory()
to
15 | * register a factory for custom message editor tabs. This allows extensions to
16 | * provide custom rendering or editing of HTTP messages, within Burp's own HTTP
17 | * editor.
18 | */
19 | public interface IMessageEditorTabFactory
20 | {
21 | /**
22 | * Burp will call this method once for each HTTP message editor, and the
23 | * factory should provide a new instance of an
24 | * IMessageEditorTab
object.
25 | *
26 | * @param controller An
27 | * IMessageEditorController
object, which the new tab can query
28 | * to retrieve details about the currently displayed message. This may be
29 | * null
for extension-invoked message editors where the
30 | * extension has not provided an editor controller.
31 | * @param editable Indicates whether the hosting editor is editable or
32 | * read-only.
33 | * @return A new
34 | * IMessageEditorTab
object for use within the message editor.
35 | */
36 | IMessageEditorTab createNewInstance(IMessageEditorController controller,
37 | boolean editable);
38 | }
39 |
--------------------------------------------------------------------------------
/src/burp/IParameter.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IParameter.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 | * This interface is used to hold details about an HTTP request parameter.
14 | */
15 | public interface IParameter
16 | {
17 | /**
18 | * Used to indicate a parameter within the URL query string.
19 | */
20 | static final byte PARAM_URL = 0;
21 | /**
22 | * Used to indicate a parameter within the message body.
23 | */
24 | static final byte PARAM_BODY = 1;
25 | /**
26 | * Used to indicate an HTTP cookie.
27 | */
28 | static final byte PARAM_COOKIE = 2;
29 | /**
30 | * Used to indicate an item of data within an XML structure.
31 | */
32 | static final byte PARAM_XML = 3;
33 | /**
34 | * Used to indicate the value of a tag attribute within an XML structure.
35 | */
36 | static final byte PARAM_XML_ATTR = 4;
37 | /**
38 | * Used to indicate the value of a parameter attribute within a multi-part
39 | * message body (such as the name of an uploaded file).
40 | */
41 | static final byte PARAM_MULTIPART_ATTR = 5;
42 | /**
43 | * Used to indicate an item of data within a JSON structure.
44 | */
45 | static final byte PARAM_JSON = 6;
46 |
47 | /**
48 | * This method is used to retrieve the parameter type.
49 | *
50 | * @return The parameter type. The available types are defined within this
51 | * interface.
52 | */
53 | byte getType();
54 |
55 | /**
56 | * This method is used to retrieve the parameter name.
57 | *
58 | * @return The parameter name.
59 | */
60 | String getName();
61 |
62 | /**
63 | * This method is used to retrieve the parameter value.
64 | *
65 | * @return The parameter value.
66 | */
67 | String getValue();
68 |
69 | /**
70 | * This method is used to retrieve the start offset of the parameter name
71 | * within the HTTP request.
72 | *
73 | * @return The start offset of the parameter name within the HTTP request,
74 | * or -1 if the parameter is not associated with a specific request.
75 | */
76 | int getNameStart();
77 |
78 | /**
79 | * This method is used to retrieve the end offset of the parameter name
80 | * within the HTTP request.
81 | *
82 | * @return The end offset of the parameter name within the HTTP request, or
83 | * -1 if the parameter is not associated with a specific request.
84 | */
85 | int getNameEnd();
86 |
87 | /**
88 | * This method is used to retrieve the start offset of the parameter value
89 | * within the HTTP request.
90 | *
91 | * @return The start offset of the parameter value within the HTTP request,
92 | * or -1 if the parameter is not associated with a specific request.
93 | */
94 | int getValueStart();
95 |
96 | /**
97 | * This method is used to retrieve the end offset of the parameter value
98 | * within the HTTP request.
99 | *
100 | * @return The end offset of the parameter value within the HTTP request, or
101 | * -1 if the parameter is not associated with a specific request.
102 | */
103 | int getValueEnd();
104 | }
105 |
--------------------------------------------------------------------------------
/src/burp/IProxyListener.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IProxyListener.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerProxyListener()
to register a
15 | * Proxy listener. The listener will be notified of requests and responses being
16 | * processed by the Proxy tool. Extensions can perform custom analysis or
17 | * modification of these messages, and control in-UI message interception, by
18 | * registering a proxy listener.
19 | */
20 | public interface IProxyListener
21 | {
22 | /**
23 | * This method is invoked when an HTTP message is being processed by the
24 | * Proxy.
25 | *
26 | * @param messageIsRequest Indicates whether the HTTP message is a request
27 | * or a response.
28 | * @param message An
29 | * IInterceptedProxyMessage
object that extensions can use to
30 | * query and update details of the message, and control whether the message
31 | * should be intercepted and displayed to the user for manual review or
32 | * modification.
33 | */
34 | void processProxyMessage(
35 | boolean messageIsRequest,
36 | IInterceptedProxyMessage message);
37 | }
38 |
--------------------------------------------------------------------------------
/src/burp/IRequestInfo.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IRequestInfo.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 is used to retrieve key details about an HTTP request.
17 | * Extensions can obtain an
18 | * IRequestInfo
object for a given request by calling
19 | * IExtensionHelpers.analyzeRequest()
.
20 | */
21 | public interface IRequestInfo
22 | {
23 | /**
24 | * Used to indicate that there is no content.
25 | */
26 | static final byte CONTENT_TYPE_NONE = 0;
27 | /**
28 | * Used to indicate URL-encoded content.
29 | */
30 | static final byte CONTENT_TYPE_URL_ENCODED = 1;
31 | /**
32 | * Used to indicate multi-part content.
33 | */
34 | static final byte CONTENT_TYPE_MULTIPART = 2;
35 | /**
36 | * Used to indicate XML content.
37 | */
38 | static final byte CONTENT_TYPE_XML = 3;
39 | /**
40 | * Used to indicate JSON content.
41 | */
42 | static final byte CONTENT_TYPE_JSON = 4;
43 | /**
44 | * Used to indicate AMF content.
45 | */
46 | static final byte CONTENT_TYPE_AMF = 5;
47 | /**
48 | * Used to indicate unknown content.
49 | */
50 | static final byte CONTENT_TYPE_UNKNOWN = -1;
51 |
52 | /**
53 | * This method is used to obtain the HTTP method used in the request.
54 | *
55 | * @return The HTTP method used in the request.
56 | */
57 | String getMethod();
58 |
59 | /**
60 | * This method is used to obtain the URL in the request.
61 | *
62 | * @return The URL in the request.
63 | */
64 | URL getUrl();
65 |
66 | /**
67 | * This method is used to obtain the HTTP headers contained in the request.
68 | *
69 | * @return The HTTP headers contained in the request.
70 | */
71 | List getHeaders();
72 |
73 | /**
74 | * This method is used to obtain the parameters contained in the request.
75 | *
76 | * @return The parameters contained in the request.
77 | */
78 | List getParameters();
79 |
80 | /**
81 | * This method is used to obtain the offset within the request where the
82 | * message body begins.
83 | *
84 | * @return The offset within the request where the message body begins.
85 | */
86 | int getBodyOffset();
87 |
88 | /**
89 | * This method is used to obtain the content type of the message body.
90 | *
91 | * @return An indication of the content type of the message body. Available
92 | * types are defined within this interface.
93 | */
94 | byte getContentType();
95 | }
96 |
--------------------------------------------------------------------------------
/src/burp/IResponseInfo.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IResponseInfo.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 |
14 | /**
15 | * This interface is used to retrieve key details about an HTTP response.
16 | * Extensions can obtain an
17 | * IResponseInfo
object for a given response by calling
18 | * IExtensionHelpers.analyzeResponse()
.
19 | */
20 | public interface IResponseInfo
21 | {
22 | /**
23 | * This method is used to obtain the HTTP headers contained in the response.
24 | *
25 | * @return The HTTP headers contained in the response.
26 | */
27 | List getHeaders();
28 |
29 | /**
30 | * This method is used to obtain the offset within the response where the
31 | * message body begins.
32 | *
33 | * @return The offset within the response where the message body begins.
34 | */
35 | int getBodyOffset();
36 |
37 | /**
38 | * This method is used to obtain the HTTP status code contained in the
39 | * response.
40 | *
41 | * @return The HTTP status code contained in the response.
42 | */
43 | short getStatusCode();
44 |
45 | /**
46 | * This method is used to obtain details of the HTTP cookies set in the
47 | * response.
48 | *
49 | * @return A list of ICookie
objects representing the cookies
50 | * set in the response, if any.
51 | */
52 | List getCookies();
53 |
54 | /**
55 | * This method is used to obtain the MIME type of the response, as stated in
56 | * the HTTP headers.
57 | *
58 | * @return A textual label for the stated MIME type, or an empty String if
59 | * this is not known or recognized. The possible labels are the same as
60 | * those used in the main Burp UI.
61 | */
62 | String getStatedMimeType();
63 |
64 | /**
65 | * This method is used to obtain the MIME type of the response, as inferred
66 | * from the contents of the HTTP message body.
67 | *
68 | * @return A textual label for the inferred MIME type, or an empty String if
69 | * this is not known or recognized. The possible labels are the same as
70 | * those used in the main Burp UI.
71 | */
72 | String getInferredMimeType();
73 | }
74 |
--------------------------------------------------------------------------------
/src/burp/IScanIssue.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IScanIssue.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 | * This interface is used to retrieve details of Scanner issues. Extensions can
14 | * obtain details of issues by registering an
15 | * IScannerListener
or by calling
16 | * IBurpExtenderCallbacks.getScanIssues()
. Extensions can also add
17 | * custom Scanner issues by registering an
18 | * IScannerCheck
or calling
19 | * IBurpExtenderCallbacks.addScanIssue()
, and providing their own
20 | * implementations of this interface
21 | */
22 | public interface IScanIssue
23 | {
24 | /**
25 | * This method returns the URL for which the issue was generated.
26 | *
27 | * @return The URL for which the issue was generated.
28 | */
29 | java.net.URL getUrl();
30 |
31 | /**
32 | * This method returns the name of the issue type.
33 | *
34 | * @return The name of the issue type (e.g. "SQL injection").
35 | */
36 | String getIssueName();
37 |
38 | /**
39 | * This method returns a numeric identifier of the issue type. See the Burp
40 | * Scanner help documentation for a listing of all the issue types.
41 | *
42 | * @return A numeric identifier of the issue type.
43 | */
44 | int getIssueType();
45 |
46 | /**
47 | * This method returns the issue severity level.
48 | *
49 | * @return The issue severity level. Expected values are "High", "Medium",
50 | * "Low", "Information" or "False positive".
51 | *
52 | */
53 | String getSeverity();
54 |
55 | /**
56 | * This method returns the issue confidence level.
57 | *
58 | * @return The issue confidence level. Expected values are "Certain", "Firm"
59 | * or "Tentative".
60 | */
61 | String getConfidence();
62 |
63 | /**
64 | * This method returns a background description for this type of issue.
65 | *
66 | * @return A background description for this type of issue, or
67 | * null
if none applies.
68 | */
69 | String getIssueBackground();
70 |
71 | /**
72 | * This method returns a background description of the remediation for this
73 | * type of issue.
74 | *
75 | * @return A background description of the remediation for this type of
76 | * issue, or
77 | * null
if none applies.
78 | */
79 | String getRemediationBackground();
80 |
81 | /**
82 | * This method returns detailed information about this specific instance of
83 | * the issue.
84 | *
85 | * @return Detailed information about this specific instance of the issue,
86 | * or
87 | * null
if none applies.
88 | */
89 | String getIssueDetail();
90 |
91 | /**
92 | * This method returns detailed information about the remediation for this
93 | * specific instance of the issue.
94 | *
95 | * @return Detailed information about the remediation for this specific
96 | * instance of the issue, or
97 | * null
if none applies.
98 | */
99 | String getRemediationDetail();
100 |
101 | /**
102 | * This method returns the HTTP messages on the basis of which the issue was
103 | * generated.
104 | *
105 | * @return The HTTP messages on the basis of which the issue was generated.
106 | * Note: The items in this array should be instances of
107 | * IHttpRequestResponseWithMarkers
if applicable, so that
108 | * details of the relevant portions of the request and response messages are
109 | * available.
110 | */
111 | IHttpRequestResponse[] getHttpMessages();
112 |
113 | /**
114 | * This method returns the HTTP service for which the issue was generated.
115 | *
116 | * @return The HTTP service for which the issue was generated.
117 | */
118 | IHttpService getHttpService();
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/src/burp/IScanQueueItem.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IScanQueueItem.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 | * This interface is used to retrieve details of items in the Burp Scanner
14 | * active scan queue. Extensions can obtain references to scan queue items by
15 | * calling
16 | * IBurpExtenderCallbacks.doActiveScan()
.
17 | */
18 | public interface IScanQueueItem
19 | {
20 | /**
21 | * This method returns a description of the status of the scan queue item.
22 | *
23 | * @return A description of the status of the scan queue item.
24 | */
25 | String getStatus();
26 |
27 | /**
28 | * This method returns an indication of the percentage completed for the
29 | * scan queue item.
30 | *
31 | * @return An indication of the percentage completed for the scan queue
32 | * item.
33 | */
34 | byte getPercentageComplete();
35 |
36 | /**
37 | * This method returns the number of requests that have been made for the
38 | * scan queue item.
39 | *
40 | * @return The number of requests that have been made for the scan queue
41 | * item.
42 | */
43 | int getNumRequests();
44 |
45 | /**
46 | * This method returns the number of network errors that have occurred for
47 | * the scan queue item.
48 | *
49 | * @return The number of network errors that have occurred for the scan
50 | * queue item.
51 | */
52 | int getNumErrors();
53 |
54 | /**
55 | * This method returns the number of attack insertion points being used for
56 | * the scan queue item.
57 | *
58 | * @return The number of attack insertion points being used for the scan
59 | * queue item.
60 | */
61 | int getNumInsertionPoints();
62 |
63 | /**
64 | * This method allows the scan queue item to be canceled.
65 | */
66 | void cancel();
67 |
68 | /**
69 | * This method returns details of the issues generated for the scan queue
70 | * item. Note: different items within the scan queue may contain
71 | * duplicated versions of the same issues - for example, if the same request
72 | * has been scanned multiple times. Duplicated issues are consolidated in
73 | * the main view of scan results. Extensions can register an
74 | * IScannerListener
to get details only of unique, newly
75 | * discovered Scanner issues post-consolidation.
76 | *
77 | * @return Details of the issues generated for the scan queue item.
78 | */
79 | IScanIssue[] getIssues();
80 | }
81 |
--------------------------------------------------------------------------------
/src/burp/IScannerCheck.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IScannerCheck.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 |
14 | /**
15 | * Extensions can implement this interface and then call
16 | * IBurpExtenderCallbacks.registerScannerCheck()
to register a
17 | * custom Scanner check. When performing scanning, Burp will ask the check to
18 | * perform active or passive scanning on the base request, and report any
19 | * Scanner issues that are identified.
20 | */
21 | public interface IScannerCheck
22 | {
23 |
24 | /**
25 | * The Scanner invokes this method for each base request / response that is
26 | * passively scanned. Note: Extensions should only analyze the
27 | * HTTP messages provided during passive scanning, and should not make any
28 | * new HTTP requests of their own.
29 | *
30 | * @param baseRequestResponse The base HTTP request / response that should
31 | * be passively scanned.
32 | * @return A list of IScanIssue
objects, or null
33 | * if no issues are identified.
34 | */
35 | List doPassiveScan(IHttpRequestResponse baseRequestResponse);
36 |
37 | /**
38 | * The Scanner invokes this method for each insertion point that is actively
39 | * scanned. Extensions may issue HTTP requests as required to carry out
40 | * active scanning, and should use the
41 | * IScannerInsertionPoint
object provided to build scan
42 | * requests for particular payloads.
43 | * Note:
44 | * Scan checks should submit raw non-encoded payloads to insertion points,
45 | * and the insertion point has responsibility for performing any data
46 | * encoding that is necessary given the nature and location of the insertion
47 | * point.
48 | *
49 | * @param baseRequestResponse The base HTTP request / response that should
50 | * be actively scanned.
51 | * @param insertionPoint An IScannerInsertionPoint
object that
52 | * can be queried to obtain details of the insertion point being tested, and
53 | * can be used to build scan requests for particular payloads.
54 | * @return A list of IScanIssue
objects, or null
55 | * if no issues are identified.
56 | */
57 | List doActiveScan(
58 | IHttpRequestResponse baseRequestResponse,
59 | IScannerInsertionPoint insertionPoint);
60 |
61 | /**
62 | * The Scanner invokes this method when the custom Scanner check has
63 | * reported multiple issues for the same URL path. This can arise either
64 | * because there are multiple distinct vulnerabilities, or because the same
65 | * (or a similar) request has been scanned more than once. The custom check
66 | * should determine whether the issues are duplicates. In most cases, where
67 | * a check uses distinct issue names or descriptions for distinct issues,
68 | * the consolidation process will simply be a matter of comparing these
69 | * features for the two issues.
70 | *
71 | * @param existingIssue An issue that was previously reported by this
72 | * Scanner check.
73 | * @param newIssue An issue at the same URL path that has been newly
74 | * reported by this Scanner check.
75 | * @return An indication of which issue(s) should be reported in the main
76 | * Scanner results. The method should return -1
to report the
77 | * existing issue only, 0
to report both issues, and
78 | * 1
to report the new issue only.
79 | */
80 | int consolidateDuplicateIssues(
81 | IScanIssue existingIssue,
82 | IScanIssue newIssue);
83 | }
84 |
--------------------------------------------------------------------------------
/src/burp/IScannerInsertionPoint.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IScannerInsertionPoint.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 | * This interface is used to define an insertion point for use by active Scanner
14 | * checks. Extensions can obtain instances of this interface by registering an
15 | * IScannerCheck
, or can create instances for use by Burp's own
16 | * scan checks by registering an
17 | * IScannerInsertionPointProvider
.
18 | */
19 | public interface IScannerInsertionPoint
20 | {
21 |
22 | /**
23 | * Used to indicate where the payload is inserted into the value of a URL
24 | * parameter.
25 | */
26 | static final byte INS_PARAM_URL = 0x00;
27 | /**
28 | * Used to indicate where the payload is inserted into the value of a body
29 | * parameter.
30 | */
31 | static final byte INS_PARAM_BODY = 0x01;
32 | /**
33 | * Used to indicate where the payload is inserted into the value of an HTTP
34 | * cookie.
35 | */
36 | static final byte INS_PARAM_COOKIE = 0x02;
37 | /**
38 | * Used to indicate where the payload is inserted into the value of an item
39 | * of data within an XML data structure.
40 | */
41 | static final byte INS_PARAM_XML = 0x03;
42 | /**
43 | * Used to indicate where the payload is inserted into the value of a tag
44 | * attribute within an XML structure.
45 | */
46 | static final byte INS_PARAM_XML_ATTR = 0x04;
47 | /**
48 | * Used to indicate where the payload is inserted into the value of a
49 | * parameter attribute within a multi-part message body (such as the name of
50 | * an uploaded file).
51 | */
52 | static final byte INS_PARAM_MULTIPART_ATTR = 0x05;
53 | /**
54 | * Used to indicate where the payload is inserted into the value of an item
55 | * of data within a JSON structure.
56 | */
57 | static final byte INS_PARAM_JSON = 0x06;
58 | /**
59 | * Used to indicate where the payload is inserted into the value of an AMF
60 | * parameter.
61 | */
62 | static final byte INS_PARAM_AMF = 0x07;
63 | /**
64 | * Used to indicate where the payload is inserted into the value of an HTTP
65 | * request header.
66 | */
67 | static final byte INS_HEADER = 0x20;
68 | /**
69 | * Used to indicate where the payload is inserted into a URL path folder.
70 | */
71 | static final byte INS_URL_PATH_FOLDER = 0x21;
72 | /**
73 | * Used to indicate where the payload is inserted into a URL path folder.
74 | * This is now deprecated; use INS_URL_PATH_FOLDER
instead.
75 | */
76 | @Deprecated
77 | static final byte INS_URL_PATH_REST = INS_URL_PATH_FOLDER;
78 | /**
79 | * Used to indicate where the payload is inserted into the name of an added
80 | * URL parameter.
81 | */
82 | static final byte INS_PARAM_NAME_URL = 0x22;
83 | /**
84 | * Used to indicate where the payload is inserted into the name of an added
85 | * body parameter.
86 | */
87 | static final byte INS_PARAM_NAME_BODY = 0x23;
88 | /**
89 | * Used to indicate where the payload is inserted into the body of the HTTP
90 | * request.
91 | */
92 | static final byte INS_ENTIRE_BODY = 0x24;
93 | /**
94 | * Used to indicate where the payload is inserted into the URL path
95 | * filename.
96 | */
97 | static final byte INS_URL_PATH_FILENAME = 0x25;
98 | /**
99 | * Used to indicate where the payload is inserted at a location manually
100 | * configured by the user.
101 | */
102 | static final byte INS_USER_PROVIDED = 0x40;
103 | /**
104 | * Used to indicate where the insertion point is provided by an
105 | * extension-registered
106 | * IScannerInsertionPointProvider
.
107 | */
108 | static final byte INS_EXTENSION_PROVIDED = 0x41;
109 | /**
110 | * Used to indicate where the payload is inserted at an unknown location
111 | * within the request.
112 | */
113 | static final byte INS_UNKNOWN = 0x7f;
114 |
115 | /**
116 | * This method returns the name of the insertion point.
117 | *
118 | * @return The name of the insertion point (for example, a description of a
119 | * particular request parameter).
120 | */
121 | String getInsertionPointName();
122 |
123 | /**
124 | * This method returns the base value for this insertion point.
125 | *
126 | * @return the base value that appears in this insertion point in the base
127 | * request being scanned, or null
if there is no value in the
128 | * base request that corresponds to this insertion point.
129 | */
130 | String getBaseValue();
131 |
132 | /**
133 | * This method is used to build a request with the specified payload placed
134 | * into the insertion point. There is no requirement for extension-provided
135 | * insertion points to adjust the Content-Length header in requests if the
136 | * body length has changed, although Burp-provided insertion points will
137 | * always do this and will return a request with a valid Content-Length
138 | * header.
139 | * Note:
140 | * Scan checks should submit raw non-encoded payloads to insertion points,
141 | * and the insertion point has responsibility for performing any data
142 | * encoding that is necessary given the nature and location of the insertion
143 | * point.
144 | *
145 | * @param payload The payload that should be placed into the insertion
146 | * point.
147 | * @return The resulting request.
148 | */
149 | byte[] buildRequest(byte[] payload);
150 |
151 | /**
152 | * This method is used to determine the offsets of the payload value within
153 | * the request, when it is placed into the insertion point. Scan checks may
154 | * invoke this method when reporting issues, so as to highlight the relevant
155 | * part of the request within the UI.
156 | *
157 | * @param payload The payload that should be placed into the insertion
158 | * point.
159 | * @return An int[2] array containing the start and end offsets of the
160 | * payload within the request, or null if this is not applicable (for
161 | * example, where the insertion point places a payload into a serialized
162 | * data structure, the raw payload may not literally appear anywhere within
163 | * the resulting request).
164 | */
165 | int[] getPayloadOffsets(byte[] payload);
166 |
167 | /**
168 | * This method returns the type of the insertion point.
169 | *
170 | * @return The type of the insertion point. Available types are defined in
171 | * this interface.
172 | */
173 | byte getInsertionPointType();
174 | }
175 |
--------------------------------------------------------------------------------
/src/burp/IScannerInsertionPointProvider.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IScannerInsertionPointProvider.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 |
14 | /**
15 | * Extensions can implement this interface and then call
16 | * IBurpExtenderCallbacks.registerScannerInsertionPointProvider()
17 | * to register a factory for custom Scanner insertion points.
18 | */
19 | public interface IScannerInsertionPointProvider
20 | {
21 | /**
22 | * When a request is actively scanned, the Scanner will invoke this method,
23 | * and the provider should provide a list of custom insertion points that
24 | * will be used in the scan. Note: these insertion points are used in
25 | * addition to those that are derived from Burp Scanner's configuration, and
26 | * those provided by any other Burp extensions.
27 | *
28 | * @param baseRequestResponse The base request that will be actively
29 | * scanned.
30 | * @return A list of
31 | * IScannerInsertionPoint
objects that should be used in the
32 | * scanning, or
33 | * null
if no custom insertion points are applicable for this
34 | * request.
35 | */
36 | List getInsertionPoints(
37 | IHttpRequestResponse baseRequestResponse);
38 | }
39 |
--------------------------------------------------------------------------------
/src/burp/IScannerListener.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IScannerListener.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerScannerListener()
to register a
15 | * Scanner listener. The listener will be notified of new issues that are
16 | * reported by the Scanner tool. Extensions can perform custom analysis or
17 | * logging of Scanner issues by registering a Scanner listener.
18 | */
19 | public interface IScannerListener
20 | {
21 | /**
22 | * This method is invoked when a new issue is added to Burp Scanner's
23 | * results.
24 | *
25 | * @param issue An
26 | * IScanIssue
object that the extension can query to obtain
27 | * details about the new issue.
28 | */
29 | void newScanIssue(IScanIssue issue);
30 | }
31 |
--------------------------------------------------------------------------------
/src/burp/IScopeChangeListener.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)IScopeChangeListener.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerScopeChangeListener()
to register
15 | * a scope change listener. The listener will be notified whenever a change
16 | * occurs to Burp's suite-wide target scope.
17 | */
18 | public interface IScopeChangeListener
19 | {
20 | /**
21 | * This method is invoked whenever a change occurs to Burp's suite-wide
22 | * target scope.
23 | */
24 | void scopeChanged();
25 | }
26 |
--------------------------------------------------------------------------------
/src/burp/ISessionHandlingAction.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)ISessionHandlingAction.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 | * Extensions can implement this interface and then call
14 | * IBurpExtenderCallbacks.registerSessionHandlingAction()
to
15 | * register a custom session handling action. Each registered action will be
16 | * available within the session handling rule UI for the user to select as a
17 | * rule action. Users can choose to invoke an action directly in its own right,
18 | * or following execution of a macro.
19 | */
20 | public interface ISessionHandlingAction
21 | {
22 | /**
23 | * This method is used by Burp to obtain the name of the session handling
24 | * action. This will be displayed as an option within the session handling
25 | * rule editor when the user selects to execute an extension-provided
26 | * action.
27 | *
28 | * @return The name of the action.
29 | */
30 | String getActionName();
31 |
32 | /**
33 | * This method is invoked when the session handling action should be
34 | * executed. This may happen as an action in its own right, or as a
35 | * sub-action following execution of a macro.
36 | *
37 | * @param currentRequest The base request that is currently being processed.
38 | * The action can query this object to obtain details about the base
39 | * request. It can issue additional requests of its own if necessary, and
40 | * can use the setter methods on this object to update the base request.
41 | * @param macroItems If the action is invoked following execution of a
42 | * macro, this parameter contains the result of executing the macro.
43 | * Otherwise, it is
44 | * null
. Actions can use the details of the macro items to
45 | * perform custom analysis of the macro to derive values of non-standard
46 | * session handling tokens, etc.
47 | */
48 | void performAction(
49 | IHttpRequestResponse currentRequest,
50 | IHttpRequestResponse[] macroItems);
51 | }
52 |
--------------------------------------------------------------------------------
/src/burp/ITab.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)ITab.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 |
14 | /**
15 | * This interface is used to provide Burp with details of a custom tab that will
16 | * be added to Burp's UI, using a method such as
17 | * IBurpExtenderCallbacks.addSuiteTab()
.
18 | */
19 | public interface ITab
20 | {
21 | /**
22 | * Burp uses this method to obtain the caption that should appear on the
23 | * custom tab when it is displayed.
24 | *
25 | * @return The caption that should appear on the custom tab when it is
26 | * displayed.
27 | */
28 | String getTabCaption();
29 |
30 | /**
31 | * Burp uses this method to obtain the component that should be used as the
32 | * contents of the custom tab when it is displayed.
33 | *
34 | * @return The component that should be used as the contents of the custom
35 | * tab when it is displayed.
36 | */
37 | Component getUiComponent();
38 | }
39 |
--------------------------------------------------------------------------------
/src/burp/ITempFile.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)ITempFile.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 | * This interface is used to hold details of a temporary file that has been
14 | * created via a call to
15 | * IBurpExtenderCallbacks.saveToTempFile()
.
16 | *
17 | */
18 | public interface ITempFile
19 | {
20 | /**
21 | * This method is used to retrieve the contents of the buffer that was saved
22 | * in the temporary file.
23 | *
24 | * @return The contents of the buffer that was saved in the temporary file.
25 | */
26 | byte[] getBuffer();
27 |
28 | /**
29 | * This method is deprecated and no longer performs any action.
30 | */
31 | @Deprecated
32 | void delete();
33 | }
34 |
--------------------------------------------------------------------------------
/src/burp/ITextEditor.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | /*
4 | * @(#)ITextEditor.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 |
14 | /**
15 | * This interface is used to provide extensions with an instance of Burp's raw
16 | * text editor, for the extension to use in its own UI. Extensions should call
17 | * IBurpExtenderCallbacks.createTextEditor()
to obtain an instance
18 | * of this interface.
19 | */
20 | public interface ITextEditor
21 | {
22 | /**
23 | * This method returns the UI component of the editor, for extensions to add
24 | * to their own UI.
25 | *
26 | * @return The UI component of the editor.
27 | */
28 | Component getComponent();
29 |
30 | /**
31 | * This method is used to control whether the editor is currently editable.
32 | * This status can be toggled on and off as required.
33 | *
34 | * @param editable Indicates whether the editor should be currently
35 | * editable.
36 | */
37 | void setEditable(boolean editable);
38 |
39 | /**
40 | * This method is used to update the currently displayed text in the editor.
41 | *
42 | * @param text The text to be displayed.
43 | */
44 | void setText(byte[] text);
45 |
46 | /**
47 | * This method is used to retrieve the currently displayed text.
48 | *
49 | * @return The currently displayed text.
50 | */
51 | byte[] getText();
52 |
53 | /**
54 | * This method is used to determine whether the user has modified the
55 | * contents of the editor.
56 | *
57 | * @return An indication of whether the user has modified the contents of
58 | * the editor since the last call to
59 | * setText()
.
60 | */
61 | boolean isTextModified();
62 |
63 | /**
64 | * This method is used to obtain the currently selected text.
65 | *
66 | * @return The currently selected text, or
67 | * null
if the user has not made any selection.
68 | */
69 | byte[] getSelectedText();
70 |
71 | /**
72 | * This method can be used to retrieve the bounds of the user's selection
73 | * into the displayed text, if applicable.
74 | *
75 | * @return An int[2] array containing the start and end offsets of the
76 | * user's selection within the displayed text. If the user has not made any
77 | * selection in the current message, both offsets indicate the position of
78 | * the caret within the editor.
79 | */
80 | int[] getSelectionBounds();
81 |
82 | /**
83 | * This method is used to update the search expression that is shown in the
84 | * search bar below the editor. The editor will automatically highlight any
85 | * regions of the displayed text that match the search expression.
86 | *
87 | * @param expression The search expression.
88 | */
89 | void setSearchExpression(String expression);
90 | }
91 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/FlowAddNewIssue.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
525 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/FlowAddNewIssue.java:
--------------------------------------------------------------------------------
1 | package hvqzao.flow;
2 |
3 | import burp.IBurpExtenderCallbacks;
4 | import burp.IHttpRequestResponse;
5 | import burp.IHttpService;
6 | import burp.IScanIssue;
7 | import java.awt.Color;
8 | import java.awt.Component;
9 | import java.awt.KeyboardFocusManager;
10 | import java.awt.event.ActionEvent;
11 | import java.awt.event.ActionListener;
12 | import java.io.PrintWriter;
13 | import java.net.URL;
14 | import java.util.ArrayList;
15 | import java.util.Arrays;
16 | import java.util.HashSet;
17 | import java.util.List;
18 | import javax.swing.JButton;
19 |
20 | import java.util.Random;
21 | import java.util.Set;
22 | import javax.swing.DefaultListModel;
23 | import javax.swing.JTextArea;
24 | import javax.swing.KeyStroke;
25 | import javax.swing.text.BadLocationException;
26 | import static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter;
27 |
28 | public class FlowAddNewIssue extends javax.swing.JPanel {
29 |
30 | private final DefaultHighlightPainter p = new DefaultHighlightPainter(new Color(255, 197, 153));
31 | private final Random rand;
32 | private final IBurpExtenderCallbacks callbacks;
33 | private final FlowExtension.FlowEntry flowEntry;
34 | private final IHttpRequestResponse messageInfo;
35 | private final DefaultListModel highlightListModel;
36 | private final PrintWriter stderr;
37 |
38 | /**
39 | * Creates new form FlowAddIssue
40 | *
41 | * @param callbacks
42 | * @param flowEntry
43 | */
44 | public FlowAddNewIssue(final IBurpExtenderCallbacks callbacks, final FlowExtension.FlowEntry flowEntry) {
45 | this.callbacks = callbacks;
46 | stderr = FlowExtension.getStderr();
47 |
48 | this.flowEntry = flowEntry;
49 |
50 | initComponents();
51 |
52 | rand = new Random();
53 |
54 | callbacks.customizeUiComponent(severityCombo);
55 | callbacks.customizeUiComponent(confidenceCombo);
56 | callbacks.customizeUiComponent(nameField);
57 | callbacks.customizeUiComponent(issueDetailArea);
58 | issueDetailArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
59 | issueDetailArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
60 | //issueDetailArea.addFocusListener(new FocusListener() {
61 | // @Override
62 | // public void focusGained(FocusEvent e) {
63 | // JTextArea c = (JTextArea) e.getComponent();
64 | // c.select(0, c.getText().length());
65 | // }
66 | //
67 | // @Override
68 | // public void focusLost(FocusEvent e) {
69 | // JTextArea c = (JTextArea) e.getComponent();
70 | // c.select(0, 0);
71 | // }
72 | //});
73 | callbacks.customizeUiComponent(remediationDetailArea);
74 | remediationDetailArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
75 | remediationDetailArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
76 | callbacks.customizeUiComponent(issueBackgroundArea);
77 | issueBackgroundArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
78 | issueBackgroundArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
79 | callbacks.customizeUiComponent(remediationBackgroundArea);
80 | remediationBackgroundArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
81 | remediationBackgroundArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
82 |
83 | jSplitPane2.setDividerLocation(0.5d);
84 |
85 | highlightListModel = new DefaultListModel();
86 | highlightList.setModel(highlightListModel);
87 |
88 | messageInfo = flowEntry.getMessageInfo();
89 |
90 | request.customizeUiComponent(callbacks);
91 | request.setText(messageInfo.getRequest());
92 |
93 | response.customizeUiComponent(callbacks);
94 | response.setText(messageInfo.getResponse());
95 |
96 | callbacks.customizeUiComponent(addHighlight);
97 | addHighlight.addActionListener(new ActionListener() {
98 | @Override
99 | public void actionPerformed(ActionEvent e) {
100 | if (reqRespPane.isVisible()) {
101 | try {
102 | JTextArea c;
103 | boolean isRequest = request.hasFocus();
104 | if (isRequest) {
105 | c = request.getEditor();
106 | } else {
107 | c = response.getEditor();
108 | }
109 | int start = c.getSelectionStart();
110 | int end = c.getSelectionEnd();
111 | String text = c.getSelectedText();
112 | if (text == null) {
113 | return;
114 | }
115 | Object tag;
116 | try {
117 | tag = c.getHighlighter().addHighlight(start, end, p);
118 | } catch (BadLocationException ex) {
119 | return;
120 | }
121 | c.select(0, 0);
122 | Highlight highlight = new Highlight(isRequest, tag, start, end, text);
123 | highlightListModel.addElement(highlight);
124 | highlightList.setSelectedIndex(highlightListModel.indexOf(highlight));
125 | } catch (Exception ex) {
126 | ex.printStackTrace(stderr);
127 | }
128 | }
129 | }
130 | });
131 | callbacks.customizeUiComponent(removeHighlight);
132 | removeHighlight.addActionListener(new ActionListener() {
133 | @Override
134 | public void actionPerformed(ActionEvent e) {
135 | try {
136 | int index = highlightList.getSelectedIndex();
137 | Highlight highlight = (Highlight) highlightListModel.get(index);
138 | highlightListModel.removeElement(highlight);
139 | JTextArea c;
140 | if (highlight.isRequest) {
141 | c = request.getEditor();
142 | } else {
143 | c = response.getEditor();
144 | }
145 | c.getHighlighter().removeHighlight(highlight.tag);
146 | if (highlightList.getSelectedIndex() == -1 && highlightListModel.isEmpty() == false) {
147 | highlightList.setSelectedIndex(0);
148 | }
149 | } catch (Exception ex) {
150 | ex.printStackTrace(stderr);
151 | }
152 | }
153 | });
154 | callbacks.customizeUiComponent(highlightList);
155 | }
156 |
157 | public boolean dataValidation() {
158 | if (nameField.getText().length() == 0) {
159 | nameError.setText("Name must be set!");
160 | return false;
161 | }
162 | return true;
163 | }
164 |
165 | public JButton getHelpButton() {
166 | return helpButton;
167 | }
168 |
169 | /**
170 | * Get {@link IScanIssue} object.
171 | *
172 | * @return
173 | */
174 | public IScanIssue getIssue() {
175 | try {
176 | //IHttpRequestResponsePersisted reqResp = flowEntry.getMessageInfoPersisted();
177 | return new IScanIssue() {
178 | @Override
179 | public URL getUrl() {
180 | return flowEntry.getUrl();
181 | }
182 |
183 | @Override
184 | public String getIssueName() {
185 | return nameField.getText();
186 | }
187 |
188 | @Override
189 | public int getIssueType() {
190 | return 1073741822 + rand.nextInt(1073741822);
191 | }
192 |
193 | @Override
194 | public String getSeverity() {
195 | return (String) severityCombo.getSelectedItem();
196 | }
197 |
198 | @Override
199 | public String getConfidence() {
200 | return (String) confidenceCombo.getSelectedItem();
201 | }
202 |
203 | @Override
204 | public String getIssueBackground() {
205 | return issueBackgroundArea.getText();
206 | }
207 |
208 | @Override
209 | public String getRemediationBackground() {
210 | return remediationBackgroundArea.getText();
211 | }
212 |
213 | @Override
214 | public String getIssueDetail() {
215 | return issueDetailArea.getText();
216 | }
217 |
218 | @Override
219 | public String getRemediationDetail() {
220 | return remediationDetailArea.getText();
221 | }
222 |
223 | @Override
224 | public IHttpRequestResponse[] getHttpMessages() {
225 | List requestMarkers = new ArrayList<>();
226 | List responseMarkers = new ArrayList<>();
227 | for (int i = 0; i < highlightListModel.size(); i++) {
228 | Highlight highlight = (Highlight) highlightListModel.get(i);
229 | List markers;
230 | if (highlight.isRequest) {
231 | markers = requestMarkers;
232 | } else {
233 | markers = responseMarkers;
234 | }
235 | markers.add(new int[]{highlight.start, highlight.end});
236 | }
237 | return new IHttpRequestResponse[]{callbacks.applyMarkers(messageInfo, requestMarkers, responseMarkers)};
238 | }
239 |
240 | @Override
241 | public IHttpService getHttpService() {
242 | return flowEntry.getService();
243 | }
244 | };
245 | } catch (Exception ex) {
246 | ex.printStackTrace(stderr);
247 | return null;
248 | }
249 | }
250 |
251 | /**
252 | * This method is called from within the constructor to initialize the form.
253 | * WARNING: Do NOT modify this code. The content of this method is always
254 | * regenerated by the Form Editor.
255 | */
256 | @SuppressWarnings("unchecked")
257 | // //GEN-BEGIN:initComponents
258 | private void initComponents() {
259 |
260 | helpButton = new javax.swing.JButton();
261 | jLabel1 = new javax.swing.JLabel();
262 | jSplitPane1 = new javax.swing.JSplitPane();
263 | jPanel1 = new javax.swing.JPanel();
264 | jLabel6 = new javax.swing.JLabel();
265 | jScrollPane1 = new javax.swing.JScrollPane();
266 | issueBackgroundArea = new javax.swing.JTextArea();
267 | jScrollPane2 = new javax.swing.JScrollPane();
268 | remediationBackgroundArea = new javax.swing.JTextArea();
269 | jLabel7 = new javax.swing.JLabel();
270 | jLabel8 = new javax.swing.JLabel();
271 | jScrollPane3 = new javax.swing.JScrollPane();
272 | issueDetailArea = new javax.swing.JTextArea();
273 | severityCombo = new javax.swing.JComboBox<>();
274 | nameField = new javax.swing.JTextField();
275 | jLabel2 = new javax.swing.JLabel();
276 | confidenceCombo = new javax.swing.JComboBox<>();
277 | jLabel3 = new javax.swing.JLabel();
278 | jLabel4 = new javax.swing.JLabel();
279 | jLabel9 = new javax.swing.JLabel();
280 | jLabel5 = new javax.swing.JLabel();
281 | jScrollPane4 = new javax.swing.JScrollPane();
282 | remediationDetailArea = new javax.swing.JTextArea();
283 | nameError = new javax.swing.JLabel();
284 | jPanel5 = new javax.swing.JPanel();
285 | reqRespPane = new javax.swing.JPanel();
286 | jSplitPane2 = new javax.swing.JSplitPane();
287 | jPanel2 = new javax.swing.JPanel();
288 | jLabel10 = new javax.swing.JLabel();
289 | request = new hvqzao.flow.ui.Editor();
290 | jPanel3 = new javax.swing.JPanel();
291 | jLabel11 = new javax.swing.JLabel();
292 | response = new hvqzao.flow.ui.Editor();
293 | jPanel4 = new javax.swing.JPanel();
294 | addHighlight = new javax.swing.JButton();
295 | removeHighlight = new javax.swing.JButton();
296 | jScrollPane7 = new javax.swing.JScrollPane();
297 | highlightList = new javax.swing.JList<>();
298 |
299 | setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
300 |
301 | helpButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
302 | helpButton.setMaximumSize(new java.awt.Dimension(24, 24));
303 | helpButton.setMinimumSize(new java.awt.Dimension(24, 24));
304 | helpButton.setPreferredSize(new java.awt.Dimension(24, 24));
305 |
306 | jLabel1.setText("Add new sitemap issue");
307 | jLabel1.setToolTipText("");
308 |
309 | jSplitPane1.setBorder(null);
310 | jSplitPane1.setDividerLocation(400);
311 | jSplitPane1.setDividerSize(3);
312 |
313 | jLabel6.setText("Issue background:");
314 |
315 | issueBackgroundArea.setColumns(20);
316 | issueBackgroundArea.setRows(5);
317 | jScrollPane1.setViewportView(issueBackgroundArea);
318 |
319 | remediationBackgroundArea.setColumns(20);
320 | remediationBackgroundArea.setRows(5);
321 | jScrollPane2.setViewportView(remediationBackgroundArea);
322 |
323 | jLabel7.setText("Remediation background:");
324 |
325 | jLabel8.setText("Issue detail:");
326 |
327 | issueDetailArea.setColumns(20);
328 | issueDetailArea.setRows(5);
329 | jScrollPane3.setViewportView(issueDetailArea);
330 |
331 | severityCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "High", "Medium", "Low", "Information" }));
332 |
333 | jLabel2.setText("This form allows adding new, custom finding.");
334 |
335 | confidenceCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Certain", "Firm", "Tentative" }));
336 |
337 | jLabel3.setText("Severity:");
338 |
339 | jLabel4.setText("Confidence:");
340 |
341 | jLabel9.setText("Remediation detail:");
342 |
343 | jLabel5.setText("Name:");
344 |
345 | remediationDetailArea.setColumns(20);
346 | remediationDetailArea.setRows(5);
347 | jScrollPane4.setViewportView(remediationDetailArea);
348 |
349 | nameError.setText(" ");
350 | nameError.setToolTipText("");
351 |
352 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
353 | jPanel1.setLayout(jPanel1Layout);
354 | jPanel1Layout.setHorizontalGroup(
355 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
356 | .addGroup(jPanel1Layout.createSequentialGroup()
357 | .addContainerGap()
358 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
359 | .addGroup(jPanel1Layout.createSequentialGroup()
360 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
361 | .addComponent(jLabel4)
362 | .addComponent(jLabel5)
363 | .addComponent(jLabel6)
364 | .addComponent(jLabel7)
365 | .addComponent(jLabel8)
366 | .addComponent(jLabel3)
367 | .addComponent(jLabel9))
368 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
369 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
370 | .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE)
371 | .addComponent(nameField)
372 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
373 | .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
374 | .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
375 | .addGroup(jPanel1Layout.createSequentialGroup()
376 | .addComponent(severityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
377 | .addGap(0, 0, Short.MAX_VALUE))
378 | .addGroup(jPanel1Layout.createSequentialGroup()
379 | .addComponent(confidenceCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
380 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
381 | .addComponent(nameError))))
382 | .addGroup(jPanel1Layout.createSequentialGroup()
383 | .addComponent(jLabel2)
384 | .addGap(0, 0, Short.MAX_VALUE)))
385 | .addContainerGap())
386 | );
387 | jPanel1Layout.setVerticalGroup(
388 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
389 | .addGroup(jPanel1Layout.createSequentialGroup()
390 | .addComponent(jLabel2)
391 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
392 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
393 | .addComponent(jLabel3)
394 | .addComponent(severityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
395 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
396 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
397 | .addComponent(jLabel4)
398 | .addComponent(confidenceCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
399 | .addComponent(nameError))
400 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
401 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
402 | .addComponent(jLabel5)
403 | .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
404 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
405 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
406 | .addComponent(jLabel8)
407 | .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
408 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
409 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
410 | .addComponent(jLabel9)
411 | .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
412 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
413 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
414 | .addComponent(jLabel6)
415 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
416 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
417 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
418 | .addComponent(jLabel7)
419 | .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
420 | .addContainerGap())
421 | );
422 |
423 | jSplitPane1.setLeftComponent(jPanel1);
424 |
425 | jSplitPane2.setBorder(null);
426 | jSplitPane2.setDividerLocation(185);
427 | jSplitPane2.setDividerSize(3);
428 | jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
429 | jSplitPane2.setResizeWeight(0.5);
430 |
431 | jLabel10.setText("Request");
432 |
433 | javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
434 | jPanel2.setLayout(jPanel2Layout);
435 | jPanel2Layout.setHorizontalGroup(
436 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
437 | .addGroup(jPanel2Layout.createSequentialGroup()
438 | .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
439 | .addContainerGap(133, Short.MAX_VALUE))
440 | .addComponent(request, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
441 | );
442 | jPanel2Layout.setVerticalGroup(
443 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
444 | .addGroup(jPanel2Layout.createSequentialGroup()
445 | .addGap(0, 0, 0)
446 | .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
447 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
448 | .addComponent(request, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)
449 | .addGap(0, 0, 0))
450 | );
451 |
452 | jSplitPane2.setTopComponent(jPanel2);
453 |
454 | jLabel11.setText("Response");
455 |
456 | javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
457 | jPanel3.setLayout(jPanel3Layout);
458 | jPanel3Layout.setHorizontalGroup(
459 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
460 | .addGroup(jPanel3Layout.createSequentialGroup()
461 | .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
462 | .addGap(0, 124, Short.MAX_VALUE))
463 | .addComponent(response, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
464 | );
465 | jPanel3Layout.setVerticalGroup(
466 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
467 | .addGroup(jPanel3Layout.createSequentialGroup()
468 | .addGap(4, 4, 4)
469 | .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
470 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
471 | .addComponent(response, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE))
472 | );
473 |
474 | jSplitPane2.setRightComponent(jPanel3);
475 |
476 | javax.swing.GroupLayout reqRespPaneLayout = new javax.swing.GroupLayout(reqRespPane);
477 | reqRespPane.setLayout(reqRespPaneLayout);
478 | reqRespPaneLayout.setHorizontalGroup(
479 | reqRespPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
480 | .addGroup(reqRespPaneLayout.createSequentialGroup()
481 | .addContainerGap()
482 | .addComponent(jSplitPane2)
483 | .addContainerGap())
484 | );
485 | reqRespPaneLayout.setVerticalGroup(
486 | reqRespPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
487 | .addComponent(jSplitPane2)
488 | );
489 |
490 | javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
491 | jPanel5.setLayout(jPanel5Layout);
492 | jPanel5Layout.setHorizontalGroup(
493 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
494 | .addComponent(reqRespPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
495 | );
496 | jPanel5Layout.setVerticalGroup(
497 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
498 | .addComponent(reqRespPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
499 | );
500 |
501 | jSplitPane1.setRightComponent(jPanel5);
502 |
503 | addHighlight.setText("Add Highlight");
504 |
505 | removeHighlight.setText("Remove Highlight");
506 |
507 | jScrollPane7.setViewportView(highlightList);
508 |
509 | javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
510 | jPanel4.setLayout(jPanel4Layout);
511 | jPanel4Layout.setHorizontalGroup(
512 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
513 | .addComponent(addHighlight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
514 | .addComponent(removeHighlight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
515 | .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
516 | );
517 | jPanel4Layout.setVerticalGroup(
518 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
519 | .addGroup(jPanel4Layout.createSequentialGroup()
520 | .addComponent(addHighlight)
521 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
522 | .addComponent(removeHighlight)
523 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
524 | .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
525 | .addContainerGap())
526 | );
527 |
528 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
529 | this.setLayout(layout);
530 | layout.setHorizontalGroup(
531 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
532 | .addGroup(layout.createSequentialGroup()
533 | .addContainerGap()
534 | .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
535 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
536 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
537 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
538 | .addGroup(layout.createSequentialGroup()
539 | .addGap(33, 33, 33)
540 | .addComponent(jSplitPane1)
541 | .addGap(0, 0, 0)
542 | .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
543 | .addContainerGap())
544 | );
545 | layout.setVerticalGroup(
546 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
547 | .addGroup(layout.createSequentialGroup()
548 | .addContainerGap()
549 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
550 | .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
551 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
552 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
553 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
554 | .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
555 | .addGroup(layout.createSequentialGroup()
556 | .addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
557 | .addContainerGap())))
558 | );
559 | }// //GEN-END:initComponents
560 |
561 |
562 | // Variables declaration - do not modify//GEN-BEGIN:variables
563 | private javax.swing.JButton addHighlight;
564 | private javax.swing.JComboBox confidenceCombo;
565 | private javax.swing.JButton helpButton;
566 | private javax.swing.JList highlightList;
567 | private javax.swing.JTextArea issueBackgroundArea;
568 | private javax.swing.JTextArea issueDetailArea;
569 | private javax.swing.JLabel jLabel1;
570 | private javax.swing.JLabel jLabel10;
571 | private javax.swing.JLabel jLabel11;
572 | private javax.swing.JLabel jLabel2;
573 | private javax.swing.JLabel jLabel3;
574 | private javax.swing.JLabel jLabel4;
575 | private javax.swing.JLabel jLabel5;
576 | private javax.swing.JLabel jLabel6;
577 | private javax.swing.JLabel jLabel7;
578 | private javax.swing.JLabel jLabel8;
579 | private javax.swing.JLabel jLabel9;
580 | private javax.swing.JPanel jPanel1;
581 | private javax.swing.JPanel jPanel2;
582 | private javax.swing.JPanel jPanel3;
583 | private javax.swing.JPanel jPanel4;
584 | private javax.swing.JPanel jPanel5;
585 | private javax.swing.JScrollPane jScrollPane1;
586 | private javax.swing.JScrollPane jScrollPane2;
587 | private javax.swing.JScrollPane jScrollPane3;
588 | private javax.swing.JScrollPane jScrollPane4;
589 | private javax.swing.JScrollPane jScrollPane7;
590 | private javax.swing.JSplitPane jSplitPane1;
591 | private javax.swing.JSplitPane jSplitPane2;
592 | private javax.swing.JLabel nameError;
593 | private javax.swing.JTextField nameField;
594 | private javax.swing.JTextArea remediationBackgroundArea;
595 | private javax.swing.JTextArea remediationDetailArea;
596 | private javax.swing.JButton removeHighlight;
597 | private javax.swing.JPanel reqRespPane;
598 | private hvqzao.flow.ui.Editor request;
599 | private hvqzao.flow.ui.Editor response;
600 | private javax.swing.JComboBox severityCombo;
601 | // End of variables declaration//GEN-END:variables
602 |
603 | public static class TransferFocus {
604 |
605 | /**
606 | * Patch the behaviour of a component. TAB transfers focus to the next
607 | * focusable component, SHIFT+TAB transfers focus to the previous
608 | * focusable component.
609 | *
610 | * @param c The component to be patched.
611 | */
612 | public static void patch(Component c) {
613 | Set strokes = new HashSet<>(Arrays.asList(KeyStroke.getKeyStroke("pressed TAB")));
614 | c.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, strokes);
615 | strokes = new HashSet<>(Arrays.asList(KeyStroke.getKeyStroke("shift pressed TAB")));
616 | c.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, strokes);
617 | }
618 | }
619 |
620 | private class Highlight {
621 |
622 | private final boolean isRequest;
623 | private final Object tag;
624 | private final int start;
625 | private final int end;
626 | private final String text;
627 |
628 | public Highlight(boolean isRequest, Object tag, int start, int end, String text) {
629 | this.isRequest = isRequest;
630 | this.tag = tag;
631 | this.start = start;
632 | this.end = end;
633 | this.text = text;
634 | }
635 |
636 | @Override
637 | public String toString() {
638 | return text + " (" + (isRequest ? "request" : "response") + ")";
639 | }
640 |
641 | }
642 | }
643 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/FlowOptionsPane.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
219 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/FlowOptionsPane.java:
--------------------------------------------------------------------------------
1 | package hvqzao.flow;
2 |
3 | import burp.IBurpExtenderCallbacks;
4 | import javax.swing.JButton;
5 | import javax.swing.JCheckBox;
6 | import javax.swing.JRadioButton;
7 | import javax.swing.JTextField;
8 |
9 | public class FlowOptionsPane extends javax.swing.JPanel {
10 |
11 | /**
12 | * Creates new form FlowFilterOptions
13 | */
14 | public FlowOptionsPane() {
15 | initComponents();
16 | }
17 |
18 | public FlowOptionsPane(IBurpExtenderCallbacks callbacks) {
19 | initComponents();
20 | callbacks.customizeUiComponent(Mode2);
21 | callbacks.customizeUiComponent(Mode1);
22 | callbacks.customizeUiComponent(autoPopulate);
23 | callbacks.customizeUiComponent(autoDelete);
24 | callbacks.customizeUiComponent(autoDeleteKeep);
25 | callbacks.customizeUiComponent(showReflections);
26 | callbacks.customizeUiComponent(showReflectionsCount);
27 | }
28 |
29 | public JButton getModeHelp() {
30 | return modeHelp;
31 | }
32 |
33 | public JRadioButton getMode1() {
34 | return Mode1;
35 | }
36 |
37 | public JRadioButton getMode2() {
38 | return Mode2;
39 | }
40 |
41 | public JButton getMiscHelp() {
42 | return miscHelp;
43 | }
44 |
45 | public JCheckBox getAutoPopulate() {
46 | return autoPopulate;
47 | }
48 |
49 | public JCheckBox getAutoDelete() {
50 | return autoDelete;
51 | }
52 |
53 | public JTextField getAutoDeleteKeep() {
54 | return autoDeleteKeep;
55 | }
56 |
57 | public JCheckBox getShowReflections() {
58 | return showReflections;
59 | }
60 |
61 | public JTextField getShowReflectionsCount() {
62 | return showReflectionsCount;
63 | }
64 |
65 | /**
66 | * This method is called from within the constructor to initialize the form.
67 | * WARNING: Do NOT modify this code. The content of this method is always
68 | * regenerated by the Form Editor.
69 | */
70 | @SuppressWarnings("unchecked")
71 | // //GEN-BEGIN:initComponents
72 | private void initComponents() {
73 |
74 | buttonGroup1 = new javax.swing.ButtonGroup();
75 | modeHelp = new javax.swing.JButton();
76 | jLabel1 = new javax.swing.JLabel();
77 | Mode2 = new javax.swing.JRadioButton();
78 | jLabel2 = new javax.swing.JLabel();
79 | Mode1 = new javax.swing.JRadioButton();
80 | jLabel3 = new javax.swing.JLabel();
81 | jSeparator1 = new javax.swing.JSeparator();
82 | miscHelp = new javax.swing.JButton();
83 | jLabel4 = new javax.swing.JLabel();
84 | autoDelete = new javax.swing.JCheckBox();
85 | autoDeleteKeep = new javax.swing.JTextField();
86 | autoPopulate = new javax.swing.JCheckBox();
87 | showReflections = new javax.swing.JCheckBox();
88 | showReflectionsCount = new javax.swing.JTextField();
89 |
90 | setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
91 |
92 | modeHelp.setMargin(new java.awt.Insets(0, 0, 0, 0));
93 | modeHelp.setMaximumSize(new java.awt.Dimension(24, 24));
94 | modeHelp.setMinimumSize(new java.awt.Dimension(24, 24));
95 | modeHelp.setPreferredSize(new java.awt.Dimension(24, 24));
96 |
97 | jLabel1.setText("Operation mode");
98 |
99 | buttonGroup1.add(Mode2);
100 | Mode2.setSelected(true);
101 | Mode2.setText("Include incomplete requests");
102 |
103 | jLabel2.setText("Known issue: If Burp \"Platform Authentication\" is in use, or \"Match and Replace\" in request is used, Flow is unable to match responses to related requests. This is caused by Burp API limitations (lack of unique identifiers in HttpRequestResponse). As a workaround I suggest to perform platform authentication / requests altering in upstream proxy.");
104 |
105 | buttonGroup1.add(Mode1);
106 | Mode1.setText("Display only requests with responses");
107 |
108 | jLabel3.setText("This mode can be useful when troubleshooting application locking during scans");
109 |
110 | miscHelp.setMargin(new java.awt.Insets(0, 0, 0, 0));
111 | miscHelp.setMaximumSize(new java.awt.Dimension(24, 24));
112 | miscHelp.setMinimumSize(new java.awt.Dimension(24, 24));
113 | miscHelp.setPreferredSize(new java.awt.Dimension(24, 24));
114 |
115 | jLabel4.setText("Miscellaneous");
116 | jLabel4.setToolTipText("");
117 |
118 | autoDelete.setText("Automatically delete oldest requests. Keep:");
119 |
120 | autoDeleteKeep.setText("1000");
121 |
122 | autoPopulate.setSelected(true);
123 | autoPopulate.setText("Populate with requests from Proxy history");
124 |
125 | showReflections.setText("Show parameter reflections. Count:");
126 |
127 | showReflectionsCount.setText("10");
128 |
129 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
130 | this.setLayout(layout);
131 | layout.setHorizontalGroup(
132 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
133 | .addGroup(layout.createSequentialGroup()
134 | .addContainerGap()
135 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
136 | .addGroup(layout.createSequentialGroup()
137 | .addComponent(jSeparator1)
138 | .addContainerGap())
139 | .addGroup(layout.createSequentialGroup()
140 | .addComponent(modeHelp, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
141 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
142 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
143 | .addComponent(Mode1)
144 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
145 | .addComponent(Mode2)
146 | .addGroup(layout.createSequentialGroup()
147 | .addGap(21, 21, 21)
148 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
149 | .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
150 | .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)))))
151 | .addGroup(layout.createSequentialGroup()
152 | .addComponent(miscHelp, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
153 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
154 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
155 | .addGroup(layout.createSequentialGroup()
156 | .addComponent(autoDelete)
157 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
158 | .addComponent(autoDeleteKeep, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
159 | .addComponent(autoPopulate)
160 | .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
161 | .addGroup(layout.createSequentialGroup()
162 | .addComponent(showReflections)
163 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
164 | .addComponent(showReflectionsCount, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))
165 | .addGap(0, 81, Short.MAX_VALUE))))
166 | );
167 | layout.setVerticalGroup(
168 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
169 | .addGroup(layout.createSequentialGroup()
170 | .addContainerGap()
171 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
172 | .addComponent(modeHelp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
173 | .addGroup(layout.createSequentialGroup()
174 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
175 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
176 | .addComponent(Mode1)))
177 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
178 | .addComponent(Mode2)
179 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
180 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
181 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
182 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
183 | .addGap(18, 18, 18)
184 | .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
185 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
186 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
187 | .addComponent(miscHelp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
188 | .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
189 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
190 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
191 | .addComponent(showReflections)
192 | .addComponent(showReflectionsCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
193 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
194 | .addComponent(autoPopulate)
195 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
196 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
197 | .addComponent(autoDelete)
198 | .addComponent(autoDeleteKeep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
199 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
200 | );
201 | }// //GEN-END:initComponents
202 |
203 |
204 | // Variables declaration - do not modify//GEN-BEGIN:variables
205 | private javax.swing.JRadioButton Mode1;
206 | private javax.swing.JRadioButton Mode2;
207 | private javax.swing.JCheckBox autoDelete;
208 | private javax.swing.JTextField autoDeleteKeep;
209 | private javax.swing.JCheckBox autoPopulate;
210 | private javax.swing.ButtonGroup buttonGroup1;
211 | private javax.swing.JLabel jLabel1;
212 | private javax.swing.JLabel jLabel2;
213 | private javax.swing.JLabel jLabel3;
214 | private javax.swing.JLabel jLabel4;
215 | private javax.swing.JSeparator jSeparator1;
216 | private javax.swing.JButton miscHelp;
217 | private javax.swing.JButton modeHelp;
218 | private javax.swing.JCheckBox showReflections;
219 | private javax.swing.JTextField showReflectionsCount;
220 | // End of variables declaration//GEN-END:variables
221 | }
222 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/resources/checkbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hvqzao/burp-flow/b44fbaa1e0f85238e29da569ea2a4874f71b1dfb/src/hvqzao/flow/resources/checkbox.png
--------------------------------------------------------------------------------
/src/hvqzao/flow/resources/newwindow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hvqzao/burp-flow/b44fbaa1e0f85238e29da569ea2a4874f71b1dfb/src/hvqzao/flow/resources/newwindow.png
--------------------------------------------------------------------------------
/src/hvqzao/flow/resources/panel_defaults.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hvqzao/burp-flow/b44fbaa1e0f85238e29da569ea2a4874f71b1dfb/src/hvqzao/flow/resources/panel_defaults.png
--------------------------------------------------------------------------------
/src/hvqzao/flow/resources/panel_help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hvqzao/burp-flow/b44fbaa1e0f85238e29da569ea2a4874f71b1dfb/src/hvqzao/flow/resources/panel_help.png
--------------------------------------------------------------------------------
/src/hvqzao/flow/ui/BooleanTableCellRenderer.java:
--------------------------------------------------------------------------------
1 | package hvqzao.flow.ui;
2 |
3 | import java.awt.Component;
4 | import java.awt.GridBagLayout;
5 | import java.awt.Insets;
6 | import javax.swing.JCheckBox;
7 | import javax.swing.JLabel;
8 | import javax.swing.JTable;
9 | import javax.swing.SwingUtilities;
10 | import javax.swing.table.TableCellRenderer;
11 |
12 | public class BooleanTableCellRenderer extends JCheckBox implements TableCellRenderer {
13 |
14 | public BooleanTableCellRenderer() {
15 | super();
16 | initialize();
17 | }
18 |
19 | private void initialize() {
20 | setOpaque(true);
21 | putClientProperty("JComponent.sizeVariant", "small");
22 | SwingUtilities.updateComponentTreeUI(this);
23 | setLayout(new GridBagLayout());
24 | setMargin(new Insets(0, 0, 0, 0));
25 | setHorizontalAlignment(JLabel.CENTER);
26 | setBorderPainted(true);
27 | }
28 |
29 | @Override
30 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
31 | //int modelRow = table.convertRowIndexToModel(row);
32 | setBackground(ThemeHelper.cellBackground(table.getRowCount(), row, isSelected));
33 | if (value instanceof Boolean) {
34 | setSelected((Boolean) value);
35 | }
36 | return this;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/ui/DialogWrapper.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
60 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/ui/DialogWrapper.java:
--------------------------------------------------------------------------------
1 | package hvqzao.flow.ui;
2 |
3 | import javax.swing.JButton;
4 | import javax.swing.JScrollPane;
5 |
6 | public class DialogWrapper extends javax.swing.JPanel {
7 |
8 | /**
9 | * Creates new form TokenRewriteEditWrapper
10 | */
11 | public DialogWrapper() {
12 | initComponents();
13 | }
14 |
15 | public JScrollPane getScrollPane() {
16 | return scrollPane;
17 | }
18 |
19 | public JButton getCancelButton() {
20 | return cancelButton;
21 | }
22 |
23 | public JButton getOkButton() {
24 | return okButton;
25 | }
26 |
27 | /**
28 | * This method is called from within the constructor to initialize the form.
29 | * WARNING: Do NOT modify this code. The content of this method is always
30 | * regenerated by the Form Editor.
31 | */
32 | @SuppressWarnings("unchecked")
33 | // //GEN-BEGIN:initComponents
34 | private void initComponents() {
35 |
36 | okButton = new javax.swing.JButton();
37 | cancelButton = new javax.swing.JButton();
38 | scrollPane = new javax.swing.JScrollPane();
39 |
40 | okButton.setText("OK");
41 |
42 | cancelButton.setText("Cancel");
43 |
44 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
45 | this.setLayout(layout);
46 | layout.setHorizontalGroup(
47 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
48 | .addGroup(layout.createSequentialGroup()
49 | .addContainerGap(240, Short.MAX_VALUE)
50 | .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
51 | .addGap(18, 18, 18)
52 | .addComponent(cancelButton)
53 | .addContainerGap())
54 | .addComponent(scrollPane)
55 | );
56 | layout.setVerticalGroup(
57 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
58 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
59 | .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
60 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
61 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
62 | .addComponent(okButton)
63 | .addComponent(cancelButton))
64 | .addContainerGap())
65 | );
66 | }// //GEN-END:initComponents
67 |
68 |
69 | // Variables declaration - do not modify//GEN-BEGIN:variables
70 | private javax.swing.JButton cancelButton;
71 | private javax.swing.JButton okButton;
72 | private javax.swing.JScrollPane scrollPane;
73 | // End of variables declaration//GEN-END:variables
74 | }
75 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/ui/Editor.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
83 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/ui/Editor.java:
--------------------------------------------------------------------------------
1 | package hvqzao.flow.ui;
2 |
3 | import burp.IBurpExtenderCallbacks;
4 | import burp.IExtensionHelpers;
5 | import hvqzao.flow.FlowExtension;
6 | import java.awt.Font;
7 | import java.awt.Rectangle;
8 | import java.awt.event.ActionEvent;
9 | import java.awt.event.ActionListener;
10 | import javax.swing.JTextArea;
11 | import javax.swing.text.BadLocationException;
12 | import javax.swing.text.DefaultCaret;
13 |
14 | public class Editor extends javax.swing.JPanel implements IEditor {
15 |
16 | private DefaultCaret caret;
17 | private IExtensionHelpers helpers;
18 | private int searchIndex;
19 |
20 | /**
21 | * Creates new form Editor
22 | */
23 | public Editor() {
24 | initComponents();
25 | searchIndex = -1;
26 | next.addActionListener(new ActionListener() {
27 | @Override
28 | public void actionPerformed(ActionEvent e) {
29 | String searchText = search.getText().toLowerCase();
30 | final int searchTextLength = searchText.length();
31 | if (searchTextLength > 0) {
32 | String message = editor.getText().toLowerCase();
33 | int result;
34 | if (searchIndex == -1) {
35 | result = message.indexOf(searchText);
36 | } else {
37 | result = message.indexOf(searchText, searchIndex);
38 | if (result == -1) {
39 | result = message.indexOf(searchText);
40 | }
41 | }
42 | final int pos = result;
43 | if (pos != -1) {
44 | searchIndex = pos + 1;
45 | editor.requestFocusInWindow();
46 | Rectangle viewRect;
47 | try {
48 | viewRect = editor.modelToView(pos);
49 | } catch (BadLocationException ex) {
50 | ex.printStackTrace(FlowExtension.getStderr());
51 | return;
52 | }
53 | editor.scrollRectToVisible(viewRect);
54 | editor.setCaretPosition(pos + searchTextLength);
55 | editor.moveCaretPosition(pos);
56 | }
57 | }
58 | }
59 | });
60 | prev.addActionListener(new ActionListener() {
61 | @Override
62 | public void actionPerformed(ActionEvent e) {
63 | String searchText = search.getText().toLowerCase();
64 | final int searchTextLength = searchText.length();
65 | if (searchTextLength > 0) {
66 | String message = editor.getText().toLowerCase();
67 | int result;
68 | if (searchIndex < 2) {
69 | result = message.lastIndexOf(searchText);
70 | } else {
71 | result = message.lastIndexOf(searchText, searchIndex - 2);
72 | if (result == -1) {
73 | result = message.lastIndexOf(searchText);
74 | }
75 | }
76 | final int pos = result;
77 | if (pos != -1) {
78 | searchIndex = pos + 1;
79 | editor.requestFocusInWindow();
80 | Rectangle viewRect;
81 | try {
82 | viewRect = editor.modelToView(pos);
83 | } catch (BadLocationException ex) {
84 | ex.printStackTrace(FlowExtension.getStderr());
85 | return;
86 | }
87 | editor.scrollRectToVisible(viewRect);
88 | editor.setCaretPosition(pos + searchTextLength);
89 | editor.moveCaretPosition(pos);
90 | }
91 | }
92 | }
93 | });
94 | }
95 |
96 | @Override
97 | public boolean hasFocus() {
98 | return editor.hasFocus();
99 | }
100 |
101 | @Override
102 | public void customizeUiComponent(final IBurpExtenderCallbacks callbacks) {
103 | helpers = callbacks.getHelpers();
104 | callbacks.customizeUiComponent(editor);
105 | callbacks.customizeUiComponent(prev);
106 | callbacks.customizeUiComponent(next);
107 | callbacks.customizeUiComponent(search);
108 | editor.setFont(new Font("monospaced", Font.PLAIN, 11));
109 | }
110 |
111 | @Override
112 | public void setText(byte[] message) {
113 | caret = (DefaultCaret) editor.getCaret();
114 | caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
115 | if (message != null) {
116 | editor.setText(helpers.bytesToString(message));
117 | }
118 | caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
119 | searchIndex = -1;
120 | }
121 |
122 | /**
123 | * This method is called from within the constructor to initialize the form.
124 | * WARNING: Do NOT modify this code. The content of this method is always
125 | * regenerated by the Form Editor.
126 | */
127 | @SuppressWarnings("unchecked")
128 | // //GEN-BEGIN:initComponents
129 | private void initComponents() {
130 |
131 | jScrollPane5 = new javax.swing.JScrollPane();
132 | editor = new javax.swing.JTextArea();
133 | prev = new javax.swing.JButton();
134 | next = new javax.swing.JButton();
135 | search = new javax.swing.JTextField();
136 |
137 | editor.setEditable(false);
138 | editor.setColumns(20);
139 | editor.setLineWrap(true);
140 | editor.setRows(5);
141 | editor.setToolTipText(null);
142 | jScrollPane5.setViewportView(editor);
143 |
144 | prev.setText("<");
145 |
146 | next.setText(">");
147 |
148 | search.setToolTipText(null);
149 |
150 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
151 | this.setLayout(layout);
152 | layout.setHorizontalGroup(
153 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
154 | .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)
155 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
156 | .addComponent(prev)
157 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
158 | .addComponent(next)
159 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
160 | .addComponent(search))
161 | );
162 | layout.setVerticalGroup(
163 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
164 | .addGroup(layout.createSequentialGroup()
165 | .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE)
166 | .addGap(0, 0, 0)
167 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
168 | .addComponent(search, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
169 | .addComponent(prev)
170 | .addComponent(next)))
171 | );
172 | }// //GEN-END:initComponents
173 |
174 |
175 | // Variables declaration - do not modify//GEN-BEGIN:variables
176 | private javax.swing.JTextArea editor;
177 | private javax.swing.JScrollPane jScrollPane5;
178 | private javax.swing.JButton next;
179 | private javax.swing.JButton prev;
180 | private javax.swing.JTextField search;
181 | // End of variables declaration//GEN-END:variables
182 |
183 | @Override
184 | public JTextArea getEditor() {
185 | return editor;
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/ui/IEditor.java:
--------------------------------------------------------------------------------
1 | package hvqzao.flow.ui;
2 |
3 | import burp.IBurpExtenderCallbacks;
4 | import javax.swing.JTextArea;
5 |
6 | public interface IEditor {
7 |
8 | public void customizeUiComponent(final IBurpExtenderCallbacks callbacks);
9 |
10 | public void setText(byte[] message);
11 |
12 | public JTextArea getEditor();
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/hvqzao/flow/ui/ThemeHelper.java:
--------------------------------------------------------------------------------
1 | package hvqzao.flow.ui;
2 |
3 | import static hvqzao.flow.FlowExtension.getSortOrder;
4 | import java.awt.Color;
5 | import javax.swing.UIManager;
6 |
7 | public class ThemeHelper {
8 |
9 | //private static final Color COLOR_NIMBUS_HIGHLIGHT = new Color(255, 197, 153); // new Color(255, 206, 130);
10 | private static final Color COLOR_NIMBUS_DARKGRAY = new Color(240, 240, 240);
11 | private static final Color COLOR_NIMBUS_LIGHTGRAY = new Color(250, 250, 250);
12 |
13 | private static final String THEME_NAME = UIManager.getLookAndFeel().getName().toLowerCase();
14 | private static final boolean DARK_THEME = "darcula".equals(THEME_NAME) || THEME_NAME.equals("burp dark"); // Updated to catch new "Dark" theme name in v2020.11+
15 |
16 | private static final Color COLOR_TABLE_BACKGROUND = UIManager.getColor("Table.background");
17 | private static final Color COLOR_TABLE_SELECTIONBACKGROUND = UIManager.getColor("Tree.selectionBackground");
18 |
19 | public static Color cellBackground(int rowCount, int row, boolean isSelected) {
20 | if (DARK_THEME) {
21 | if (isSelected) {
22 | return COLOR_TABLE_SELECTIONBACKGROUND;
23 | } else {
24 | return COLOR_TABLE_BACKGROUND;
25 | }
26 | }
27 | int r = row;
28 | if (getSortOrder() < 1) {
29 | r = rowCount - row;
30 | }
31 | if (isSelected) {
32 | //return COLOR_NIMBUS_HIGHLIGHT;
33 | return COLOR_TABLE_SELECTIONBACKGROUND;
34 | } else if (r % 20 == 1) {
35 | return COLOR_NIMBUS_DARKGRAY; // new Color(225, 225, 225);
36 | } else if (r % 2 == 1) {
37 | return COLOR_NIMBUS_LIGHTGRAY; // new Color(240, 240, 240);
38 | } else {
39 | //return COLOR_TABLE_BACKGROUND;
40 | return Color.WHITE;
41 | }
42 | }
43 |
44 | public static boolean isDarkTheme() {
45 | return DARK_THEME;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------