├── .gradle ├── 5.6.2 │ ├── gc.properties │ ├── fileChanges │ │ └── last-build.bin │ ├── fileHashes │ │ ├── fileHashes.bin │ │ └── fileHashes.lock │ ├── javaCompile │ │ ├── taskHistory.bin │ │ ├── classAnalysis.bin │ │ └── javaCompile.lock │ ├── fileContent │ │ └── fileContent.lock │ └── executionHistory │ │ ├── executionHistory.bin │ │ └── executionHistory.lock ├── vcs-1 │ └── gc.properties ├── vcsWorkingDirs │ └── gc.properties ├── 4.9 │ ├── fileChanges │ │ └── last-build.bin │ ├── fileHashes │ │ ├── fileHashes.bin │ │ └── fileHashes.lock │ ├── taskHistory │ │ ├── taskHistory.bin │ │ └── taskHistory.lock │ └── fileContent │ │ └── fileContent.lock └── buildOutputCleanup │ ├── cache.properties │ ├── outputFiles.bin │ └── buildOutputCleanup.lock ├── .idea ├── vcs.xml ├── codeStyles │ └── codeStyleConfig.xml ├── dictionaries │ └── ateyar.xml ├── misc.xml ├── compiler.xml ├── modules.xml ├── libraries │ └── Gradle__net_portswigger_burp_extender_burp_extender_api_2_1.xml ├── gradle.xml ├── modules │ ├── flarequench.iml │ ├── flarequench_test.iml │ └── flarequench_main.iml └── uiDesigner.xml ├── src └── main │ ├── resources │ └── logging.properties │ └── java │ └── burp │ ├── BurpExtender.java │ ├── ScannerCheck.java │ └── ScanIssue.java ├── .github └── FUNDING.yml ├── .travis.yml ├── BappDescription.html ├── README.md ├── .gitignore └── LICENSE /.gradle/5.6.2/gc.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/vcsWorkingDirs/gc.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/4.9/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/5.6.2/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 24 03:29:51 BST 2019 2 | gradle.version=5.6.2 3 | -------------------------------------------------------------------------------- /.gradle/4.9/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/4.9/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/4.9/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/4.9/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/4.9/taskHistory/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/4.9/taskHistory/taskHistory.bin -------------------------------------------------------------------------------- /.gradle/5.6.2/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/4.9/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/4.9/fileContent/fileContent.lock -------------------------------------------------------------------------------- /.gradle/4.9/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/4.9/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /.gradle/5.6.2/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/5.6.2/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /.gradle/5.6.2/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/fileContent/fileContent.lock -------------------------------------------------------------------------------- /.gradle/5.6.2/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /.gradle/5.6.2/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /.gradle/5.6.2/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /.gradle/5.6.2/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aress31/flarequench/HEAD/.gradle/5.6.2/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/dictionaries/ateyar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | comparer 5 | teyar 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/logging.properties: -------------------------------------------------------------------------------- 1 | handlers=java.util.logging.StreamHandler 2 | java.util.logging.StreamHandler.level=ALL 3 | java.util.logging.StreamHandler.formatter=java.util.logging.SimpleFormatter 4 | sun.net.www.protocol.http.HttpURLConnection.level=ALL 5 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: AresS31 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__net_portswigger_burp_extender_burp_extender_api_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | before_cache: 4 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 5 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ 6 | 7 | before_install: if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install gradle ; fi 8 | 9 | cache: 10 | directories: 11 | - $HOME/.gradle/caches/ 12 | - $HOME/.gradle/wrapper/ 13 | 14 | deploy: 15 | api_key: 16 | secure: $GITHUB_TOKEN 17 | file: build/libs/flarequench.jar 18 | overwrite: true 19 | provider: releases 20 | on: 21 | all_branches: true 22 | tags: true 23 | skip_cleanup: true 24 | 25 | install: 26 | - gradle clean 27 | - gradle build shadowJar 28 | 29 | jdk: 30 | - oraclejdk11 31 | 32 | os: 33 | - linux 34 | - osx 35 | # Java on Windows is not yet supported by Travis CI 36 | # - windows -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/modules/flarequench.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /BappDescription.html: -------------------------------------------------------------------------------- 1 |

