├── .gitignore
├── BappDescription.html
├── BappManifest.bmf
├── README.md
├── build.gradle
├── burp-extender
├── .gitignore
├── bin
│ └── burp
│ │ └── build.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
│ └── build.xml
├── examples
├── .DS_Store
├── basic-auth-test
│ ├── .gitignore
│ ├── Gemfile
│ ├── Gemfile.lock
│ ├── README.rdoc
│ ├── Rakefile
│ ├── app
│ │ ├── assets
│ │ │ ├── images
│ │ │ │ └── .keep
│ │ │ ├── javascripts
│ │ │ │ └── application.js
│ │ │ └── stylesheets
│ │ │ │ └── application.css
│ │ ├── controllers
│ │ │ ├── application_controller.rb
│ │ │ ├── application_controller.rb~
│ │ │ ├── concerns
│ │ │ │ └── .keep
│ │ │ ├── script_controller.rb
│ │ │ ├── user_controller.rb
│ │ │ └── user_controller.rb~
│ │ ├── helpers
│ │ │ └── application_helper.rb
│ │ ├── mailers
│ │ │ └── .keep
│ │ ├── models
│ │ │ ├── .keep
│ │ │ └── concerns
│ │ │ │ └── .keep
│ │ └── views
│ │ │ ├── layouts
│ │ │ └── application.html.erb
│ │ │ ├── private
│ │ │ └── _admin.html.erb
│ │ │ └── user
│ │ │ ├── show.html.erb
│ │ │ └── show.html.erb~
│ ├── bin
│ │ ├── bundle
│ │ ├── rails
│ │ └── rake
│ ├── config.ru
│ ├── config
│ │ ├── application.rb
│ │ ├── boot.rb
│ │ ├── database.yml
│ │ ├── environment.rb
│ │ ├── environments
│ │ │ ├── development.rb
│ │ │ ├── production.rb
│ │ │ └── test.rb
│ │ ├── initializers
│ │ │ ├── backtrace_silencers.rb
│ │ │ ├── filter_parameter_logging.rb
│ │ │ ├── inflections.rb
│ │ │ ├── mime_types.rb
│ │ │ ├── secret_token.rb
│ │ │ ├── session_store.rb
│ │ │ └── wrap_parameters.rb
│ │ ├── locales
│ │ │ └── en.yml
│ │ └── routes.rb
│ ├── db
│ │ └── seeds.rb
│ ├── lib
│ │ ├── assets
│ │ │ └── .keep
│ │ └── tasks
│ │ │ └── .keep
│ ├── log
│ │ └── .keep
│ ├── public
│ │ ├── 404.html
│ │ ├── 422.html
│ │ ├── 500.html
│ │ ├── favicon.ico
│ │ └── robots.txt
│ ├── test
│ │ ├── controllers
│ │ │ └── .keep
│ │ ├── fixtures
│ │ │ └── .keep
│ │ ├── helpers
│ │ │ └── .keep
│ │ ├── integration
│ │ │ └── .keep
│ │ ├── mailers
│ │ │ └── .keep
│ │ ├── models
│ │ │ └── .keep
│ │ └── test_helper.rb
│ └── vendor
│ │ └── assets
│ │ ├── javascripts
│ │ └── .keep
│ │ └── stylesheets
│ │ └── .keep
├── basic-xss.php
├── bypass-regex.php
├── dom-xss extensive tests
│ ├── .DS_Store
│ ├── README.md
│ ├── README.txt
│ ├── location.hash.htmlinject.dquot.html
│ ├── location.hash.htmlinject.html
│ ├── location.hash.htmlinject.squot.html
│ ├── location.hash.jsinject.dquot.html
│ ├── location.hash.jsinject.html
│ ├── location.hash.jsinject.squot.html
│ ├── location.pathname.htmlinject.dquot.php
│ ├── location.pathname.htmlinject.php
│ ├── location.pathname.htmlinject.squot.php
│ ├── location.pathname.jsinject.dquot.php
│ ├── location.pathname.jsinject.squot.php
│ ├── location.search.htmlinject.dquot.html
│ ├── location.search.htmlinject.html
│ ├── location.search.htmlinject.squot.html
│ ├── location.search.jsinject.dquot.html
│ ├── location.search.jsinject.html
│ ├── location.search.jsinject.squot.html
│ └── test_results.csv
├── dom-xss.php
├── jquery-1.11.1.min.js
├── jscontext-xss.php
└── resource-load.php
├── license.txt
├── settings.gradle
└── xss-detector
└── xss.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .gradle/
3 | build/
4 |
--------------------------------------------------------------------------------
/BappDescription.html:
--------------------------------------------------------------------------------
1 |
This extension sends responses to a locally-running
2 | XSS-Detector server, powered by either Phantom.js and/or Slimer.js
3 | Usage:
4 | Before starting an attack it is necessary to start the XSS-Detector servers.
5 | Navigate to the xss-detector directory and execute the following:
6 | $ phantomjs xss.js &
$ slimerjs slimer.js &
7 | The server will listen by default on port 8093. The server is expecting
8 | base64 encoded page responses passed via the http-response, which will be passed
9 | via the Burp extender.
10 | Navigate to the
11 | xssValidator tab, and copy the value for Grep Phrase. Enter this value within
12 | the Burp Intruder grep-match function. Payloads that match this Grep Phrase
13 | indicate successful execution of XSS payload.
14 | Examples:
15 | Within the xss-detector directory there is a folder of examples which can be
16 | used to test the extenders functionality.
17 |
18 | - Basic-xss.php: This is the most basic example of a web application that
19 | is vulnerable to XSS. It demonstrates how legitimate javascript
20 | functionality, such as alerts and console logs, do not trigger
21 | false-positives.
22 | - Bypass-regex.php: This demonstrates a XSS vulnerability that occurs when
23 | users attempt to filter input by running it through a single-pass regex.
24 | - Dom-xss.php: A basic script that demonstrates the tools ability to
25 | inject payloads into javascript functionality, and detect their success.
26 |
27 |
28 | Requires Java version 7
--------------------------------------------------------------------------------
/BappManifest.bmf:
--------------------------------------------------------------------------------
1 | Uuid: 98275a25394a417c9480f58740c1d981
2 | ExtensionType: 1
3 | Name: XSS Validator
4 | RepoName: xss-validator
5 | ScreenVersion: 1.3.2a
6 | SerialVersion: 7
7 | MinPlatformVersion: 0
8 | ProOnly: True
9 | Author: John Poulin
10 | ShortDescription: Sends responses to a locally-running XSS-Detector server.
11 | EntryPoint: build/libs/xss-validator-all.jar
12 | BuildCommand: gradle fatJar
13 | SupportedProducts: Pro
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | This is a burp intruder extender that is designed for automation and validation of XSS
6 | vulnerabilities.
7 |
8 | For more information, check out this blog post: http://blog.nvisium.com/2014/01/accurate-xss-detection-with-burpsuite.html
9 |
10 |
11 | XSS Detection
12 | -------------
13 |
14 | The burp intruder extender will be designed to forward responses to the XSS detection
15 | server, that will need to be running externally.
16 |
17 | The XSS detection server is powered by Phantom.js and/or Slimer.js.
18 |
19 | The XSS detection is influenced by Trustwave's blog post: Server-Side XSS Attack Detection with ModSecurity and PhantomJS:http://blog.spiderlabs.com/2013/02/server-site-xss-attack-detection-with-modsecurity-and-phantomjs.html
20 |
21 | Building Extender .Jar
22 | ----------------------
23 |
24 | To build the extender .jar file, we first need to ensure that the system has ant, and is running version Java 7 or higher.
25 |
26 | First, download the apache HttpComponents Client libraries. These libraries are available for free from http://hc.apache.org/. Once the libraries have been downloaded, create a lib directory in the project root and move the .jar libraries into this directory:
27 |
28 | $ mkdir /path/to/xssValidator/burp-extender/lib
29 | $ mv /path/to/libs/*.jar /path/to/xssValidator/burp-extender/lib/
30 |
31 | Now, navigate to the burp-extender/bin/burp directory:
32 |
33 | $ cd burp-extender/bin/burp
34 |
35 | Build the jar using Apache ant:
36 |
37 | $ ant
38 |
39 | After this has completed you should see a BUILD SUCCESSFUL message. The .jar file is located in burp-extender/bin/burp/xssValidator.jar. Import this into Burp.
40 |
41 | Usage
42 | -----
43 |
44 | Before starting an attack it is necessary to start the phantom and/or slimer xss-detection servers. Navigate to the xss-detector directory and execute the following to start phantom.js xss-detection script:
45 |
46 | $ phantomjs xss.js &
47 | $ slimerjs slimer.js &
48 |
49 | The server is expecting base64 encoded page responses passed via the http-response, which will be passed via the Burp extender.
50 |
51 | Examples
52 | --------
53 |
54 | Within the xss-detector directory there is a folder of examples which can be used to test
55 | the extenders functionality.
56 |
57 | * **Basic-xss.php**: This is the most basic example of a web application that is vulnerable to XSS. It demonstrates how legitimate javascript functionality, such as alerts and console logs, do not trigger false-positives.
58 | * **Bypass-regex.php**: This demonstrates a XSS vulnerability that occurs when users attempt to filter input by running it through a single-pass regex.
59 | * **Dom-xss.php**: A basic script that demonstrates the tools ability to inject payloads into javascript functionality, and detect their success.
60 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 |
3 | repositories {
4 | mavenCentral()
5 | }
6 |
7 | targetCompatibility = '1.8'
8 | sourceCompatibility = '1.8'
9 |
10 | dependencies {
11 | compile 'net.portswigger.burp.extender:burp-extender-api:1.7.13'
12 | compile 'commons-codec:commons-codec:1.10'
13 | compile 'org.apache.httpcomponents:httpcore:4.3.3'
14 | compile 'org.apache.httpcomponents:httpcomponents-client:4.3.2'
15 | compile 'org.apache.httpcomponents:httpclient-cache:4.3.2'
16 | }
17 |
18 | sourceSets {
19 | main {
20 | java {
21 | srcDir 'burp-extender/src'
22 | }
23 | }
24 | }
25 |
26 | task fatJar(type: Jar) {
27 | baseName = project.name + '-all'
28 | from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
29 | with jar
30 | }
31 |
--------------------------------------------------------------------------------
/burp-extender/.gitignore:
--------------------------------------------------------------------------------
1 | /bin
2 | *.jar
3 | .project
4 | .classpath
5 | .externalToolBuilders
6 | .settings
7 |
--------------------------------------------------------------------------------
/burp-extender/bin/burp/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/burp-extender/src/burp/BurpExtender.java:
--------------------------------------------------------------------------------
1 | package burp;
2 |
3 | import java.util.regex.*;
4 |
5 | import java.awt.BorderLayout;
6 | import java.awt.GridLayout;
7 | import java.awt.Font;
8 | import java.awt.Component;
9 | import java.awt.Dimension;
10 | import java.io.PrintWriter;
11 | import java.util.ArrayList;
12 | import java.util.List;
13 | import java.net.URL;
14 |
15 | import javax.swing.JButton;
16 | import javax.swing.JLabel;
17 | import javax.swing.JPanel;
18 | import javax.swing.JScrollPane;
19 | import javax.swing.JTabbedPane;
20 | import javax.swing.JTextArea;
21 | import javax.swing.JTextField;
22 | import javax.swing.ScrollPaneConstants;
23 | import javax.swing.SwingUtilities;
24 |
25 | import org.apache.commons.codec.binary.Base64;
26 | import org.apache.http.HttpResponse;
27 | import org.apache.http.client.HttpClient;
28 | import org.apache.http.client.entity.UrlEncodedFormEntity;
29 | import org.apache.http.client.methods.HttpPost;
30 | import org.apache.http.impl.client.HttpClientBuilder;
31 | import org.apache.http.message.BasicNameValuePair;
32 | import org.apache.http.util.EntityUtils;
33 |
34 | import burp.ITab;
35 |
36 | public class BurpExtender implements IBurpExtender, ITab, IHttpListener,
37 | IIntruderPayloadGeneratorFactory, IIntruderPayloadProcessor, IScannerCheck {
38 | private static final String VERSION = "1.3.2";
39 |
40 | public IBurpExtenderCallbacks mCallbacks;
41 | private IExtensionHelpers helpers;
42 | private PrintWriter stdout;
43 | private PrintWriter stderr;
44 | private HttpClient client;
45 | private static String phantomServer = "http://127.0.0.1:8093";
46 |
47 | private static String slimerServer = "http://127.0.0.1:8094";
48 |
49 | public static String triggerPhrase = "299792458";
50 | public static String grepPhrase = "fy7sdufsuidfhuisdf";
51 | public static String errorGrepPhrase = "uerhgrgwgwiuhuiogj";
52 | public JLabel htmlDescription;
53 | public JPanel mainPanel;
54 | public JPanel leftPanel;
55 | public JPanel serverConfig;
56 | public JPanel notice;
57 | public JPanel rightPanel;
58 | public JTextField phantomURL;
59 | public JTextField slimerURL;
60 | public JTextField grepVal;
61 | public JTextField errorGrepVal;
62 | public JTabbedPane tabbedPane;
63 | public JButton btnAddText;
64 | public JButton btnSaveTabAsTemplate;
65 | public JButton btnRemoveTab;
66 | public JTextField functionsTextfield;
67 | public JTextArea attackStringsTextarea;
68 | public JTextField eventHandlerTextfield;
69 | public JScrollPane scrollingArea;
70 | public static final String JAVASCRIPT_PLACEHOLDER = "{JAVASCRIPT}";
71 | public static final String EVENTHANDLER_PLACEHOLDER = "{EVENTHANDLER}";
72 |
73 |
74 | public static final byte[][] PAYLOADS = {
75 | ("").getBytes(),
76 | ("" + BurpExtender.JAVASCRIPT_PLACEHOLDER + "").getBytes(),
77 | ("\">").getBytes(),
78 | ("\"><\"").getBytes(),
79 | ("'>").getBytes(),
80 | ("'><'").getBytes(),
81 | ("").getBytes(),
82 | ("pt>" + BurpExtender.JAVASCRIPT_PLACEHOLDER + ";ipt>").getBytes(),
83 | ("PT>" + BurpExtender.JAVASCRIPT_PLACEHOLDER + ";IPT>").getBytes(),
84 | ("ipt>pt>" + BurpExtender.JAVASCRIPT_PLACEHOLDER + ";ript>ipt>").getBytes(),
85 | ("\";" + BurpExtender.JAVASCRIPT_PLACEHOLDER + ";\"").getBytes(),
86 | ("';" + BurpExtender.JAVASCRIPT_PLACEHOLDER + ";'").getBytes(),
87 | (";" + BurpExtender.JAVASCRIPT_PLACEHOLDER + ";").getBytes(),
88 | (BurpExtender.JAVASCRIPT_PLACEHOLDER + ";").getBytes(),
89 | ("" + BurpExtender.JAVASCRIPT_PLACEHOLDER + "").getBytes(),
90 | ("\\\";" + BurpExtender.JAVASCRIPT_PLACEHOLDER + ";//").getBytes(),
91 | ("").getBytes(),
93 | ("<").getBytes(),
94 | ("\"" + BurpExtender.EVENTHANDLER_PLACEHOLDER + "="
95 | + BurpExtender.JAVASCRIPT_PLACEHOLDER + " ").getBytes(),
96 | ("<").getBytes(),
97 | ("
").getBytes(),
98 | ("
\">").getBytes(),
104 | ("
'>").getBytes(),
105 | ("\"\"\">
5 |