Giter Site home page Giter Site logo

classicvalues / javascript-security Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gradle/javascript-security

0.0 1.0 0.0 133.73 MB

A Burp Suite extension which performs checks for cross-domain scripting against the DOM, subresource integrity checks, and evaluates JavaScript resources against threat intelligence data.

License: GNU General Public License v3.0

Shell 0.13% Java 98.23% HTML 1.65%

javascript-security's Introduction

Building

./gradlew fatJar

The output JAR will be located inside build/libs folder e.g. javascript-security-extension-all-1.1.jar

JavaScript Security Burp Extension

This is a burp extension which adds passive checks to the Burp scanner. The following is a list of items it will look for:

  • Cross-Domain Script Includes (DOM)
  • JavaScript Missing Subresource Integrity Attributes
  • CORS Headers Do Not Require Subresource Integrity
  • Malicious/Vulnerable JavaScript Includes
  • Subresource Integrity Failed Validation
  • Cross-Domain Script Includes where DNS Resolution Fails

It does this by looking at the HTML received and loads the DOM via a headless Chromium instance using Selenium.

Licensing and Recognition

Distributed under GPLv3. Copyright 2019: Focal Point Data Risk, LLC Written by: Peter Hefley

Installation

  1. Obtain a copy of this repo.
  2. Ensure that Chrome/Chromium is installed in a standard location.
  3. Obtain the appropriate chromedriver for your OS and version of Chrome (see: http://chromedriver.chromium.org/downloads/version-selection). Note the file location.
  4. In burp, go to the extender tab, extensions sub-tab, and Add this extension. It is a Java extension type and you will need to select the included, or built, jar file.
  5. Once started, select the "JavaScript Security" tab and set the correct chrome driver location.

Configuration

A "JavaScript Security" tab will appear in your burp session which allows you to configure two things:

  • The path to the chromedriver binary you want to use. This defaults to the bundled version appropriate for your operating system. Setting a chromedriver here will override the default.
  • The delay before evaluating the DOM (in seconds). As all of the JavaScript is gathered and run, the DOM may change over time. For advanced pages or slow connections, you might want to bump this up, but passive scans will take longer. The default, which I've had luck with, is 10 seconds.

It is possible to load indicators of compromise (IOCs) as JSON files through the GUI tab. Examples are provided in the intel folder.

Execution

When you run passive checks, the checks installed will run. Any output or errors will appear on the Extender/Extensions tab under "JavaScript Security -- SRI and Threat Intel".

Requirements

  1. watch the DOM (not "html") and log every loaded JS as a finding (medium?). totally ignore scope
  2. check every loaded js against a list of known compromised and make different alert
  3. profit
  4. When you can't load a JS resource, check to see if the domain is available.

Known Issues

I've seen weird caching issues with systemd-resolved, the default DNS service on Ubuntu. If you see resources which cannot be accessed due to DNS issues, consider disabling the DNS caching or clearing your cache. Both seem to help.

/etc/systemd > cat resolved.conf | grep "Cache"

Cache=no

When you change your version of Chrome, you will also need to change your version of ChromeDriver, now. Google no longer supports drivers for a range of chrome versions. See http://chromedriver.chromium.org/downloads/version-selection

References

javascript-security's People

Contributors

pbielicki avatar portswiggersupport avatar phefley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.