This extension provides the following features:

2 | 7 | 8 |

If you are experiencing any issue at all, please file an issue on the GitHub project page or contact me personally via LinkedIn.

9 | -------------------------------------------------------------------------------- /.idea/modules/flarequench_test.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/modules/flarequench_main.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/burp/BurpExtender.java: -------------------------------------------------------------------------------- 1 | /* 2 | # Copyright (C) 2019 Alexandre Teyar 3 | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | */ 16 | 17 | package burp; 18 | 19 | public class BurpExtender implements IBurpExtender { 20 | 21 | private static String EXTENSION = "FlareQuench"; 22 | 23 | @Override 24 | public void registerExtenderCallbacks(IBurpExtenderCallbacks burpExtenderCallbacks) { 25 | burpExtenderCallbacks.registerScannerCheck(new ScannerCheck(burpExtenderCallbacks)); 26 | burpExtenderCallbacks.setExtensionName(EXTENSION); 27 | burpExtenderCallbacks 28 | .printOutput(String.format("%s extension successfully loaded", EXTENSION)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flarequench 2 | 3 | lang 4 | license 5 | 6 | A Burp Suite plugin that adds additional checks to the passive scanner to reveal the origin IP(s) of Cloudflare-protected web applications. 7 | 8 | ## Installation 9 | 10 | ### Compilation 11 | 12 | 1. Install and configure [Gradle](https://gradle.org/). 13 | 14 | 2. Download this repository. 15 | 16 | ```bash 17 | git clone https://github.com/aress31/flarequench 18 | cd .\flarequench\ 19 | ``` 20 | 21 | 3. Create the standalone `jar`: 22 | 23 | ```bash 24 | gradle build shadowJar 25 | ``` 26 | 27 | ### Loading the Extension Into the `Burp Suite` 28 | 29 | In `Burp Suite`, under the `Extender/Options` tab, click on the `Add` button and load the `fatJar` located in the `.\build\libs` folder. 30 | 31 | ## Roadmap 32 | 33 | - [ ] Improve the reliablity. 34 | - [x] Optimise the source code. 35 | 36 | ## Sponsor 💖 37 | 38 | If you want to support this project and appreciate the time invested in developping, maintening and extending it; consider donating toward my next cup of coffee. ☕ 39 | 40 | It is easy, all you got to do is press the `Sponsor` button at the top of this page or alternatively [click this link](https://github.com/sponsors/aress31). 💸 41 | 42 | ## Reporting Issues 43 | 44 | Found a bug? I would love to squash it! 🐛 45 | 46 | Please report all issues on the GitHub [issues tracker](https://github.com/aress31/flarequench/issues). 47 | 48 | ## Contributing 49 | 50 | You would like to contribute to better this project? 🤩 51 | 52 | Please submit all `PRs` on the GitHub [pull requests tracker](https://github.com/aress31/flarequench/pulls). 53 | 54 | ## License 55 | 56 | See [LICENSE](LICENSE). 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/java,gradle,intellij 2 | # Edit at https://www.gitignore.io/?templates=java,gradle,intellij 3 | 4 | ### Intellij ### 5 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 6 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 7 | 8 | # User-specific stuff 9 | .idea/**/workspace.xml 10 | .idea/**/tasks.xml 11 | .idea/**/usage.statistics.xml 12 | .idea/**/dictionaries 13 | .idea/**/shelf 14 | 15 | # Generated files 16 | .idea/**/contentModel.xml 17 | 18 | # Sensitive or high-churn files 19 | .idea/**/dataSources/ 20 | .idea/**/dataSources.ids 21 | .idea/**/dataSources.local.xml 22 | .idea/**/sqlDataSources.xml 23 | .idea/**/dynamic.xml 24 | .idea/**/uiDesigner.xml 25 | .idea/**/dbnavigator.xml 26 | 27 | # Gradle 28 | .idea/**/gradle.xml 29 | .idea/**/libraries 30 | 31 | # Gradle and Maven with auto-import 32 | # When using Gradle or Maven with auto-import, you should exclude module files, 33 | # since they will be recreated, and may cause churn. Uncomment if using 34 | # auto-import. 35 | # .idea/modules.xml 36 | # .idea/*.iml 37 | # .idea/modules 38 | # *.iml 39 | # *.ipr 40 | 41 | # CMake 42 | cmake-build-*/ 43 | 44 | # Mongo Explorer plugin 45 | .idea/**/mongoSettings.xml 46 | 47 | # File-based project format 48 | *.iws 49 | 50 | # IntelliJ 51 | out/ 52 | 53 | # mpeltonen/sbt-idea plugin 54 | .idea_modules/ 55 | 56 | # JIRA plugin 57 | atlassian-ide-plugin.xml 58 | 59 | # Cursive Clojure plugin 60 | .idea/replstate.xml 61 | 62 | # Crashlytics plugin (for Android Studio and IntelliJ) 63 | com_crashlytics_export_strings.xml 64 | crashlytics.properties 65 | crashlytics-build.properties 66 | fabric.properties 67 | 68 | # Editor-based Rest Client 69 | .idea/httpRequests 70 | 71 | # Android studio 3.1+ serialized cache file 72 | .idea/caches/build_file_checksums.ser 73 | 74 | ### Intellij Patch ### 75 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 76 | 77 | # *.iml 78 | # modules.xml 79 | # .idea/misc.xml 80 | # *.ipr 81 | 82 | # Sonarlint plugin 83 | .idea/**/sonarlint/ 84 | 85 | # SonarQube Plugin 86 | .idea/**/sonarIssues.xml 87 | 88 | # Markdown Navigator plugin 89 | .idea/**/markdown-navigator.xml 90 | .idea/**/markdown-navigator/ 91 | 92 | ### Java ### 93 | # Compiled class file 94 | *.class 95 | 96 | # Log file 97 | *.log 98 | 99 | # BlueJ files 100 | *.ctxt 101 | 102 | # Mobile Tools for Java (J2ME) 103 | .mtj.tmp/ 104 | 105 | # Package Files # 106 | *.jar 107 | *.war 108 | *.nar 109 | *.ear 110 | *.zip 111 | *.tar.gz 112 | *.rar 113 | 114 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 115 | hs_err_pid* 116 | 117 | ### Gradle ### 118 | .gradle 119 | build/ 120 | 121 | # Ignore Gradle GUI config 122 | gradle-app.setting 123 | 124 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 125 | !gradle-wrapper.jar 126 | 127 | # Cache of project 128 | .gradletasknamecache 129 | 130 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 131 | # gradle/wrapper/gradle-wrapper.properties 132 | 133 | ### Gradle Patch ### 134 | **/build/ 135 | 136 | # End of https://www.gitignore.io/api/java,gradle,intellij -------------------------------------------------------------------------------- /src/main/java/burp/ScannerCheck.java: -------------------------------------------------------------------------------- 1 | /* 2 | # Copyright (C) 2019 Alexandre Teyar 3 | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | */ 16 | 17 | package burp; 18 | 19 | import java.net.MalformedURLException; 20 | import java.net.URL; 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | public class ScannerCheck implements IScannerCheck { 25 | 26 | private IBurpExtenderCallbacks burpExtenderCallbacks; 27 | 28 | private List hosts = new ArrayList<>(); 29 | 30 | ScannerCheck(IBurpExtenderCallbacks burpExtenderCallbacks) { 31 | this.burpExtenderCallbacks = burpExtenderCallbacks; 32 | } 33 | 34 | // TODO: Ensure that CrimeFlare sends a response back, if blacklisted print an alert 35 | private boolean queryCrimeFlare(String host) { 36 | IExtensionHelpers helpers = this.burpExtenderCallbacks.getHelpers(); 37 | byte[] response; 38 | 39 | try { 40 | URL url = new URL("http://www.crimeflare.org:82/cgi-bin/cfsearch.cgi"); 41 | byte[] request = helpers.buildHttpRequest(url); 42 | request = helpers 43 | .addParameter(request, helpers.buildParameter("cfS", host, IParameter.PARAM_BODY)); 44 | request = helpers.toggleRequestMethod(request); 45 | 46 | // this.burpExtenderCallbacks.printOutput(helpers.bytesToString(request)); 47 | response = burpExtenderCallbacks 48 | .makeHttpRequest("crimeflare.org", 82, false, request); 49 | // this.burpExtenderCallbacks.printOutput(helpers.bytesToString(response)); 50 | 51 | if (helpers.bytesToString(response).contains("these are not CloudFlare-user nameservers.")) { 52 | this.burpExtenderCallbacks.printOutput("No entry found in the CloudFlare database"); 53 | return false; 54 | } else { 55 | this.burpExtenderCallbacks.printOutput("Existing entry found in the CloudFlare database"); 56 | return true; 57 | } 58 | } catch (MalformedURLException e) { 59 | this.burpExtenderCallbacks 60 | .printError(String.format("%s", e.getMessage())); 61 | this.burpExtenderCallbacks 62 | .issueAlert(String.format("%s", e.getMessage())); 63 | } 64 | 65 | return false; 66 | } 67 | 68 | @Override 69 | public List doPassiveScan(IHttpRequestResponse baseRequestResponse) { 70 | List scanIssues = new ArrayList<>(); 71 | String host = baseRequestResponse.getHttpService().getHost(); 72 | 73 | // TODO: Check that the below code behaves as expected, and that we are not sending 74 | // TODO: more than 1 request to CrimeFlare per host being scanned 75 | // Check if the host has already been queried against the CrimeFlare database in order to 76 | // reduce the total number of requests sent 77 | if (!this.hosts.contains(host)) { 78 | if (queryCrimeFlare(host)) { 79 | scanIssues.add(new ScanIssue(this.burpExtenderCallbacks, baseRequestResponse)); 80 | } 81 | } 82 | 83 | this.hosts.add(baseRequestResponse.getHttpService().getHost()); 84 | 85 | return scanIssues; 86 | } 87 | 88 | @Override 89 | public List doActiveScan(IHttpRequestResponse baseRequestResponse, 90 | IScannerInsertionPoint insertionPoint) { 91 | return null; 92 | } 93 | 94 | @Override 95 | public int consolidateDuplicateIssues(IScanIssue existingIssue, IScanIssue newIssue) { 96 | return -1; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/burp/ScanIssue.java: -------------------------------------------------------------------------------- 1 | /* 2 | # Copyright (C) 2019 Alexandre Teyar 3 | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | */ 16 | 17 | package burp; 18 | 19 | import java.net.MalformedURLException; 20 | import java.net.URL; 21 | 22 | public class ScanIssue implements IScanIssue { 23 | 24 | // private IBurpExtenderCallbacks burpExtenderCallbacks; 25 | private IHttpRequestResponse httpRequestResponse; 26 | 27 | ScanIssue(IBurpExtenderCallbacks burpExtenderCallbacks, 28 | IHttpRequestResponse httpRequestResponse) { 29 | // this.burpExtenderCallbacks = burpExtenderCallbacks; 30 | this.httpRequestResponse = httpRequestResponse; 31 | } 32 | 33 | @Override 34 | public URL getUrl() { 35 | try { 36 | return new URL("http://www.notworkingyet.co.uk"); 37 | } catch (MalformedURLException e) { 38 | e.printStackTrace(); 39 | } 40 | 41 | // TODO: Troubleshot the following code which is not working for some obscure reasons... 42 | // return this.burpExtenderCallbacks.getHelpers() 43 | // .analyzeRequest(this.httpRequestResponse.getRequest()).getUrl(); 44 | return null; 45 | } 46 | 47 | @Override 48 | public String getIssueName() { 49 | return "Cloudflare bypass"; 50 | } 51 | 52 | @Override 53 | public int getIssueType() { 54 | return 0; 55 | } 56 | 57 | @Override 58 | public String getSeverity() { 59 | return "High"; 60 | } 61 | 62 | @Override 63 | public String getConfidence() { 64 | return "Certain"; 65 | } 66 | 67 | @Override 68 | public String getIssueBackground() { 69 | return 70 | "

Cloudflare is a web infrastructure and website security company, providing content " 71 | + "delivery network services, DDoS mitigation, Internet security, and distributed " 72 | + "domain name server services. Cloudflare's services sit between a website's visitor " 73 | + "and the Cloudflare customer's hosting provider, acting as a reverse proxy for " 74 | + "websites.

" 75 | + "" 76 | + "

It was possible to obtain the application's origin IP(s) which represent the" 77 | + "server(s) sitting behind Cloudflare. With this information an attacker could" 78 | + "directly target the application server(s), effectively bypassing the layer of " 79 | + "protection offered by Cloudflare. To exploit this, an attacker would need to " 80 | + "redirect their network traffic to the discovered origin IP(s) and manipulate the " 81 | + "\"Host\" header of their HTTP(S) requests to the relevant hostname in order to " 82 | + "ensure that the application's origin server is still able to route the traffic " 83 | + "to the correct virtual host. This destination IP and host header manipulation " 84 | + "can be achieved automatically using the Target Redirector Burp extension " 85 | + "available in the Burp App Store.

" 86 | + "" 87 | + "

When using this approach, keep in mind that behind Cloudflare, the naked " 88 | + "application might be hosted from a different TCP port than that which Cloudflare " 89 | + "presented it on. A port scan of the origin IP and a process of elimination can " 90 | + "help to identify the correct port. The Target Redirector extension can also " 91 | + "automatically change the port, as well as switch between HTTP and HTTPS " 92 | + "necessary.

"; 93 | } 94 | 95 | @Override 96 | public String getRemediationBackground() { 97 | return "

It is strongly advised to set firewall rules on the application server(s) so that " 98 | + "only web requests from Cloudflare and IP addresses that the application may require " 99 | + "access to are authorised. This will prevent attackers from performing Denial of Service " 100 | + "(DoS) attacks or any other type of attacks that Cloudflare could hinder or prevent " 101 | + "altogether.

"; 102 | } 103 | 104 | @Override 105 | public String getIssueDetail() { 106 | return 107 | "

The application is protected by Cloudflare. However, it appears that CrimeFlare was " 108 | + "able to determine the application server(s) origin IP address(es). This means that " 109 | + "bypassing Cloudflare using the application's origin IP(s) and HTTP \"Host\" header " 110 | + "should be possible. This can be achieved automatically using the Target Redirector " 111 | + "Burp extension available in the Burp App store.

" 112 | + "" 113 | + "

Please visit " 114 | + "CrimeFlare to manually investigate and validate this issue.

"; 115 | } 116 | 117 | @Override 118 | public String getRemediationDetail() { 119 | return "

Consider protecting the application server(s) with firewall rules which whitelist " 120 | + "Cloudflare's network and prevent access from any other IP ranges.

"; 121 | } 122 | 123 | @Override 124 | public IHttpRequestResponse[] getHttpMessages() { 125 | return new IHttpRequestResponse[0]; 126 | } 127 | 128 | @Override 129 | public IHttpService getHttpService() { 130 | return this.httpRequestResponse.getHttpService(); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /.idea/uiDesigner.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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------